A webpack plugin to provide Dynamic Theme for Fishx
npm install @fishx/fishx-theme-webpack-pluginindex.html file so
js
const AntDesignThemePlugin = require('@fishx/fishx-theme-webpack-plugin');
const options = {
antDir: path.join(__dirname, './node_modules/antd'),
stylesDir: path.join(__dirname, './src/styles'),
varFile: path.join(__dirname, './src/styles/variables.less'),
mainLessFile: path.join(__dirname, './src/styles/index.less'),
themeVariables: ['@primary-color'],
indexFileName: 'index.html',
generateOnce: false,
lessUrl: "https://cdnjs.cloudflare.com/ajax/libs/less.js/2.7.2/less.min.js",
publicPath: "",
customColorRegexArray: [], // An array of regex codes to match your custom color variable values so that code can identify that it's a valid color. Make sure your regex does not adds false positives.
}
const themePlugin = new AntDesignThemePlugin(options);
// in config object
plugins: [
themePlugin
]
`
Add this plugin in plugins` array.