Commit 9c84a1f3 authored by 前端-钟卫鹏's avatar 前端-钟卫鹏

fix: 启用缓存中间件加速二次编译速度

parent a89091b5
......@@ -2,6 +2,7 @@ import { defineConfig } from 'umi';
import routes from './router'
import proxy from './proxy'
import theme from './lingxi.theme.config'
const HardSourceWebpackPlugin = require('hard-source-webpack-plugin');
const OPEN_THEME_BUILD = process.env.NODE_ENV === 'production' ? true : false // 是否开启动态主题
const isProduction = process.env.NODE_ENV === 'production' ? true : false
......@@ -84,6 +85,27 @@ const config: any = {
},
}
});
// config.plugin('hardSource').use(HardSourceWebpackPlugin)
config.plugin('hardSource').use(new HardSourceWebpackPlugin({
cacheDirectory: 'node_modules/.cache/hard-source/[confighash]',
configHash: function(webpackConfig) {
return require('node-object-hash')({sort: false}).hash(webpackConfig);
}
})) // 使用中间缓存步骤扩展提升二次编译速度
// 对下面配置的 module 不进行缓存
config.plugin('hardSourceExcludeModule').use(HardSourceWebpackPlugin.ExcludeModulePlugin, [
[
{
test: /mini-css-extract-plugin[\\/]dist[\\/]loader/,
},
// {
// test: /eslint-loader/,
// },
// {
// test: /.*\.DS_Store/,
// },
],
]);
},
cssLoader: {
localsConvention: 'camelCase', // 将style中的class由 .foo-body 转化为fooBody调用
......
......@@ -44,6 +44,7 @@
"@ant-design/icons": "^4.2.1",
"@ant-design/pro-layout": "^5.0.16",
"@antv/data-set": "^0.11.5",
"@ctrl/tinycolor": "^3.4.0",
"@formily/antd": "^1.3.3",
"@formily/antd-components": "^1.3.3",
"@types/crypto-js": "^4.0.1",
......@@ -76,20 +77,20 @@
"react-dnd": "^11.1.3",
"react-dnd-html5-backend": "^11.1.3",
"react-dom": "^16.12.0",
"react-sortablejs": "^6.0.0",
"sortablejs": "^1.12.0",
"react-fontawesome": "^1.7.1",
"react-image-crop": "^8.6.4",
"react-reconciler": "^0.25.1",
"react-sortablejs": "^6.0.0",
"rgbaster": "^2.1.1",
"sortablejs": "^1.12.0",
"typescript": "^3.9.7",
"umi": "3.2.28",
"video-react": "^0.14.1",
"yorkie": "^2.0.0"
},
"devDependencies": {
"@types/sortablejs": "^1.10.6",
"@types/qrcode": "^1.3.4",
"@types/sortablejs": "^1.10.6",
"async": "^3.2.0",
"axios": "^0.19.2",
"chalk": "^4.1.0",
......@@ -104,6 +105,7 @@
"god-yapi2ts": "^1.0.0",
"gulp": "^4.0.2",
"gulp-git": "^2.10.1",
"hard-source-webpack-plugin": "^0.13.1",
"http-proxy-middleware": "^1.0.5",
"json2ts": "^0.0.7",
"node-cmd": "^4.0.0",
......
......@@ -104,7 +104,7 @@ export const formSchema: ISchema = {
renderAddition: () => React.createElement('p', { style: { color: "#00B37A", width: '100%', textAlign: "center" }}, ' + 添加评标内容'),
renderMoveUp: () => null,
renderMoveDown: () => null,
// renderRemove: () => React.createElement('button', { type: "button", class: "ant-btn ant-btn-link"}, '删除'),
renderRemove: '删除',
},
items: {
type: 'object',
......
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