Closed jannikbuscha closed 2 years ago
Some screenshots:
Facing the same issue. Any update on this.
Facing the same issue. Any update on this.
in nuxt 3 which runs with vue 3 everything works strangely, but I have not dealt with the problem further.
see vue-cli-css-modules
i resolve it by change my scss filename end with .module.(css|less|sass|scss|styl)
and you can change the vueconfigjs like this:
// vue.config.js module.exports = { css: { requireModuleExtension: false } }
see vue-cli-css-modules i resolve it by change my scss filename end with .module.(css|less|sass|scss|styl) and you can change the vueconfigjs like this:
// vue.config.js module.exports = { css: { requireModuleExtension: false } }
css.modules and requireModuleExtension is removed in vuecli5, and you can resolve it like this:
To import CSS or other pre-processor files as CSS Modules in JavaScript, the filename should end with .module(s).(css|less|sass|scss|styl)
or change config like this
module.exports=defineConfig({
css: {
loaderOptions: {
css: {
modules: true
}
}
}
})
css: {
modules: {
mode: 'icss'
}
}
Today, l was also meet this problem. the css-modules part solved my ploblem.
The scss filename should end with .module(s).(css|less|sass|scss|styl)
, then you can import scss files as CSS Modules in JavaScript
Version
5.0.0-beta.7
Environment info
Steps to reproduce
Create a Vue project with Typescript and a
vue.config.js
that looks like this:What is expected?
Loading my
style.scss
What is actually happening?
It does not load my
style.scss
The only way to load my
style.scss
file is by importing it intomain.ts
. Also the:export
function in my scss file does not work. When I try to load something from:export
I get backundefined
.