Refactoring
This commit is contained in:
parent
e237c53766
commit
fb70e3b176
12 changed files with 202 additions and 121 deletions
25
webpack/module/rules/theme-color.ts
Normal file
25
webpack/module/rules/theme-color.ts
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
/**
|
||||
* Theme color provider
|
||||
*/
|
||||
|
||||
const StringReplacePlugin = require('string-replace-webpack-plugin');
|
||||
|
||||
const constants = require('../../../src/const.json');
|
||||
|
||||
export default () => ({
|
||||
enforce: 'pre',
|
||||
test: /\.tag$/,
|
||||
exclude: /node_modules/,
|
||||
loader: StringReplacePlugin.replace({
|
||||
replacements: [
|
||||
{
|
||||
pattern: /\$theme\-color\-foreground/g,
|
||||
replacement: () => constants.themeColorForeground
|
||||
},
|
||||
{
|
||||
pattern: /\$theme\-color/g,
|
||||
replacement: () => constants.themeColor
|
||||
},
|
||||
]
|
||||
})
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue