Skip to content

v2.0.0-beta.4

Pre-release
Pre-release

Choose a tag to compare

@huozhi huozhi released this 28 Aug 23:43
· 663 commits to main since this release

What'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


New Contributors