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 utils = require('./utils')
|
||||
var webpack = require('webpack')
|
||||
var config = require('../config')
|
||||
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>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<script src="./static/js/vendor.dll.js"></script>
|
||||
<script>
|
||||
var _hmt = _hmt || [];
|
||||
(function() {
|
||||
|
|
|
@ -6,7 +6,8 @@
|
|||
"private": true,
|
||||
"scripts": {
|
||||
"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": {
|
||||
"axios": "^0.15.3",
|
||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue