generated from hi-se/gas-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
46 lines (44 loc) · 910 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
40
41
42
43
44
45
46
const path = require("path");
const GasPlugin = require("gas-webpack-plugin");
const mode =
process.env.NODE_ENV === "development" ? "development" : "production";
const devtool = "inline-source-map";
const entry = path.resolve("src", "index.ts");
const outPath = path.resolve("build");
const outFileName = "backend.js";
const output = {
path: outPath,
filename: outFileName,
};
const rules = [
{
test: /\.[tj]s$/,
use: {
loader: "ts-loader",
options: {
allowTsInNodeModules: true,
transpileOnly: true,
configFile: path.resolve("tsconfig.json"),
},
},
},
];
const resolve = {
extensions: [".ts", ".js", ".json"],
fallback: {
path: false,
os: false,
},
};
const plugins = [new GasPlugin()];
module.exports = [
{
mode: "development",
devtool,
entry,
output,
module: { rules },
resolve,
plugins,
},
];