forked from microsoft/FluidHelloWorld
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
33 lines (29 loc) · 855 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
/*!
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
const { CleanWebpackPlugin } = require("clean-webpack-plugin");
const HtmlWebpackPlugin = require("html-webpack-plugin");
module.exports = env => {
const htmlTemplate = "./src/index.html";
const plugins = env && env.clean
? [new CleanWebpackPlugin(), new HtmlWebpackPlugin({ template: htmlTemplate })]
: [new HtmlWebpackPlugin({ template: htmlTemplate })];
const mode = env && env.prod
? "production"
: "development";
return {
devtool: "inline-source-map",
entry: {
app: "./src/app.js",
},
mode,
output: {
filename: "[name].[contenthash].js",
},
plugins,
devServer: {
open: true
}
};
};