Created
December 11, 2017 15:05
-
-
Save AaronFlower/8538883ee86f500a2e905f6ff8ca0f48 to your computer and use it in GitHub Desktop.
webpack-config-optimize
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const path = require('path') | |
const webpack = require('webpack') | |
const htmlWebpackPlugin = require('html-webpack-plugin') | |
module.exports = { | |
entry: { | |
app: './src/main.js', | |
moduleA: './src/moduleA.js', | |
moduleB: './src/moduleB.js', | |
moduleC: './src/moduleC.js' | |
}, | |
output: { | |
path: path.resolve(__dirname, './dist'), | |
filename: '[name].js' | |
}, | |
plugins: [ | |
new htmlWebpackPlugin({ | |
title: 'Webpack CommonsChunkPlugin' | |
}), | |
new webpack.optimize.CommonsChunkPlugin({ | |
name: 'self.lodash.vendor', | |
chunks: ['moduleA', 'moduleB'] | |
}) | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment