-
-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathindex.html
More file actions
26 lines (25 loc) · 910 Bytes
/
index.html
File metadata and controls
26 lines (25 loc) · 910 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<!doctype html><html><head><meta charset="utf-8"><title>Webpack App</title><meta name="viewport" content="width=device-width,initial-scale=1"><script defer="defer" src="main.js"></script></head><body><h1>Hello world!</h1><hr/><h2>webpack.config.js</h2><pre>
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const HtmlWebpackPartialsPlugin = require('../../');
module.exports = {
entry: {
main: path.join(__dirname, './main.js')
},
output: {
path: path.join(__dirname, './dist'),
filename: '[name].js'
},
plugins: [
new HtmlWebpackPlugin(),
new HtmlWebpackPartialsPlugin({
path: path.join(__dirname, './partials/body.html')
})
]
};
</pre><h2>main.js</h2><pre>
console.log('Test!');
</pre><h2>partials/body.html</h2><pre>
<h1>Hello world!</h1>
...and the rest of this configuration example
</pre></body></html>