forked from vitejs/vite
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.config.ts
More file actions
33 lines (31 loc) · 776 Bytes
/
Copy pathbuild.config.ts
File metadata and controls
33 lines (31 loc) · 776 Bytes
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
import path from 'node:path'
import url from 'node:url'
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) {
options.plugins = [
options.plugins,
licensePlugin(
path.resolve(__dirname, './LICENSE'),
'create-vite license',
'create-vite',
),
]
},
},
})