From b28dc1b156400802acfe6ef534d81ff835c94a5d Mon Sep 17 00:00:00 2001 From: Cody Olsen Date: Fri, 7 Aug 2020 10:21:20 +0200 Subject: [PATCH 1/2] chore: prepare initial test --- README.md | 283 +--------------------------------------------- package-lock.json | 13 ++- package.json | 7 +- src/index.js | 2 + 4 files changed, 20 insertions(+), 285 deletions(-) diff --git a/README.md b/README.md index 402dd5a7..0fbdd4aa 100644 --- a/README.md +++ b/README.md @@ -1,280 +1,5 @@ -

- microbundle -

-

- Microbundle - npm travis -

-

The zero-configuration bundler for tiny modules, powered by Rollup.

+# TODO ---- - -

- Guide → - Setup ✯ - Formats ✯ - Modern Mode ✯ - Usage & Configuration ✯ - All Options -

- ---- - -## ✨ Features - -- **One dependency** to bundle your library using only a `package.json` -- Support for ESnext & async/await _(via [Babel] & [async-to-promises])_ -- Produces tiny, optimized code for all inputs -- Supports multiple entry modules _(`cli.js` + `index.js`, etc)_ -- Creates multiple output formats for each entry _(CJS, UMD & ESM)_ -- 0 configuration TypeScript support -- Built-in Terser compression & gzipped bundle size tracking - -## 🔧 Installation & Setup - -1️⃣ **Install** by running: `npm i -D microbundle` - -2️⃣ **Set up** your `package.json`: - -```js -{ - "name": "foo", // your package name - "source": "src/foo.js", // your source code - "main": "dist/foo.js", // where to generate the CommonJS/Node bundle - "module": "dist/foo.module.js", // where to generate the ESM bundle - "unpkg": "dist/foo.umd.js", // where to generate the UMD bundle (also aliased as "umd:main") - "scripts": { - "build": "microbundle", // compiles "source" to "main"/"module"/"unpkg" - "dev": "microbundle watch" // re-build when source files change - } -} -``` - -3️⃣ **Try it out** by running `npm run build`. - -## 💽 Output Formats - -Microbundle produces esm, cjs, umd bundles with your code compiled to syntax that works pretty much everywhere. While it's possible to customize the browser or Node versions you wish to support using a [browserslist configuration](https://github.com/browserslist/browserslist#browserslist-), the default setting is optimal and strongly recommended. - -## 🤖 Modern Mode - -In addition to the above formats, Microbundle also outputs a `modern` bundle specially designed to work in _all modern browsers_. This bundle preserves most modern JS features when compiling your code, but ensures the result runs in 90% of web browsers without needing to be transpiled. Specifically, it uses [preset-modules](https://github.com/babel/preset-modules) to target the set of browsers that support `