-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwatch.js
49 lines (46 loc) · 1.07 KB
/
watch.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
47
48
49
const path = require('path')
const esbuild = require("esbuild")
const context = {
logLevel: "info",
entryPoints: [path.resolve(__dirname, "stories/index.ts")],
bundle: true,
platform: "browser",
target: ["esnext"],
minify: true,
pure: ["React.createElement"],
jsx: 'transform',
loader: { '.js': 'jsx' },
outdir: path.resolve(__dirname, "dist"),
sourcemap: true,
external: [
"react",
"react-dom",
"@floating-ui/react",
"@headlessui/react",
"@headlessui/tailwindcss",
"@heroicons/react",
"@tabler/icons",
"@tabler/icons-react",
"classnames",
"react-icons",
"@storybook/react",
"@storybook/addon-designs",
"@storybook/addon-essentials",
"@storybook/addon-interactions",
"@storybook/addon-links",
"@storybook/blocks",
"@storybook/manager-api",
"@storybook/nextjs",
"@storybook/react",
"@storybook/testing-library",
"@storybook/theming",
"storybook"
],
format: "esm"
}
async function watch() {
const ctx = await esbuild.context(context)
ctx.watch()
console.log(`Watching....`)
}
watch()