Optimize vendor code
This commit is contained in:
parent
28fc21c90e
commit
376be2ae0d
|
@ -2,6 +2,7 @@
|
||||||
{% include polyfills.html %}
|
{% include polyfills.html %}
|
||||||
|
|
||||||
<!-- script -->
|
<!-- script -->
|
||||||
|
<script src='{{base}}/assets/packed/vendor.js?t={{ timestamp }}'></script>
|
||||||
<script src='{{base}}/assets/packed/app.js?t={{ timestamp }}'></script>
|
<script src='{{base}}/assets/packed/app.js?t={{ timestamp }}'></script>
|
||||||
|
|
||||||
<!-- 3rd-party libs -->
|
<!-- 3rd-party libs -->
|
||||||
|
|
|
@ -5,7 +5,11 @@ const UglifyJSPlugin = require('uglifyjs-webpack-plugin')
|
||||||
module.exports = {
|
module.exports = {
|
||||||
context: join(__dirname, '..'),
|
context: join(__dirname, '..'),
|
||||||
entry: {
|
entry: {
|
||||||
app: './_js/app.js'
|
app: './_js/app.js',
|
||||||
|
vendor: [
|
||||||
|
'jquery',
|
||||||
|
'prismjs'
|
||||||
|
]
|
||||||
},
|
},
|
||||||
output: {
|
output: {
|
||||||
path: join(__dirname, '..', 'assets', 'packed'),
|
path: join(__dirname, '..', 'assets', 'packed'),
|
||||||
|
@ -31,6 +35,16 @@ module.exports = {
|
||||||
},
|
},
|
||||||
stats: 'minimal',
|
stats: 'minimal',
|
||||||
plugins: [
|
plugins: [
|
||||||
|
// Optimize module ID's for vendor chunks
|
||||||
|
new webpack.HashedModuleIdsPlugin({
|
||||||
|
hashFunction: 'sha256',
|
||||||
|
hashDigest: 'base64',
|
||||||
|
hashDigestLength: 20
|
||||||
|
}),
|
||||||
|
|
||||||
|
// Optimize vendor
|
||||||
|
new webpack.optimize.CommonsChunkPlugin('vendor'),
|
||||||
|
|
||||||
// Don't include debug symbols ever
|
// Don't include debug symbols ever
|
||||||
new webpack.EnvironmentPlugin({
|
new webpack.EnvironmentPlugin({
|
||||||
NODE_ENV: 'production'
|
NODE_ENV: 'production'
|
||||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue