trashposs/webpack/module/rules/theme-color.ts
2018-02-15 20:00:23 +09:00

27 lines
470 B
TypeScript

/**
* Theme color provider
*/
const constants = require('../../../src/const.json');
export default () => ({
enforce: 'pre',
test: /\.vue$/,
exclude: /node_modules/,
use: [{
loader: 'replace-string-loader',
options: {
search: '$theme-color-foreground',
replace: constants.themeColorForeground,
flags: 'g'
}
}, {
loader: 'replace-string-loader',
options: {
search: '$theme-color',
replace: constants.themeColor,
flags: 'g'
}
}]
});