-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
46 lines (45 loc) · 1.22 KB
/
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
40
41
42
43
44
45
46
var path = require("path");
var webpack = require('webpack');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var CopyWebpackPlugin = require('copy-webpack-plugin');
module.exports = {
devtool: "source-map",
watch: false,
context: path.resolve(__dirname, "client/scripts"),
entry: {
main: "./startup",
login: "./login"
},
node: {
fs: "empty",
},
output: {
path: path.resolve(__dirname, 'dist'),
filename: "bundle-[name].js",
publicPath: "/"
},
module: {
rules: [
{ test: /\.html$/, exclude: /node_modules/, use: { loader: "html-loader" } },
{ test: /\.scss$/, use: [{ loader: "style-loader" }, { loader: "css-loader" }, { loader: "sass-loader" }] },
{ test: /\.(jpe?g|png|gif|svg)$/i, loader: 'url-loader' }
]
},
plugins: [new HtmlWebpackPlugin({
chunks: ['login'],
filename: 'login.html',
template: '../html/login.html',
title: 'dido.knx'
}),
new HtmlWebpackPlugin({
chunks: ['main'],
filename: 'index.html',
template: '../html/index.html',
title: 'dido.knx'
}),
new CopyWebpackPlugin([
{ from: '../manifest.json', to: './' },
{ from: './sw.js', to: './' },
{ from: '../images/icon/', to: './icon/' }
])]
};