-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathbuild.js
43 lines (41 loc) · 821 Bytes
/
build.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
import * as esbuild from 'esbuild'
import { tailwindPlugin } from 'esbuild-plugin-tailwindcss';
async function build(args) {
await esbuild.build({
entryPoints: [ 'client.ts' ],
bundle: true,
outdir: 'build',
platform: 'browser',
format: 'esm',
splitting: true,
target: 'esnext',
external: [
'@payloadcms/*',
'@payloadcms/ui',
'@payloadcms/ui/*',
'@lexical/*',
'payload',
'payload/*',
'react',
],
packages: 'external',
minify: true,
metafile: true,
treeShaking: true,
tsconfig: './tsconfig.json',
plugins: [
tailwindPlugin({
config: './tailwind.config.js'
}),
// removeCSSImports,
/*commonjs({
ignore: ['date-fns', '@floating-ui/react'],
}),*/
],
sourcemap: true,
})
.catch((e) => {
console.error(e)
})
}
build(process.argv.slice(2))