You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
998 B
37 lines
998 B
let path = require('path') |
|
const ThemeColorReplacer = require('webpack-theme-color-replacer') |
|
const {getThemeColors, changeSelector, modifyVars} = require('./src/utils/themeUtil') |
|
const themeColor = require('./src/config').themeColor |
|
|
|
module.exports = { |
|
pluginOptions: { |
|
'style-resources-loader': { |
|
preProcessor: 'less', |
|
patterns: [path.resolve(__dirname, "./src/theme/theme.less")], |
|
} |
|
}, |
|
configureWebpack: config => { |
|
config.entry.app = ["babel-polyfill", "whatwg-fetch", "./src/main.js"]; |
|
config.plugins.push( |
|
new ThemeColorReplacer({ |
|
fileName: 'css/theme-colors-[contenthash:8].css', |
|
matchColors: getThemeColors(themeColor), |
|
changeSelector |
|
}) |
|
) |
|
}, |
|
css: { |
|
loaderOptions: { |
|
less: { |
|
lessOptions: { |
|
modifyVars: modifyVars(themeColor), |
|
javascriptEnabled: true |
|
} |
|
} |
|
} |
|
}, |
|
publicPath: './', |
|
outputDir: 'dist', |
|
assetsDir: 'static', |
|
productionSourceMap: false |
|
}
|
|
|