This commit is contained in:
huixisheng 2017-09-29 09:43:08 +02:00 committed by Sergio Crisostomo
parent a65aef1a56
commit 0a0971da1d
4 changed files with 38 additions and 10 deletions

View file

@ -2,8 +2,9 @@
* 公共配置
*/
var path = require('path');
var webpack = require('webpack');
function resolve (dir) {
return path.join(__dirname, '..', dir)
return path.join(__dirname, '..', dir);
}
module.exports = {
@ -63,5 +64,8 @@ module.exports = {
'vue': 'vue/dist/vue.esm.js',
'@': resolve('src')
}
}
},
plugins: [
new webpack.optimize.ModuleConcatenationPlugin()
]
};

View file

@ -2,6 +2,7 @@ var path = require('path');
var webpack = require('webpack');
var merge = require('webpack-merge');
var webpackBaseConfig = require('./webpack.base.config.js');
var CompressionPlugin = require('compression-webpack-plugin');
process.env.NODE_ENV = 'production';
@ -34,6 +35,13 @@ module.exports = merge(webpackBaseConfig, {
compress: {
warnings: false
}
}),
new CompressionPlugin({
asset: '[path].gz[query]',
algorithm: 'gzip',
test: /\.(js|css)$/,
threshold: 10240,
minRatio: 0.8
})
]
});

31
package-lock.json generated
View file

@ -1,6 +1,6 @@
{
"name": "iview",
"version": "2.3.2",
"version": "2.4.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
@ -1887,6 +1887,25 @@
}
}
},
"compression-webpack-plugin": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/compression-webpack-plugin/-/compression-webpack-plugin-1.0.0.tgz",
"integrity": "sha512-OPp+tvvMCd8FrJHDLG4v5EpP4Fe5w5uBNXOmc3K7SdBaK1FH+TGwtafG9GLgTI6c2WHIgDFt98T8qXwaXuyRnw==",
"requires": {
"async": "2.4.1",
"webpack-sources": "1.0.1"
},
"dependencies": {
"async": {
"version": "2.4.1",
"resolved": "https://registry.npmjs.org/async/-/async-2.4.1.tgz",
"integrity": "sha1-YqVrJ5yYoR0JhwlqAcw+6463u9c=",
"requires": {
"lodash": "4.17.4"
}
}
}
},
"concat-map": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
@ -12302,8 +12321,7 @@
"lodash": {
"version": "4.17.4",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.4.tgz",
"integrity": "sha1-eCA6TRwyiuHYbcpkYONptX9AVa4=",
"dev": true
"integrity": "sha1-eCA6TRwyiuHYbcpkYONptX9AVa4="
},
"lodash._baseassign": {
"version": "3.2.0",
@ -14438,14 +14456,12 @@
"source-list-map": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/source-list-map/-/source-list-map-2.0.0.tgz",
"integrity": "sha512-I2UmuJSRr/T8jisiROLU3A3ltr+swpniSmNPI4Ml3ZCX6tVnDsuZzK7F2hl5jTqbZBWCEKlj5HRQiPExXLgE8A==",
"dev": true
"integrity": "sha512-I2UmuJSRr/T8jisiROLU3A3ltr+swpniSmNPI4Ml3ZCX6tVnDsuZzK7F2hl5jTqbZBWCEKlj5HRQiPExXLgE8A=="
},
"source-map": {
"version": "0.5.6",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.6.tgz",
"integrity": "sha1-dc449SvwczxafwwRjYEzSiu19BI=",
"dev": true
"integrity": "sha1-dc449SvwczxafwwRjYEzSiu19BI="
},
"source-map-support": {
"version": "0.4.18",
@ -16272,7 +16288,6 @@
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-1.0.1.tgz",
"integrity": "sha512-05tMxipUCwHqYaVS8xc7sYPTly8PzXayRCB4dTxLhWTqlKUiwH6ezmEe0OSreL1c30LAuA3Zqmc+uEBUGFJDjw==",
"dev": true,
"requires": {
"source-list-map": "2.0.0",
"source-map": "0.5.6"

View file

@ -41,6 +41,7 @@
},
"dependencies": {
"async-validator": "^1.8.1",
"compression-webpack-plugin": "^1.0.0",
"core-js": "^2.5.0",
"deepmerge": "^1.5.1",
"element-resize-detector": "^1.1.12",