Config DllPlugin
This commit is contained in:
parent
659472eac3
commit
6c5869ff0e
File diff suppressed because it is too large
Load Diff
|
@ -1,5 +1,6 @@
|
||||||
var path = require('path')
|
var path = require('path')
|
||||||
var utils = require('./utils')
|
var utils = require('./utils')
|
||||||
|
var webpack = require('webpack')
|
||||||
var config = require('../config')
|
var config = require('../config')
|
||||||
var vueLoaderConfig = require('./vue-loader.conf')
|
var vueLoaderConfig = require('./vue-loader.conf')
|
||||||
|
|
||||||
|
@ -59,5 +60,11 @@ module.exports = {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
},
|
||||||
|
plugins: [
|
||||||
|
new webpack.DllReferencePlugin({
|
||||||
|
context: path.resolve(__dirname, '..'),
|
||||||
|
manifest: require('./vendor-manifest.json')
|
||||||
|
})
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,29 @@
|
||||||
|
const path = require('path');
|
||||||
|
const webpack = require('webpack');
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
entry: {
|
||||||
|
vendor: ['vue/dist/vue.common.js','vue-router', 'babel-polyfill','axios','vue-echarts-v3']
|
||||||
|
},
|
||||||
|
output: {
|
||||||
|
path: path.join(__dirname, '../static/js'),
|
||||||
|
filename: '[name].dll.js',
|
||||||
|
library: '[name]_library'
|
||||||
|
},
|
||||||
|
plugins: [
|
||||||
|
new webpack.DllPlugin({
|
||||||
|
path: path.join(__dirname, '.', '[name]-manifest.json'),
|
||||||
|
name: '[name]_library'
|
||||||
|
}),
|
||||||
|
new webpack.optimize.UglifyJsPlugin({
|
||||||
|
compress: {
|
||||||
|
warnings: false
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
new webpack.DefinePlugin({
|
||||||
|
'process.env': {
|
||||||
|
NODE_ENV: '"production"'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
]
|
||||||
|
};
|
|
@ -9,6 +9,7 @@
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="app"></div>
|
<div id="app"></div>
|
||||||
|
<script src="./static/js/vendor.dll.js"></script>
|
||||||
<script>
|
<script>
|
||||||
var _hmt = _hmt || [];
|
var _hmt = _hmt || [];
|
||||||
(function() {
|
(function() {
|
||||||
|
|
|
@ -6,7 +6,8 @@
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "node build/dev-server.js",
|
"dev": "node build/dev-server.js",
|
||||||
"build": "node build/build.js"
|
"build": "node build/build.js",
|
||||||
|
"build:dll": "webpack --config build/webpack.dll.conf.js"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"axios": "^0.15.3",
|
"axios": "^0.15.3",
|
||||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue