v2.0.0-beta.4
Pre-releaseWhat's New π
This is an exicting release! Few amazing features and improvements are here for you to checkout π
BREAKING Change
rename --target to --runtime #107
If you were using --target option, now you need to migrate to --runtime, values are same.
New Features π
Support different ECMAScript versions #108
Check Now with --target now you can speicify your compilation target with any ES version that swc supports, like es2016, es2020 or leave it as es5 by default.
Top-level files as entry #103
We once introduced bunchee config in previous alpha versions but it's not removed. We introduced a new convention that you can let bunchee to build your package with multiple exports. An exmaple is given below:
You may have a file structure like this
- my-package
|- lite.ts
|- index.ts
|- src/
|- package.json
With this content in package.json
{
"scripts": {
"build": "bunchee"
},
"exports": {
"./lite": "./dist/lite.js"
".": {
"import": "./dist/index.mjs",
"require": "./dist/index.cjs"
}
}
}In that case bunchee will match your top-level files lite.ts with "./lite" exports and index.ts with "." exports as entry source files, and use the "exports" info as output paths. Then you only need to run bunchee and it will take care of everything for you.
Bug Fixes π¨
- Ensure sourcemap is generated by SWC minify by @tundera in #97
- Fix: align default output format by @huozhi in #101
Improvements β¨
- enhance: ignore this undefined and circular dep warnings by @huozhi in #98
- Improve error logging by @huozhi in #106
Misc
- Format code and bump ts by @huozhi in #99
- Update snapshot files by @huozhi in #100
- Upgrade dependencies by @huozhi in #102