Skip to content
This repository was archived by the owner on Dec 30, 2021. It is now read-only.

Support css modules in vue style tags #111

@hitautodestruct

Description

@hitautodestruct

In snowpack it is not clear how to enable css modules for .vue files using the module attribute.

Usage example:

<template>
  <div :class="$style.App"></div>
</template>

<style lang="scss" module>
.App {
  text-align: center;
}
</style>

Using the above with snowpack the app throws an error in the browser:

TypeError: Cannot read property 'App' of undefined
    at Proxy.render (App.js?mtime=1591252156733:15)
    at renderComponentRoot (vue.js:1362)
    at componentEffect (vue.js:4140)
    at reactiveEffect (vue.js:297)
    at effect (vue.js:272)
    at setupRenderEffect (vue.js:4132)
    at mountComponent (vue.js:4091)
    at processComponent (vue.js:4048)
    at patch (vue.js:3711)
    at render (vue.js:4810)

Vue-loader for webpack allows this behaviour see docs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions