-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
/
build.config.ts
37 lines (35 loc) · 926 Bytes
/
build.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
import path from 'node:path'
import url from 'node:url'
// eslint-disable-next-line node/no-extraneous-import
import type { Plugin } from 'rollup'
import { defineBuildConfig } from 'unbuild'
import licensePlugin from '../vite/rollupLicensePlugin'
const __dirname = path.dirname(url.fileURLToPath(import.meta.url))
export default defineBuildConfig({
entries: ['src/index'],
clean: true,
rollup: {
inlineDependencies: true,
esbuild: {
minify: true,
},
},
alias: {
// we can always use non-transpiled code since we support 14.18.0+
prompts: 'prompts/lib/index.js',
},
hooks: {
'rollup:options'(ctx, options) {
if (!options.plugins) {
options.plugins = []
}
;(options.plugins as Plugin[]).push(
licensePlugin(
path.resolve(__dirname, './LICENSE'),
'create-vite license',
'create-vite',
),
)
},
},
})