File tree Expand file tree Collapse file tree 7 files changed +24
-18
lines changed
Expand file tree Collapse file tree 7 files changed +24
-18
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " @icebreakers/monorepo " : patch
3+ ---
4+
5+ feat: 默认 new 模板更改 unbuild,同时使用 stub 进行多个项目进行链接
Original file line number Diff line number Diff line change 11import { bar } from '@icebreakers/bar'
2- import { foo } from '@icebreakers/foo'
2+ import { foo , format } from '@icebreakers/foo'
33
44console . log ( 'Website Bootstrap!' )
5- console . log ( foo ( ) + bar ( ) )
5+ console . log ( foo ( ) + bar ( ) , format ( 'hello world!' ) )
Original file line number Diff line number Diff line change @@ -3,7 +3,6 @@ import { defineBuildConfig } from 'unbuild'
33
44export default defineBuildConfig ( {
55 // entries: ['./src/index', './src/cli'],
6- entries : [ './src/index' ] ,
76 rollup : {
87 // 内联,相当于 nodeResolve
98 inlineDependencies : true ,
Original file line number Diff line number Diff line change 1616 "keywords" : [],
1717 "sideEffects" : false ,
1818 "exports" : {
19- "." : " ./src/index.ts"
19+ "." : {
20+ "types" : " ./dist/index.d.ts" ,
21+ "import" : " ./dist/index.mjs" ,
22+ "require" : " ./dist/index.cjs"
23+ }
2024 },
25+ "main" : " ./dist/index.cjs" ,
26+ "module" : " ./dist/index.mjs" ,
27+ "types" : " ./dist/index.d.ts" ,
2128 "files" : [
2229 " dist"
2330 ],
2431 "scripts" : {
25- "dev" : " unbuild --watch --sourcemap" ,
32+ "dev" : " unbuild --stub" ,
33+ "build:watch" : " unbuild --watch --sourcemap" ,
2634 "build" : " unbuild" ,
2735 "test" : " vitest run" ,
2836 "test:dev" : " vitest" ,
2937 "release" : " pnpm publish" ,
3038 "lint" : " eslint ." ,
3139 "lint:fix" : " eslint . --fix"
3240 },
33- "publishConfig" : {
34- "exports" : {
35- "." : {
36- "types" : " ./dist/index.d.ts" ,
37- "import" : " ./dist/index.mjs" ,
38- "require" : " ./dist/index.cjs"
39- }
40- },
41- "main" : " ./dist/index.cjs" ,
42- "module" : " ./dist/index.mjs" ,
43- "types" : " ./dist/index.d.ts"
44- }
41+ "publishConfig" : {}
4542}
Original file line number Diff line number Diff line change @@ -5,3 +5,5 @@ export function foo() {
55export function getDirname ( ) {
66 return __dirname
77}
8+
9+ export { format } from '@/utils'
Original file line number Diff line number Diff line change 1+ export function format ( str : string ) {
2+ return str . replaceAll ( / [ a - z ] / g, s => s . toUpperCase ( ) )
3+ }
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ export interface CreateNewProjectOptions {
2121 type ?: 'tsup' | 'unbuild'
2222}
2323
24- const defaultTemplate = 'tsup '
24+ const defaultTemplate = 'unbuild '
2525
2626const fromMap = {
2727 tsup : 'bar' ,
You can’t perform that action at this time.
0 commit comments