-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
39 lines (37 loc) · 1009 Bytes
/
webpack.config.js
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
27
28
29
30
31
32
33
34
35
36
37
38
39
var path = require('path');
var HtmlWebpackPlugin = require('html-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');
var outputFolder = "./dist"
module.exports = {
mode: 'development',
entry: './js/app.js',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'app.js'
},
devServer: {
contentBase: path.resolve("./dist/"),
watchContentBase: true,
port: 80
},
plugins: [
new HtmlWebpackPlugin({
title: 'Template',
template: './index.html',
alwaysWriteToDisk:true
}),
new CopyWebpackPlugin([
{
from: path.resolve(__dirname, 'manifest.json'),
to: path.resolve(__dirname, outputFolder + "/manifest.json")
},
{
from: path.resolve(__dirname, 'sw.js'),
to: path.resolve(__dirname, outputFolder + "/sw.js")
},
{
from: path.resolve(__dirname, 'images/*'),
to: path.resolve(__dirname, outputFolder)
}
])]
};