Skip to content

Commit

Permalink
Setting up HtmlWebpackPlugin
Browse files Browse the repository at this point in the history
  • Loading branch information
zainfathoni committed Feb 27, 2018
1 parent 852af9f commit 6631fce
Show file tree
Hide file tree
Showing 4 changed files with 232 additions and 7 deletions.
8 changes: 4 additions & 4 deletions dist/index.html
@@ -1,9 +1,9 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Output Management</title>
<script src="./print.main.js"></script>
</head>
<body>
<script src="./app.main.js"></script>
</body>
</html>
<script type="text/javascript" src="app.main.js"></script><script type="text/javascript" src="print.main.js"></script></body>
</html>
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -14,6 +14,7 @@
"css-loader": "^0.28.10",
"csv-loader": "^2.1.1",
"file-loader": "^1.1.10",
"html-webpack-plugin": "webpack-contrib/html-webpack-plugin",
"style-loader": "^0.20.2",
"webpack": "^4.0.0",
"webpack-cli": "^2.0.9",
Expand Down
6 changes: 6 additions & 0 deletions webpack.config.js
@@ -1,11 +1,17 @@
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');

module.exports = {
mode: 'development',
entry: {
app: './src/index.js',
print: './src/print.js'
},
plugins: [
new HtmlWebpackPlugin({
title: 'Output Management'
})
],
output: {
filename: '[name].main.js',
path: path.resolve(__dirname, 'dist')
Expand Down

0 comments on commit 6631fce

Please sign in to comment.