Commit 77357aee authored by ι™ˆεΈ…'s avatar ι™ˆεΈ…

fix #2791, product environment removal plugin

parent 802930e7
...@@ -5,26 +5,29 @@ import AntDesignThemePlugin from 'antd-theme-webpack-plugin'; ...@@ -5,26 +5,29 @@ import AntDesignThemePlugin from 'antd-theme-webpack-plugin';
import path from 'path'; import path from 'path';
export default config => { export default config => {
// ε°†ζ‰€ζœ‰ less εˆεΉΆδΈΊδΈ€δΈͺδΎ› themePlugin使用 // pro ε’Œ εΌ€ε‘ηŽ―ε’ƒε†ζ·»εŠ θΏ™δΈͺ插仢
const outFile = path.join(__dirname, '../.temp/ant-design-pro.less'); if (process.env.APP_TYPE === 'site' || process.env.NODE_ENV !== 'production') {
const stylesDir = path.join(__dirname, '../src/'); // ε°†ζ‰€ζœ‰ less εˆεΉΆδΈΊδΈ€δΈͺδΎ› themePlugin使用
const outFile = path.join(__dirname, '../.temp/ant-design-pro.less');
const stylesDir = path.join(__dirname, '../src/');
config.plugin('merge-less').use(MergeLessPlugin, [ config.plugin('merge-less').use(MergeLessPlugin, [
{ {
stylesDir, stylesDir,
outFile, outFile,
}, },
]); ]);
config.plugin('ant-design-theme').use(AntDesignThemePlugin, [ config.plugin('ant-design-theme').use(AntDesignThemePlugin, [
{ {
antDir: path.join(__dirname, '../node_modules/antd'), antDir: path.join(__dirname, '../node_modules/antd'),
stylesDir, stylesDir,
varFile: path.join(__dirname, '../node_modules/antd/lib/style/themes/default.less'), varFile: path.join(__dirname, '../node_modules/antd/lib/style/themes/default.less'),
mainLessFile: outFile, // themeVariables: ['@primary-color'], mainLessFile: outFile, // themeVariables: ['@primary-color'],
indexFileName: 'index.html', indexFileName: 'index.html',
generateOne: true, generateOne: true,
lessUrl: 'https://gw.alipayobjects.com/os/lib/less.js/3.8.1/less.min.js', lessUrl: 'https://gw.alipayobjects.com/os/lib/less.js/3.8.1/less.min.js',
}, },
]); ]);
}
}; };
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment