From a6eb6e75b0bea09ddcb127689cde77b4e75f86f2 Mon Sep 17 00:00:00 2001 From: Cam Sloan Date: Mon, 9 Nov 2020 09:10:42 -0500 Subject: [PATCH 1/4] Update examples to reference preact/compat instead of preact (#750) aliasing react=preact doesn't work because the main preact package actually doesn't contain any default exports. So the more likely example would be to reference preact/compat. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7b8161c2..03cdeb5c 100644 --- a/README.md +++ b/README.md @@ -248,7 +248,7 @@ Options Examples $ microbundle build --globals react=React,jquery=$ $ microbundle build --define API_KEY=1234 - $ microbundle build --alias react=preact + $ microbundle build --alias react=preact/compat $ microbundle watch --no-sourcemap # don't generate sourcemaps $ microbundle build --tsconfig tsconfig.build.json ``` From 360511bcfdd7fa70e275e14c1e20861336748d06 Mon Sep 17 00:00:00 2001 From: Jason Miller Date: Thu, 17 Dec 2020 10:20:29 -0500 Subject: [PATCH 2/4] Update the readme to recommend package exports (#749) * Update the readme to recommend package exports * Update README.md * Update README.md * Update README.md --- README.md | 66 +++++++++++++++++++++++++++++++++---------------------- 1 file changed, 40 insertions(+), 26 deletions(-) diff --git a/README.md b/README.md index 03cdeb5c..d1bc5855 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,7 @@ "name": "foo", // your package name "source": "src/foo.js", // your source code "main": "dist/foo.js", // where to generate the CommonJS/Node bundle + "exports": "dist/foo.modern.js", // path to the modern output (see below) "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": { @@ -58,14 +59,14 @@ Microbundle produces esm -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 `