-
Notifications
You must be signed in to change notification settings - Fork 34
Expand file tree
/
Copy pathwebpack.kernel.config.js
More file actions
53 lines (52 loc) · 1.42 KB
/
webpack.kernel.config.js
File metadata and controls
53 lines (52 loc) · 1.42 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
const path = require("path");
const {EsbuildPlugin} = require("esbuild-loader");
module.exports = (env, argv) => {
const production = argv.mode === "production";
return {
mode: argv.mode || "development",
watch: !production,
devtool: production ? false : "inline-source-map",
entry: {
[production ? "dist/kernel" : "kernel"]: "./src/kernel.ts",
},
experiments: {
outputModule: true,
},
output: {
filename: "[name].js",
path: path.resolve(__dirname),
library: {
type: "module",
},
},
externals: {
siyuan: "siyuan",
},
optimization: {
minimize: production,
minimizer: [
new EsbuildPlugin(),
],
},
resolve: {
extensions: [".ts", ".js", ".json"],
},
module: {
rules: [
{
test: /\.ts(x?)$/,
include: [path.resolve(__dirname, "src")],
use: [
{
loader: "esbuild-loader",
options: {
target: "esnext",
},
},
],
},
],
},
plugins: [],
};
};