Skip to content

Instantly share code, notes, and snippets.

@yanwei07
Created November 29, 2019 03:01
Show Gist options
  • Save yanwei07/799971f21781ed4fad338cfbaef81d6a to your computer and use it in GitHub Desktop.
Save yanwei07/799971f21781ed4fad338cfbaef81d6a to your computer and use it in GitHub Desktop.
webpack.config.conf file for multiplepage
module.exports = {
entry: {
app: './src/app.js',
mgmt: ['./src/modules/mgmt/mgmt.js'],
login: './src/modules/login/login.js'
},
plugins: [
new MiniCssExtractPlugin({
filename: "[name].css",
chunkFilename: "[id].css"
}),
new CleanWebpackPlugin(['dist']),
new VueLoaderPlugin(),
new HtmlWebpackPlugin({
title: 'app',
template: './src/app.html',
// inject: false,
chunks: ['app'],
filename: './index.html'
}),
new HtmlWebpackPlugin({
title: 'mgmt',
template: './src/modules/mgmt/mgmt.html',
// inject: false,
chunks: ['mgmt'],
filename: './mgmt/index.html'
}),
new HtmlWebpackPlugin({
title: 'login',
template: './src/modules/login/login.html',
// inject: false,
chunks: ['login'],
filename: './login/index.html'
})
] }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment