-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtsup.config.ts
37 lines (36 loc) · 978 Bytes
/
tsup.config.ts
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
// @ts-expect-error
import { copy } from 'cpx2'
import { resolve } from 'pathe'
import { defineConfig } from 'tsup'
export default defineConfig(
[
{
entry: [
'./src/cli.ts',
'./src/vue.ts',
'./src/astro.ts',
'./src/index.ts',
],
format: 'esm',
outDir: './dist',
dts: true,
clean: true,
external: [
'vue',
'vite',
'astro',
'@astrojs/compiler',
'@vue/compiler-sfc',
],
outExtension: ({ format }) =>
({ js: format === 'esm' ? '.mjs' : '.cjs' }),
onSuccess: async () => {
copy(
resolve(__dirname, 'src/yoga.wasm'),
resolve(__dirname, 'dist'),
{ force: true },
)
},
},
],
)