File tree Expand file tree Collapse file tree 1 file changed +46
-0
lines changed Expand file tree Collapse file tree 1 file changed +46
-0
lines changed Original file line number Diff line number Diff line change 1+ import { defineBuildConfig } from 'unbuild' ;
2+ import { name , version } from './package.json' ;
3+
4+ // https://github.com/unjs/unbuild
5+ export default defineBuildConfig ( {
6+ declaration : true ,
7+ failOnWarn : false ,
8+ rollup : {
9+ esbuild : {
10+ minify : false ,
11+ } ,
12+ } ,
13+ entries : [
14+ // mkdist builder transpiles file-to-file keeping original sources structure
15+ {
16+ builder : 'mkdist' ,
17+ input : './src/' ,
18+ outDir : './dist' ,
19+ format : 'esm' ,
20+ pattern : [ '**' , '!**/*.test.ts' ] ,
21+ esbuild : {
22+ define : {
23+ PACKAGE_VERSION : `"${ version } "` ,
24+ PACKAGE_NAME : `"${ name } "` ,
25+ } ,
26+ } ,
27+ } ,
28+ {
29+ builder : 'mkdist' ,
30+ input : './src/' ,
31+ outDir : './dist' ,
32+ format : 'cjs' ,
33+ ext : 'cjs' ,
34+ // https://github.com/sindresorhus/globby
35+ pattern : [ '**' , '!**/*.test.ts' ] ,
36+ // Declarations already created for esm build
37+ declaration : false ,
38+ esbuild : {
39+ define : {
40+ PACKAGE_VERSION : `"${ version } "` ,
41+ PACKAGE_NAME : `"${ name } "` ,
42+ } ,
43+ } ,
44+ } ,
45+ ] ,
46+ } ) ;
You can’t perform that action at this time.
0 commit comments