forked from microsoft/FluidFramework
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.cjs
More file actions
50 lines (46 loc) · 1.07 KB
/
webpack.config.cjs
File metadata and controls
50 lines (46 loc) · 1.07 KB
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
47
48
49
50
/*!
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
* Licensed under the MIT License.
*/
const HtmlWebpackPlugin = require("html-webpack-plugin");
module.exports = (env) => {
const htmlTemplate = "./src/index.html";
const mode = env && env.production ? "production" : "development";
return {
devtool: mode === "production" ? "source-map" : "inline-source-map",
entry: {
app: "./src/app.ts",
},
resolve: {
extensionAlias: {
".cjs": [".cts", ".cjs"],
".js": [".ts", ".tsx", ".js"],
".mjs": [".mts", ".mjs"],
},
extensions: [".ts", ".tsx", ".js", ".cjs", ".mjs"],
fallback: {
// stochastic-test-utils uses fs and path for logging ops generated for fuzz testing.
fs: false,
path: false,
process: false,
},
},
module: {
rules: [
{
test: /\.tsx?$/,
loader: "ts-loader",
},
],
},
mode,
output: {
filename: "[name].[contenthash].js",
clean: env && env.clean,
},
plugins: [new HtmlWebpackPlugin({ template: htmlTemplate })],
devServer: {
open: false,
},
};
};