-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
63 lines (60 loc) · 1.44 KB
/
webpack.config.js
File metadata and controls
63 lines (60 loc) · 1.44 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
51
52
53
54
55
56
57
58
59
60
61
62
63
/* eslint-env node */
const path = require("path");
const CopyWebpackPlugin = require("copy-webpack-plugin");
module.exports = (env, { mode }) => {
const isDev = mode === "development";
return {
target: "node",
mode: mode || "none",
entry: {
extension: "./src/extension.ts",
},
output: {
path: path.resolve(__dirname, "dist"),
filename: "[name].js",
chunkFormat: "commonjs",
libraryTarget: "commonjs",
devtoolModuleFilenameTemplate: "[resource-path]",
},
externalsType: "node-commonjs",
externals: {
vs: "vs",
vscode: "commonjs vscode",
bufferutil: "bufferutil",
"utf-8-validate": "utf-8-validate",
},
resolve: {
roots: [__dirname],
extensions: [".js", ".ts"],
},
optimization: {
minimize: !isDev,
},
module: {
rules: [
{
test: /\.(ts?)?$/iu,
use: {
loader: "swc-loader",
},
exclude: /node_modules/u,
},
],
},
plugins: [
new CopyWebpackPlugin({
patterns: [
{ from: "static", to: "static" },
{
from: "package.json",
to: "package.json",
},
].filter(Boolean),
}),
].filter(Boolean),
devtool: isDev ? "inline-cheap-module-source-map" : false,
infrastructureLogging: {
level: "log", // enables logging required for problem matchers
},
};
};