generated from sonofmagic/monorepo-template
-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.config.ts
51 lines (49 loc) · 1.13 KB
/
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import path from 'node:path'
import { defineBuildConfig } from 'unbuild'
export default defineBuildConfig([
{
entries: ['./src/index', './src/cli', './src/tailwindcss.ts'],
rollup: {
// 内联,相当于 nodeResolve
inlineDependencies: true,
// cjs
emitCJS: true,
// 添加 cjs 注入
cjsBridge: true,
dts: {
// https://github.com/unjs/unbuild/issues/135
respectExternal: false,
},
},
alias: {
// 别名
'@': path.resolve(__dirname, './src'),
},
// dts
declaration: true,
externals: [/^tailwindcss/, 'sass'],
failOnWarn: false,
},
{
entries: ['./src/browser.ts'],
rollup: {
// 内联,相当于 nodeResolve
inlineDependencies: true,
// cjs
emitCJS: true,
// 添加 cjs 注入
// cjsBridge: true,
dts: {
// https://github.com/unjs/unbuild/issues/135
respectExternal: false,
},
},
alias: {
// 别名
'@': path.resolve(__dirname, './src'),
},
// dts
declaration: true,
externals: [/^tailwindcss/, 'sass', '@babel/standalone'],
},
])