forked from wanderwallet/Wander
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathesbuild.js
41 lines (40 loc) · 1.03 KB
/
esbuild.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
const esbuild = require("esbuild"),
autoprefixer = require("autoprefixer"),
postCssPlugin = require("esbuild-plugin-postcss2"),
{
NodeModulesPolyfillPlugin
} = require("@esbuild-plugins/node-modules-polyfill");
esbuild
.build({
entryPoints: [
"./src/scripts/background.ts",
"./src/scripts/content.ts",
"./src/scripts/injected.ts",
"./src/views/popup.tsx",
"./src/views/auth.tsx",
"./src/views/welcome.tsx",
"./src/views/archive.tsx"
],
format: "iife",
bundle: true,
minify: true,
sourcemap: process.env.NODE_ENV !== "production",
watch: process.env.NODE_ENV !== "production",
inject: ["./src/utils/polyfill.js"],
target: ["chrome58", "firefox57"],
outdir: "./public/build",
define: {
global: "window"
},
loader: {
".png": "dataurl",
".svg": "dataurl"
},
plugins: [
NodeModulesPolyfillPlugin(),
postCssPlugin.default({
plugins: [autoprefixer]
})
]
})
.catch(() => process.exit(1));