fix: vue scoped css

This commit is contained in:
Igor Randjelovic
2021-07-01 13:50:25 +02:00
parent 2d47cf327b
commit 14edc70336
2 changed files with 31 additions and 0 deletions

View File

@ -36,6 +36,21 @@ export default function (config: Config, env: IWebpackEnv = _env): Config {
};
});
// apply vue stylePostLoader to inject component scope into the css
// this would usually be automatic, however in NS we don't use the
// css-loader, so VueLoader doesn't inject the rule at all.
config.module
.rule('css')
.use('vue-css-loader')
.after('css2json-loader')
.loader('vue-loader/lib/loaders/stylePostLoader.js');
config.module
.rule('scss')
.use('vue-css-loader')
.after('css2json-loader')
.loader('vue-loader/lib/loaders/stylePostLoader.js');
// set up ts support in vue files
config.module
.rule('ts')