Created
May 7, 2017 13:55
-
-
Save b-tiwari/d2e8adfb4fe9aaadfe84d07e2483904d to your computer and use it in GitHub Desktop.
Webpack2 Beginner's Guide - adding another instance of HtmlWebpackPlugin to webpack.config.js
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
| var HtmlWebpackPlugin = require('html-webpack-plugin'); | |
| var package = require('../package.json'); | |
| module.exports = { | |
| entry: { | |
| app: "./src/scripts/app.js", | |
| vendor: Object.keys(package.dependencies), | |
| settings: "./src/scripts/settings.js" | |
| }, | |
| output: { | |
| filename: "./dist/[name].bundle.js" | |
| }, | |
| watch:true, | |
| resolve: { extensions: [".js", ".ts"] }, | |
| plugins: [ | |
| new HtmlWebpackPlugin({ | |
| hash: true, | |
| title: 'My Awesome application', | |
| myPageHeader: 'Hello World', | |
| template: './src/index.html', | |
| chunks: ['vendor', 'app'], | |
| filename: './dist/index.html' //relative to root of the application | |
| }), | |
| new HtmlWebpackPlugin({ | |
| hash: true, | |
| title: 'My Awesome application', | |
| myPageHeader: 'Settings', | |
| template: './src/index.html', | |
| chunks: ['vendor', 'settings'], | |
| filename: './dist/settings.html' | |
| }) | |
| ] | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment