ui: 优化资源加载

This commit is contained in:
undefined committed 2021-06-11 16:03:40 +08:00
1 parent bc74870a39
commit 167c70c2b1
24 files changed
+167 -188

No files matched your search

+1 -2
View File
@@ -2,7 +2,6 @@
/* eslint-disable guard-for-in */
/* eslint-disable import/no-extraneous-dependencies */
import _ from 'lodash';
import moment from 'moment';
import gulp from 'gulp';
import log from 'fancy-log';
import chalk from 'chalk';
@@ -16,7 +15,7 @@ import vjTouch from '../plugins/gulpTouch';
let isInWatchMode = false;
export const tasks = {};
const iconTimestamp = moment.utc([2020, 0, 1, 0, 0, 0, 0]).unix();
const iconTimestamp = 1577836800; // 2020-1-1
function handleWatchChange(name, r = 300) {
return _.debounce((ev) => {
+2 -5
View File
@@ -71,7 +71,7 @@ export default function (env = {}) {
const config = {
bail: true,
mode: env.production ? 'production' : 'development',
mode: (env.production || env.measure) ? 'production' : 'development',
profile: true,
context: root(),
entry: {
@@ -127,7 +127,6 @@ export default function (env = {}) {
minSize: 80000,
maxAsyncRequests: 15,
maxInitialRequests: 10,
chunks: 'all',
},
moduleIds: env.production ? 'size' : 'named',
chunkIds: env.production ? 'size' : 'named',
@@ -169,12 +168,10 @@ export default function (env = {}) {
NODE_ENV: env.production ? '"production"' : '"debug"',
},
}),
...env.production
...(env.production || env.measure)
? [
new OptimizeCssAssetsPlugin(),
new webpack.optimize.ModuleConcatenationPlugin(),
new webpack.LoaderOptionsPlugin({ minimize: true }),
new webpack.HashedModuleIdsPlugin(),
]
: [],
new webpack.LoaderOptionsPlugin({