-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvue.config.js
41 lines (35 loc) · 1.04 KB
/
vue.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// eslint-disable-next-line @typescript-eslint/no-var-requires
const FixStyleOnlyEntriesPlugin = require('webpack-fix-style-only-entries');
// Only currently used theme will be compiled and included in html
const THEME = 'default';
const STYLES = {
['vendor/material-components-web--theme-' + THEME] : `./src/vendor/mdc/material-components-web--theme-${THEME}.scss`,
['app-global--theme-' + THEME] : `./src/styles/app-global--theme-${THEME}.scss`,
}
module.exports = {
configureWebpack: {
plugins: [
// Do not generate .js files for stylesheets
new FixStyleOnlyEntriesPlugin(),
]
},
chainWebpack: config => {
// Add styles to entry points
Object.keys(STYLES).forEach(k => {
config.entry(k)
.add(STYLES[k])
})
},
css: {
loaderOptions: {
scss: {
sassOptions: {
// Include node_modules to resolve @use inside MDC SCSS
includePaths: ["./node_modules"],
},
// Include theme SCSS in each component to make sure it is properly themed
additionalData: '@use "~@/styles/themes/' + THEME + '";'
}
}
}
}