2017-05-16 10:00:56 -05:00
|
|
|
/**
|
|
|
|
* Theme color provider
|
|
|
|
*/
|
|
|
|
|
|
|
|
const StringReplacePlugin = require('string-replace-webpack-plugin');
|
|
|
|
|
|
|
|
const constants = require('../../../src/const.json');
|
|
|
|
|
|
|
|
export default () => ({
|
|
|
|
enforce: 'pre',
|
2018-02-09 23:56:33 -06:00
|
|
|
test: /\.vue$/,
|
2017-05-16 10:00:56 -05:00
|
|
|
exclude: /node_modules/,
|
|
|
|
loader: StringReplacePlugin.replace({
|
|
|
|
replacements: [
|
|
|
|
{
|
|
|
|
pattern: /\$theme\-color\-foreground/g,
|
|
|
|
replacement: () => constants.themeColorForeground
|
|
|
|
},
|
|
|
|
{
|
|
|
|
pattern: /\$theme\-color/g,
|
|
|
|
replacement: () => constants.themeColor
|
|
|
|
},
|
|
|
|
]
|
|
|
|
})
|
|
|
|
});
|