From 1b6102966440bd7000e0e457f8c0b7eeb7e05593 Mon Sep 17 00:00:00 2001
From: Marc Bouchenoire
Date: Wed, 6 Oct 2021 15:09:49 +0200
Subject: [PATCH 01/50] Rebase: Add worker-loader (#867)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* Add worker-loader
Targets enhancement: https://github.com/developit/microbundle/issues/170
Enable usage of `microbundle --worker-loader` to apply rollup-plugin-web-worker-loader.
Allow bundling web workers automatically
- Add flag `--worker-loader`
- For format `es` and `modern`, a Worker `type: module` is automatically
bundled
* Update README.md
Co-authored-by: Jason Miller
* Update src/index.js
Co-authored-by: Jason Miller
* Update src/prog.js
Co-authored-by: Jason Miller
* Update test/__snapshots__/index.test.js.snap
Co-authored-by: Jason Miller
* Update test/fixtures/worker-loader/package.json
Co-authored-by: Jason Miller
* Update README.md
Co-authored-by: Jason Miller
* Remove node_modules from snapshot
* Upgrade rollup-plugin-off-main-thread
* Add changeset
Co-authored-by: Tim Daubenschütz
Co-authored-by: Jason Miller
---
.changeset/curly-eels-watch.md | 5 +
README.md | 21 ++++
package-lock.json | 113 +++++++++++++++--
package.json | 1 +
src/index.js | 8 +-
src/prog.js | 5 +
test/__snapshots__/index.test.js.snap | 60 +++++++++
test/fixtures/worker-loader/package-lock.json | 118 ++++++++++++++++++
test/fixtures/worker-loader/package.json | 6 +
test/fixtures/worker-loader/src/bar.js | 3 +
test/fixtures/worker-loader/src/index.js | 4 +
test/fixtures/worker-loader/src/worker.js | 3 +
12 files changed, 338 insertions(+), 9 deletions(-)
create mode 100644 .changeset/curly-eels-watch.md
create mode 100644 test/fixtures/worker-loader/package-lock.json
create mode 100644 test/fixtures/worker-loader/package.json
create mode 100644 test/fixtures/worker-loader/src/bar.js
create mode 100644 test/fixtures/worker-loader/src/index.js
create mode 100644 test/fixtures/worker-loader/src/worker.js
diff --git a/.changeset/curly-eels-watch.md b/.changeset/curly-eels-watch.md
new file mode 100644
index 00000000..1ae292be
--- /dev/null
+++ b/.changeset/curly-eels-watch.md
@@ -0,0 +1,5 @@
+---
+'microbundle': minor
+---
+
+- Add support for Module Workers with a new `--workers` flag
diff --git a/README.md b/README.md
index 42d786cc..b1712fa2 100644
--- a/README.md
+++ b/README.md
@@ -253,6 +253,26 @@ This can be customized by passing the command line argument `--css-modules "[nam
| true | import './my-file.css'; | :white_check_mark: |
| true | import './my-file.module.css'; | :white_check_mark: |
+### Building Module Workers
+
+Microbundle is able to detect and bundle Module Workers when generating bundles in the
+`es`, `umd` and `modern` formats. To use this feature, instantiate your Web Worker as follows:
+
+```js
+worker = new Worker(new URL('./worker.js', import.meta.url), { type: 'module' });
+// or simply:
+worker = new Worker('./worker.js', { type: 'module' });
+```
+
+... then add the `--workers` flag to your build command:
+
+```bash
+microbundle --workers
+```
+
+For more information see
+[@surma/rollup-plugin-off-main-thread](https://github.com/surma/rollup-plugin-off-main-thread#config).
+
### Mangling Properties
To achieve the smallest possible bundle size, libraries often wish to rename internal object properties or class members to smaller names - transforming `this._internalIdValue` to `this._i`. Microbundle doesn't do this by default, however it can be enabled by creating a `mangle.json` file (or a `"mangle"` property in your package.json). Within that file, you can specify a regular expression pattern to control which properties should be mangled. For example: to mangle all property names beginning an underscore:
@@ -316,6 +336,7 @@ Options
--generateTypes Whether or not to generate types, if `types` or `typings` is set in `package.json` then it will default to be `true`
--css Where to output CSS: "inline" or "external" (default: "external")
--css-modules Configures .css to be treated as modules (default: null)
+ --workers Bundle module workers - see https://git.io/J3oSF (default false)
-h, --help Displays this message
Examples
diff --git a/package-lock.json b/package-lock.json
index b554eb0e..b9ec265b 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,11 +1,11 @@
{
"name": "microbundle",
- "version": "0.13.1",
+ "version": "0.13.3",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
- "version": "0.13.1",
+ "version": "0.13.3",
"license": "MIT",
"dependencies": {
"@babel/core": "^7.12.10",
@@ -23,6 +23,7 @@
"@rollup/plugin-commonjs": "^17.0.0",
"@rollup/plugin-json": "^4.1.0",
"@rollup/plugin-node-resolve": "^11.0.1",
+ "@surma/rollup-plugin-off-main-thread": "^2.2.2",
"asyncro": "^3.0.0",
"autoprefixer": "^10.1.0",
"babel-plugin-macros": "^3.0.1",
@@ -3265,6 +3266,16 @@
"@sinonjs/commons": "^1.7.0"
}
},
+ "node_modules/@surma/rollup-plugin-off-main-thread": {
+ "version": "2.2.2",
+ "resolved": "https://registry.npmjs.org/@surma/rollup-plugin-off-main-thread/-/rollup-plugin-off-main-thread-2.2.2.tgz",
+ "integrity": "sha512-dOD6nGZ79RmWKDRQuC7SOGXMvDkkLwBogu+epfVFMKiy2kOUtLZkb8wV/ettuMt37YJAJKYCKUmxSbZL2LkUQg==",
+ "dependencies": {
+ "ejs": "^3.1.6",
+ "json5": "^2.2.0",
+ "magic-string": "^0.25.0"
+ }
+ },
"node_modules/@types/babel__core": {
"version": "7.1.12",
"resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.1.12.tgz",
@@ -3748,6 +3759,11 @@
"node": ">=4"
}
},
+ "node_modules/async": {
+ "version": "0.9.2",
+ "resolved": "https://registry.npmjs.org/async/-/async-0.9.2.tgz",
+ "integrity": "sha1-rqdNXmHB+JlhO/ZL2mbUx48v0X0="
+ },
"node_modules/async-each": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.3.tgz",
@@ -5924,6 +5940,20 @@
"safer-buffer": "^2.1.0"
}
},
+ "node_modules/ejs": {
+ "version": "3.1.6",
+ "resolved": "https://registry.npmjs.org/ejs/-/ejs-3.1.6.tgz",
+ "integrity": "sha512-9lt9Zse4hPucPkoP7FHDF0LQAlGyF9JVpnClFLFH3aSSbxmyoqINRpp/9wePWJTUl4KOQwRL72Iw3InHPDkoGw==",
+ "dependencies": {
+ "jake": "^10.6.1"
+ },
+ "bin": {
+ "ejs": "bin/cli.js"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
"node_modules/electron-to-chromium": {
"version": "1.3.496",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.496.tgz",
@@ -7103,6 +7133,14 @@
"node": "^10.12.0 || >=12.0.0"
}
},
+ "node_modules/filelist": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/filelist/-/filelist-1.0.2.tgz",
+ "integrity": "sha512-z7O0IS8Plc39rTCq6i6iHxk43duYOn8uFJiWSewIq0Bww1RNybVHSCjahmcC87ZqAm4OTvFzlzeGu3XAzG1ctQ==",
+ "dependencies": {
+ "minimatch": "^3.0.4"
+ }
+ },
"node_modules/filesize": {
"version": "6.1.0",
"resolved": "https://registry.npmjs.org/filesize/-/filesize-6.1.0.tgz",
@@ -8547,6 +8585,23 @@
"node": ">=8"
}
},
+ "node_modules/jake": {
+ "version": "10.8.2",
+ "resolved": "https://registry.npmjs.org/jake/-/jake-10.8.2.tgz",
+ "integrity": "sha512-eLpKyrfG3mzvGE2Du8VoPbeSkRry093+tyNjdYaBbJS9v17knImYGNXQCUV0gLxQtF82m3E8iRb/wdSQZLoq7A==",
+ "dependencies": {
+ "async": "0.9.x",
+ "chalk": "^2.4.2",
+ "filelist": "^1.0.1",
+ "minimatch": "^3.0.4"
+ },
+ "bin": {
+ "jake": "bin/cli.js"
+ },
+ "engines": {
+ "node": "*"
+ }
+ },
"node_modules/jest": {
"version": "26.6.3",
"resolved": "https://registry.npmjs.org/jest/-/jest-26.6.3.tgz",
@@ -10545,9 +10600,9 @@
"dev": true
},
"node_modules/json5": {
- "version": "2.1.3",
- "resolved": "https://registry.npmjs.org/json5/-/json5-2.1.3.tgz",
- "integrity": "sha512-KXPvOm8K9IJKFM0bmdn8QXh7udDh1g/giieX0NLCaMnb4hEiVFqnop2ImTXCc5e0/oHz3LTqmHGtExn5hfMkOA==",
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.0.tgz",
+ "integrity": "sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA==",
"dependencies": {
"minimist": "^1.2.5"
},
@@ -20331,6 +20386,16 @@
"@sinonjs/commons": "^1.7.0"
}
},
+ "@surma/rollup-plugin-off-main-thread": {
+ "version": "2.2.2",
+ "resolved": "https://registry.npmjs.org/@surma/rollup-plugin-off-main-thread/-/rollup-plugin-off-main-thread-2.2.2.tgz",
+ "integrity": "sha512-dOD6nGZ79RmWKDRQuC7SOGXMvDkkLwBogu+epfVFMKiy2kOUtLZkb8wV/ettuMt37YJAJKYCKUmxSbZL2LkUQg==",
+ "requires": {
+ "ejs": "^3.1.6",
+ "json5": "^2.2.0",
+ "magic-string": "^0.25.0"
+ }
+ },
"@types/babel__core": {
"version": "7.1.12",
"resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.1.12.tgz",
@@ -20745,6 +20810,11 @@
"integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==",
"dev": true
},
+ "async": {
+ "version": "0.9.2",
+ "resolved": "https://registry.npmjs.org/async/-/async-0.9.2.tgz",
+ "integrity": "sha1-rqdNXmHB+JlhO/ZL2mbUx48v0X0="
+ },
"async-each": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.3.tgz",
@@ -22520,6 +22590,14 @@
"safer-buffer": "^2.1.0"
}
},
+ "ejs": {
+ "version": "3.1.6",
+ "resolved": "https://registry.npmjs.org/ejs/-/ejs-3.1.6.tgz",
+ "integrity": "sha512-9lt9Zse4hPucPkoP7FHDF0LQAlGyF9JVpnClFLFH3aSSbxmyoqINRpp/9wePWJTUl4KOQwRL72Iw3InHPDkoGw==",
+ "requires": {
+ "jake": "^10.6.1"
+ }
+ },
"electron-to-chromium": {
"version": "1.3.496",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.496.tgz",
@@ -23458,6 +23536,14 @@
"flat-cache": "^3.0.4"
}
},
+ "filelist": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/filelist/-/filelist-1.0.2.tgz",
+ "integrity": "sha512-z7O0IS8Plc39rTCq6i6iHxk43duYOn8uFJiWSewIq0Bww1RNybVHSCjahmcC87ZqAm4OTvFzlzeGu3XAzG1ctQ==",
+ "requires": {
+ "minimatch": "^3.0.4"
+ }
+ },
"filesize": {
"version": "6.1.0",
"resolved": "https://registry.npmjs.org/filesize/-/filesize-6.1.0.tgz",
@@ -24603,6 +24689,17 @@
"istanbul-lib-report": "^3.0.0"
}
},
+ "jake": {
+ "version": "10.8.2",
+ "resolved": "https://registry.npmjs.org/jake/-/jake-10.8.2.tgz",
+ "integrity": "sha512-eLpKyrfG3mzvGE2Du8VoPbeSkRry093+tyNjdYaBbJS9v17knImYGNXQCUV0gLxQtF82m3E8iRb/wdSQZLoq7A==",
+ "requires": {
+ "async": "0.9.x",
+ "chalk": "^2.4.2",
+ "filelist": "^1.0.1",
+ "minimatch": "^3.0.4"
+ }
+ },
"jest": {
"version": "26.6.3",
"resolved": "https://registry.npmjs.org/jest/-/jest-26.6.3.tgz",
@@ -26195,9 +26292,9 @@
"dev": true
},
"json5": {
- "version": "2.1.3",
- "resolved": "https://registry.npmjs.org/json5/-/json5-2.1.3.tgz",
- "integrity": "sha512-KXPvOm8K9IJKFM0bmdn8QXh7udDh1g/giieX0NLCaMnb4hEiVFqnop2ImTXCc5e0/oHz3LTqmHGtExn5hfMkOA==",
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.0.tgz",
+ "integrity": "sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA==",
"requires": {
"minimist": "^1.2.5"
}
diff --git a/package.json b/package.json
index 95a55247..a335cd82 100644
--- a/package.json
+++ b/package.json
@@ -88,6 +88,7 @@
"@rollup/plugin-commonjs": "^17.0.0",
"@rollup/plugin-json": "^4.1.0",
"@rollup/plugin-node-resolve": "^11.0.1",
+ "@surma/rollup-plugin-off-main-thread": "^2.2.2",
"asyncro": "^3.0.0",
"autoprefixer": "^10.1.0",
"babel-plugin-macros": "^3.0.1",
diff --git a/src/index.js b/src/index.js
index 47448a08..c46b83a0 100644
--- a/src/index.js
+++ b/src/index.js
@@ -18,6 +18,7 @@ import alias from '@rollup/plugin-alias';
import postcss from 'rollup-plugin-postcss';
import typescript from 'rollup-plugin-typescript2';
import json from '@rollup/plugin-json';
+import OMT from '@surma/rollup-plugin-off-main-thread';
import logError from './log-error';
import { isDir, isFile, stdout, isTruthy, removeScope } from './utils';
import { getSizeInfo } from './lib/compressed-size';
@@ -389,6 +390,8 @@ function createConfig(options, entry, format, writeMeta) {
options.generateTypes == null
? !!(pkg.types || pkg.typings)
: options.generateTypes;
+ const useWorkerLoader = options.workers !== false;
+
const escapeStringExternals = ext =>
ext instanceof RegExp ? ext.source : escapeStringRegexp(ext);
const externalPredicate = new RegExp(
@@ -427,7 +430,7 @@ function createConfig(options, entry, format, writeMeta) {
let config = {
/** @type {import('rollup').InputOptions} */
inputOptions: {
- // disable Rollup's cache for the modern build to prevent re-use of legacy transpiled modules:
+ // disable Rollup's cache for modern builds to prevent re-use of legacy transpiled modules:
cache,
input: entry,
external: id => {
@@ -616,6 +619,9 @@ function createConfig(options, entry, format, writeMeta) {
},
},
],
+ // NOTE: OMT only works with amd and esm
+ // Source: https://github.com/surma/rollup-plugin-off-main-thread#config
+ useWorkerLoader && (format === 'es' || modern) && OMT(),
/** @type {import('rollup').Plugin} */
({
name: 'postprocessing',
diff --git a/src/prog.js b/src/prog.js
index 10fd9b8d..e07a7d66 100644
--- a/src/prog.js
+++ b/src/prog.js
@@ -57,6 +57,11 @@ export default handler => {
.option('--cwd', 'Use an alternative working directory', '.')
.option('--sourcemap', 'Generate source map')
.option('--css', 'Where to output CSS: "inline" or "external"', 'external')
+ .option(
+ '--workers',
+ 'Bundle module workers - see https://git.io/J3oSF',
+ false,
+ )
.option(
'--css-modules',
'Turns on css-modules for all .css imports. Passing a string will override the scopeName. eg --css-modules="_[hash]"',
diff --git a/test/__snapshots__/index.test.js.snap b/test/__snapshots__/index.test.js.snap
index e70c9176..36a89342 100644
--- a/test/__snapshots__/index.test.js.snap
+++ b/test/__snapshots__/index.test.js.snap
@@ -3016,3 +3016,63 @@ exports[`fixtures build ts-module with microbundle 7`] = `
//# sourceMappingURL=ts-module.umd.js.map
"
`;
+
+exports[`fixtures build worker-loader with microbundle 1`] = `
+"Used script: microbundle -f modern,es --workers
+
+Directory tree:
+
+worker-loader
+ dist
+ worker-35b22e56.js
+ worker-35b22e56.js.map
+ worker-7e1b9921.js
+ worker-7e1b9921.js.map
+ worker-loader.esm.js
+ worker-loader.esm.js.map
+ worker-loader.modern.js
+ worker-loader.modern.js.map
+ package-lock.json
+ package.json
+ src
+ bar.js
+ index.js
+ worker.js
+
+
+Build \\"workerLoader\\" to dist:
+140 B: worker-loader.modern.js.gz
+112 B: worker-loader.modern.js.br
+63 B: worker-7e1b9921.js.gz
+54 B: worker-7e1b9921.js.br
+150 B: worker-loader.esm.js.gz
+123 B: worker-loader.esm.js.br
+81 B: worker-35b22e56.js.gz
+66 B: worker-35b22e56.js.br"
+`;
+
+exports[`fixtures build worker-loader with microbundle 2`] = `8`;
+
+exports[`fixtures build worker-loader with microbundle 3`] = `
+"self.onmessage=function(e){return self.postMessage(e.data+\\"bar\\")};
+//# sourceMappingURL=worker-35b22e56.js.map
+"
+`;
+
+exports[`fixtures build worker-loader with microbundle 4`] = `
+"self.onmessage=s=>self.postMessage(s.data+\\"bar\\");
+//# sourceMappingURL=worker-7e1b9921.js.map
+"
+`;
+
+exports[`fixtures build worker-loader with microbundle 5`] = `
+"var e=new Worker(new URL(\\"worker-35b22e56.js\\",import.meta.url),{type:\\"module\\"});e.onmessage=function(e){return\\"foobar\\"===e.data},e.postMessage(\\"foo\\");
+//# sourceMappingURL=worker-loader.esm.js.map
+"
+`;
+
+exports[`fixtures build worker-loader with microbundle 6`] = `
+"const e=new Worker(new URL(\\"worker-7e1b9921.js\\",import.meta.url),{type:\\"module\\"});e.onmessage=e=>\\"foobar\\"===e.data,e.postMessage(\\"foo\\");
+//# sourceMappingURL=worker-loader.modern.js.map
+"
+`;
diff --git a/test/fixtures/worker-loader/package-lock.json b/test/fixtures/worker-loader/package-lock.json
new file mode 100644
index 00000000..aa8f2ea9
--- /dev/null
+++ b/test/fixtures/worker-loader/package-lock.json
@@ -0,0 +1,118 @@
+{
+ "name": "worker-loader",
+ "lockfileVersion": 2,
+ "requires": true,
+ "packages": {
+ "": {
+ "dependencies": {
+ "@surma/rollup-plugin-off-main-thread": "2.1.0"
+ }
+ },
+ "node_modules/@surma/rollup-plugin-off-main-thread": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/@surma/rollup-plugin-off-main-thread/-/rollup-plugin-off-main-thread-2.1.0.tgz",
+ "integrity": "sha512-xQnXQc2N/P/fS1qxSwf/gN7I4xjZ3LGpoTXpFpqj7hhpqFsmYKPj792HFSkTfQWhxNLnQN7m/0XIraZ5htlDYg==",
+ "dependencies": {
+ "ejs": "^2.6.1",
+ "json5": "^2.2.0",
+ "magic-string": "^0.25.0",
+ "tippex": "^3.0.0"
+ }
+ },
+ "node_modules/ejs": {
+ "version": "2.7.4",
+ "resolved": "https://registry.npmjs.org/ejs/-/ejs-2.7.4.tgz",
+ "integrity": "sha512-7vmuyh5+kuUyJKePhQfRQBhXV5Ce+RnaeeQArKu1EAMpL3WbgMt5WG6uQZpEVvYSSsxMXRKOewtDk9RaTKXRlA==",
+ "hasInstallScript": true,
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/json5": {
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.0.tgz",
+ "integrity": "sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA==",
+ "dependencies": {
+ "minimist": "^1.2.5"
+ },
+ "bin": {
+ "json5": "lib/cli.js"
+ },
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/magic-string": {
+ "version": "0.25.7",
+ "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.7.tgz",
+ "integrity": "sha512-4CrMT5DOHTDk4HYDlzmwu4FVCcIYI8gauveasrdCu2IKIFOJ3f0v/8MDGJCDL9oD2ppz/Av1b0Nj345H9M+XIA==",
+ "dependencies": {
+ "sourcemap-codec": "^1.4.4"
+ }
+ },
+ "node_modules/minimist": {
+ "version": "1.2.5",
+ "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz",
+ "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw=="
+ },
+ "node_modules/sourcemap-codec": {
+ "version": "1.4.8",
+ "resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz",
+ "integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA=="
+ },
+ "node_modules/tippex": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/tippex/-/tippex-3.0.0.tgz",
+ "integrity": "sha1-sXYJonzq/+B5ezhzk/2Zh45Nfqk="
+ }
+ },
+ "dependencies": {
+ "@surma/rollup-plugin-off-main-thread": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/@surma/rollup-plugin-off-main-thread/-/rollup-plugin-off-main-thread-2.1.0.tgz",
+ "integrity": "sha512-xQnXQc2N/P/fS1qxSwf/gN7I4xjZ3LGpoTXpFpqj7hhpqFsmYKPj792HFSkTfQWhxNLnQN7m/0XIraZ5htlDYg==",
+ "requires": {
+ "ejs": "^2.6.1",
+ "json5": "^2.2.0",
+ "magic-string": "^0.25.0",
+ "tippex": "^3.0.0"
+ }
+ },
+ "ejs": {
+ "version": "2.7.4",
+ "resolved": "https://registry.npmjs.org/ejs/-/ejs-2.7.4.tgz",
+ "integrity": "sha512-7vmuyh5+kuUyJKePhQfRQBhXV5Ce+RnaeeQArKu1EAMpL3WbgMt5WG6uQZpEVvYSSsxMXRKOewtDk9RaTKXRlA=="
+ },
+ "json5": {
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.0.tgz",
+ "integrity": "sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA==",
+ "requires": {
+ "minimist": "^1.2.5"
+ }
+ },
+ "magic-string": {
+ "version": "0.25.7",
+ "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.7.tgz",
+ "integrity": "sha512-4CrMT5DOHTDk4HYDlzmwu4FVCcIYI8gauveasrdCu2IKIFOJ3f0v/8MDGJCDL9oD2ppz/Av1b0Nj345H9M+XIA==",
+ "requires": {
+ "sourcemap-codec": "^1.4.4"
+ }
+ },
+ "minimist": {
+ "version": "1.2.5",
+ "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz",
+ "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw=="
+ },
+ "sourcemap-codec": {
+ "version": "1.4.8",
+ "resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz",
+ "integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA=="
+ },
+ "tippex": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/tippex/-/tippex-3.0.0.tgz",
+ "integrity": "sha1-sXYJonzq/+B5ezhzk/2Zh45Nfqk="
+ }
+ }
+}
diff --git a/test/fixtures/worker-loader/package.json b/test/fixtures/worker-loader/package.json
new file mode 100644
index 00000000..24dc45b7
--- /dev/null
+++ b/test/fixtures/worker-loader/package.json
@@ -0,0 +1,6 @@
+{
+ "name": "worker-loader",
+ "scripts": {
+ "build": "microbundle -f modern,es --workers"
+ }
+}
diff --git a/test/fixtures/worker-loader/src/bar.js b/test/fixtures/worker-loader/src/bar.js
new file mode 100644
index 00000000..808dbfe1
--- /dev/null
+++ b/test/fixtures/worker-loader/src/bar.js
@@ -0,0 +1,3 @@
+export function bar() {
+ return 'bar';
+}
diff --git a/test/fixtures/worker-loader/src/index.js b/test/fixtures/worker-loader/src/index.js
new file mode 100644
index 00000000..8e267c42
--- /dev/null
+++ b/test/fixtures/worker-loader/src/index.js
@@ -0,0 +1,4 @@
+const webWorker = new Worker('./worker.js', { type: 'module' });
+
+webWorker.onmessage = message => message.data === 'foobar';
+webWorker.postMessage('foo');
diff --git a/test/fixtures/worker-loader/src/worker.js b/test/fixtures/worker-loader/src/worker.js
new file mode 100644
index 00000000..45d741a0
--- /dev/null
+++ b/test/fixtures/worker-loader/src/worker.js
@@ -0,0 +1,3 @@
+import { bar } from './bar';
+
+self.onmessage = message => self.postMessage(message.data + bar());
From 5d0465b39bccff31673d351fc9d29cb4c470407d Mon Sep 17 00:00:00 2001
From: Marco Solazzi
Date: Wed, 6 Oct 2021 22:14:03 +0900
Subject: [PATCH 02/50] Fix: preserve terser annotations regexp (#875)
* fix: preserve terser annotations regexp
* chore: add changeset
* test: update snapshots
---
.changeset/gold-cherries-deliver.md | 5 +
src/index.js | 2 +-
test/__snapshots__/index.test.js.snap | 176 +++++++++++++-------------
3 files changed, 95 insertions(+), 88 deletions(-)
create mode 100644 .changeset/gold-cherries-deliver.md
diff --git a/.changeset/gold-cherries-deliver.md b/.changeset/gold-cherries-deliver.md
new file mode 100644
index 00000000..5f862dce
--- /dev/null
+++ b/.changeset/gold-cherries-deliver.md
@@ -0,0 +1,5 @@
+---
+'microbundle': patch
+---
+
+Preserve terser annotations in compressed bundle
diff --git a/src/index.js b/src/index.js
index c46b83a0..ed1e3f68 100644
--- a/src/index.js
+++ b/src/index.js
@@ -592,7 +592,7 @@ function createConfig(options, entry, format, writeMeta) {
// By default, Terser wraps function arguments in extra parens to trigger eager parsing.
// Whether this is a good idea is way too specific to guess, so we optimize for size by default:
wrap_func_args: false,
- comments: /^\s*([@#]__[A-Z]__\s*$|@cc_on)/,
+ comments: /^\s*([@#]__[A-Z]+__\s*$|@cc_on)/,
preserve_annotations: true,
},
module: modern,
diff --git a/test/__snapshots__/index.test.js.snap b/test/__snapshots__/index.test.js.snap
index 36a89342..a2a9d88b 100644
--- a/test/__snapshots__/index.test.js.snap
+++ b/test/__snapshots__/index.test.js.snap
@@ -165,30 +165,30 @@ async-ts
Build \\"asyncTs\\" to dist:
-103 B: async-ts.js.gz
-72 B: async-ts.js.br
-112 B: async-ts.esm.js.gz
-91 B: async-ts.esm.js.br
-200 B: async-ts.umd.js.gz
-156 B: async-ts.umd.js.br"
+117 B: async-ts.js.gz
+91 B: async-ts.js.br
+128 B: async-ts.esm.js.gz
+108 B: async-ts.esm.js.br
+217 B: async-ts.umd.js.gz
+164 B: async-ts.umd.js.br"
`;
exports[`fixtures build async-ts with microbundle 2`] = `7`;
exports[`fixtures build async-ts with microbundle 3`] = `
-"var o=function(){function o(){}return o.prototype.foo=function(){return Promise.resolve()},o}();export{o as MyClass};
+"var o=/*#__PURE__*/function(){function o(){}return o.prototype.foo=function(){return Promise.resolve()},o}();export{o as MyClass};
//# sourceMappingURL=async-ts.esm.js.map
"
`;
exports[`fixtures build async-ts with microbundle 4`] = `
-"exports.MyClass=function(){function o(){}return o.prototype.foo=function(){return Promise.resolve()},o}();
+"exports.MyClass=/*#__PURE__*/function(){function o(){}return o.prototype.foo=function(){return Promise.resolve()},o}();
//# sourceMappingURL=async-ts.js.map
"
`;
exports[`fixtures build async-ts with microbundle 5`] = `
-"!function(e,o){\\"object\\"==typeof exports&&\\"undefined\\"!=typeof module?o(exports):\\"function\\"==typeof define&&define.amd?define([\\"exports\\"],o):o((e||self).asyncTs={})}(this,function(e){e.MyClass=function(){function e(){}return e.prototype.foo=function(){return Promise.resolve()},e}()});
+"!function(e,o){\\"object\\"==typeof exports&&\\"undefined\\"!=typeof module?o(exports):\\"function\\"==typeof define&&define.amd?define([\\"exports\\"],o):o((e||self).asyncTs={})}(this,function(e){e.MyClass=/*#__PURE__*/function(){function e(){}return e.prototype.foo=function(){return Promise.resolve()},e}()});
//# sourceMappingURL=async-ts.umd.js.map
"
`;
@@ -500,12 +500,12 @@ basic-dashed-external
Build \\"basicDashedExternal\\" to dist:
-259 B: basic-dashed-external.js.gz
-196 B: basic-dashed-external.js.br
+276 B: basic-dashed-external.js.gz
+212 B: basic-dashed-external.js.br
214 B: basic-dashed-external.esm.js.gz
164 B: basic-dashed-external.esm.js.br
-343 B: basic-dashed-external.umd.js.gz
-286 B: basic-dashed-external.umd.js.br"
+357 B: basic-dashed-external.umd.js.gz
+285 B: basic-dashed-external.umd.js.br"
`;
exports[`fixtures build basic-dashed-external with microbundle 2`] = `6`;
@@ -517,13 +517,13 @@ exports[`fixtures build basic-dashed-external with microbundle 3`] = `
`;
exports[`fixtures build basic-dashed-external with microbundle 4`] = `
-"var e=require(\\"tiny-glob\\");function r(e){return e&&\\"object\\"==typeof e&&\\"default\\"in e?e:{default:e}}var t=function(){try{var e=arguments;return Promise.resolve([].slice.call(e).reduce(function(e,r){return e+r},0))}catch(e){return Promise.reject(e)}};console.log(r(e).default),module.exports=function(){try{var e=arguments,r=[].slice.call(e);return Promise.resolve(t.apply(void 0,r)).then(function(e){return Promise.resolve(t.apply(void 0,r)).then(function(r){return[e,r]})})}catch(e){return Promise.reject(e)}};
+"var e=require(\\"tiny-glob\\");function r(e){return e&&\\"object\\"==typeof e&&\\"default\\"in e?e:{default:e}}var t=function(){try{var e=arguments;return Promise.resolve([].slice.call(e).reduce(function(e,r){return e+r},0))}catch(e){return Promise.reject(e)}};console.log(/*#__PURE__*/r(e).default),module.exports=function(){try{var e=arguments,r=[].slice.call(e);return Promise.resolve(t.apply(void 0,r)).then(function(e){return Promise.resolve(t.apply(void 0,r)).then(function(r){return[e,r]})})}catch(e){return Promise.reject(e)}};
//# sourceMappingURL=basic-dashed-external.js.map
"
`;
exports[`fixtures build basic-dashed-external with microbundle 5`] = `
-"!function(e,t){\\"object\\"==typeof exports&&\\"undefined\\"!=typeof module?module.exports=t(require(\\"tiny-glob\\")):\\"function\\"==typeof define&&define.amd?define([\\"tiny-glob\\"],t):(e||self).basicDashedExternal=t(e.tinyGlob)}(this,function(e){function t(e){return e&&\\"object\\"==typeof e&&\\"default\\"in e?e:{default:e}}var n=function(){try{var e=arguments;return Promise.resolve([].slice.call(e).reduce(function(e,t){return e+t},0))}catch(e){return Promise.reject(e)}};return console.log(t(e).default),function(){try{var e=arguments,t=[].slice.call(e);return Promise.resolve(n.apply(void 0,t)).then(function(e){return Promise.resolve(n.apply(void 0,t)).then(function(t){return[e,t]})})}catch(e){return Promise.reject(e)}}});
+"!function(e,t){\\"object\\"==typeof exports&&\\"undefined\\"!=typeof module?module.exports=t(require(\\"tiny-glob\\")):\\"function\\"==typeof define&&define.amd?define([\\"tiny-glob\\"],t):(e||self).basicDashedExternal=t(e.tinyGlob)}(this,function(e){function t(e){return e&&\\"object\\"==typeof e&&\\"default\\"in e?e:{default:e}}var n=function(){try{var e=arguments;return Promise.resolve([].slice.call(e).reduce(function(e,t){return e+t},0))}catch(e){return Promise.reject(e)}};return console.log(/*#__PURE__*/t(e).default),function(){try{var e=arguments,t=[].slice.call(e);return Promise.resolve(n.apply(void 0,t)).then(function(e){return Promise.resolve(n.apply(void 0,t)).then(function(t){return[e,t]})})}catch(e){return Promise.reject(e)}}});
//# sourceMappingURL=basic-dashed-external.umd.js.map
"
`;
@@ -928,30 +928,30 @@ basic-ts
Build \\"basicLibTs\\" to dist:
-104 B: basic-lib-ts.js.gz
-76 B: basic-lib-ts.js.br
-104 B: basic-lib-ts.esm.js.gz
-82 B: basic-lib-ts.esm.js.br
-186 B: basic-lib-ts.umd.js.gz
-141 B: basic-lib-ts.umd.js.br"
+118 B: basic-lib-ts.js.gz
+94 B: basic-lib-ts.js.br
+118 B: basic-lib-ts.esm.js.gz
+97 B: basic-lib-ts.esm.js.br
+201 B: basic-lib-ts.umd.js.gz
+150 B: basic-lib-ts.umd.js.br"
`;
exports[`fixtures build basic-ts with microbundle 2`] = `8`;
exports[`fixtures build basic-ts with microbundle 3`] = `
-"var n=new(function(){function n(){}return n.prototype.drive=function(n){return!0},n}());export default n;
+"var n=new(/*#__PURE__*/function(){function n(){}return n.prototype.drive=function(n){return!0},n}());export default n;
//# sourceMappingURL=basic-lib-ts.esm.js.map
"
`;
exports[`fixtures build basic-ts with microbundle 4`] = `
-"var n=new(function(){function n(){}return n.prototype.drive=function(n){return!0},n}());module.exports=n;
+"var n=new(/*#__PURE__*/function(){function n(){}return n.prototype.drive=function(n){return!0},n}());module.exports=n;
//# sourceMappingURL=basic-lib-ts.js.map
"
`;
exports[`fixtures build basic-ts with microbundle 5`] = `
-"!function(e,n){\\"object\\"==typeof exports&&\\"undefined\\"!=typeof module?module.exports=n():\\"function\\"==typeof define&&define.amd?define(n):(e||self).basicLibTs=n()}(this,function(){return new(function(){function e(){}return e.prototype.drive=function(e){return!0},e}())});
+"!function(e,n){\\"object\\"==typeof exports&&\\"undefined\\"!=typeof module?module.exports=n():\\"function\\"==typeof define&&define.amd?define(n):(e||self).basicLibTs=n()}(this,function(){return new(/*#__PURE__*/function(){function e(){}return e.prototype.drive=function(e){return!0},e}())});
//# sourceMappingURL=basic-lib-ts.umd.js.map
"
`;
@@ -995,30 +995,31 @@ basic-tsx
Build \\"basicLibTsx\\" to dist:
-199 B: basic-lib-tsx.js.gz
-153 B: basic-lib-tsx.js.br
-200 B: basic-lib-tsx.esm.js.gz
-153 B: basic-lib-tsx.esm.js.br
-281 B: basic-lib-tsx.umd.js.gz
-217 B: basic-lib-tsx.umd.js.br"
+213 B: basic-lib-tsx.js.gz
+164 B: basic-lib-tsx.js.br
+218 B: basic-lib-tsx.esm.js.gz
+172 B: basic-lib-tsx.esm.js.br
+298 B: basic-lib-tsx.umd.js.gz
+232 B: basic-lib-tsx.umd.js.br"
`;
exports[`fixtures build basic-tsx with microbundle 2`] = `7`;
exports[`fixtures build basic-tsx with microbundle 3`] = `
-"var n=function(n,r){return{tag:n,props:r,children:[].slice.call(arguments,2)}},r=function(){function r(){}return r.prototype.render=function(){return n(\\"div\\",{id:\\"app\\"},n(\\"h1\\",null,\\"Hello, World!\\"),n(\\"p\\",null,\\"A JSX demo.\\"))},r}();export default r;
+"var n=function(n,r){return{tag:n,props:r,children:[].slice.call(arguments,2)}},r=/*#__PURE__*/function(){function r(){}return r.prototype.render=function(){return n(\\"div\\",{id:\\"app\\"},n(\\"h1\\",null,\\"Hello, World!\\"),n(\\"p\\",null,\\"A JSX demo.\\"))},r}();export default r;
//# sourceMappingURL=basic-lib-tsx.esm.js.map
"
`;
exports[`fixtures build basic-tsx with microbundle 4`] = `
-"var n=function(n,r){return{tag:n,props:r,children:[].slice.call(arguments,2)}};module.exports=function(){function r(){}return r.prototype.render=function(){return n(\\"div\\",{id:\\"app\\"},n(\\"h1\\",null,\\"Hello, World!\\"),n(\\"p\\",null,\\"A JSX demo.\\"))},r}();
+"var n=function(n,r){return{tag:n,props:r,children:[].slice.call(arguments,2)}};module.exports=/*#__PURE__*/function(){function r(){}return r.prototype.render=function(){return n(\\"div\\",{id:\\"app\\"},n(\\"h1\\",null,\\"Hello, World!\\"),n(\\"p\\",null,\\"A JSX demo.\\"))},r}();
//# sourceMappingURL=basic-lib-tsx.js.map
"
`;
exports[`fixtures build basic-tsx with microbundle 5`] = `
-"!function(e,n){\\"object\\"==typeof exports&&\\"undefined\\"!=typeof module?module.exports=n():\\"function\\"==typeof define&&define.amd?define(n):(e||self).basicLibTsx=n()}(this,function(){var e=function(e,n){return{tag:e,props:n,children:[].slice.call(arguments,2)}};return function(){function n(){}return n.prototype.render=function(){return e(\\"div\\",{id:\\"app\\"},e(\\"h1\\",null,\\"Hello, World!\\"),e(\\"p\\",null,\\"A JSX demo.\\"))},n}()});
+"!function(e,n){\\"object\\"==typeof exports&&\\"undefined\\"!=typeof module?module.exports=n():\\"function\\"==typeof define&&define.amd?define(n):(e||self).basicLibTsx=n()}(this,function(){var e=function(e,n){return{tag:e,props:n,children:[].slice.call(arguments,2)}};/*#__PURE__*/
+return function(){function n(){}return n.prototype.render=function(){return e(\\"div\\",{id:\\"app\\"},e(\\"h1\\",null,\\"Hello, World!\\"),e(\\"p\\",null,\\"A JSX demo.\\"))},n}()});
//# sourceMappingURL=basic-lib-tsx.umd.js.map
"
`;
@@ -1100,30 +1101,30 @@ class-decorators-ts
Build \\"classDecoratorsTs\\" to dist:
-333 B: class-decorators-ts.js.gz
-276 B: class-decorators-ts.js.br
-333 B: class-decorators-ts.esm.js.gz
-278 B: class-decorators-ts.esm.js.br
-400 B: class-decorators-ts.umd.js.gz
-341 B: class-decorators-ts.umd.js.br"
+348 B: class-decorators-ts.js.gz
+288 B: class-decorators-ts.js.br
+348 B: class-decorators-ts.esm.js.gz
+288 B: class-decorators-ts.esm.js.br
+415 B: class-decorators-ts.umd.js.gz
+353 B: class-decorators-ts.umd.js.br"
`;
exports[`fixtures build class-decorators-ts with microbundle 2`] = `7`;
exports[`fixtures build class-decorators-ts with microbundle 3`] = `
-"var e=function(){function e(e){this.greeting=e}return e.prototype.greet=function(){return\\"Hello, \\"+this.greeting},e}(),t=new(e=function(e,t,r,n){var o,c=arguments.length,l=c<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if(\\"object\\"==typeof Reflect&&\\"function\\"==typeof Reflect.decorate)l=Reflect.decorate(e,t,r,n);else for(var f=e.length-1;f>=0;f--)(o=e[f])&&(l=(c<3?o(l):c>3?o(t,r,l):o(t,r))||l);return c>3&&l&&Object.defineProperty(t,r,l),l}([function(e){Object.seal(e),Object.seal(e.prototype)}],e))(\\"Hello World\\");export default t;
+"var e=/*#__PURE__*/function(){function e(e){this.greeting=e}return e.prototype.greet=function(){return\\"Hello, \\"+this.greeting},e}(),t=new(e=function(e,t,r,n){var o,c=arguments.length,l=c<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if(\\"object\\"==typeof Reflect&&\\"function\\"==typeof Reflect.decorate)l=Reflect.decorate(e,t,r,n);else for(var f=e.length-1;f>=0;f--)(o=e[f])&&(l=(c<3?o(l):c>3?o(t,r,l):o(t,r))||l);return c>3&&l&&Object.defineProperty(t,r,l),l}([function(e){Object.seal(e),Object.seal(e.prototype)}],e))(\\"Hello World\\");export default t;
//# sourceMappingURL=class-decorators-ts.esm.js.map
"
`;
exports[`fixtures build class-decorators-ts with microbundle 4`] = `
-"var e=function(){function e(e){this.greeting=e}return e.prototype.greet=function(){return\\"Hello, \\"+this.greeting},e}(),t=new(e=function(e,t,r,o){var n,c=arguments.length,l=c<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if(\\"object\\"==typeof Reflect&&\\"function\\"==typeof Reflect.decorate)l=Reflect.decorate(e,t,r,o);else for(var f=e.length-1;f>=0;f--)(n=e[f])&&(l=(c<3?n(l):c>3?n(t,r,l):n(t,r))||l);return c>3&&l&&Object.defineProperty(t,r,l),l}([function(e){Object.seal(e),Object.seal(e.prototype)}],e))(\\"Hello World\\");module.exports=t;
+"var e=/*#__PURE__*/function(){function e(e){this.greeting=e}return e.prototype.greet=function(){return\\"Hello, \\"+this.greeting},e}(),t=new(e=function(e,t,r,o){var n,c=arguments.length,l=c<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if(\\"object\\"==typeof Reflect&&\\"function\\"==typeof Reflect.decorate)l=Reflect.decorate(e,t,r,o);else for(var f=e.length-1;f>=0;f--)(n=e[f])&&(l=(c<3?n(l):c>3?n(t,r,l):n(t,r))||l);return c>3&&l&&Object.defineProperty(t,r,l),l}([function(e){Object.seal(e),Object.seal(e.prototype)}],e))(\\"Hello World\\");module.exports=t;
//# sourceMappingURL=class-decorators-ts.js.map
"
`;
exports[`fixtures build class-decorators-ts with microbundle 5`] = `
-"!function(e,t){\\"object\\"==typeof exports&&\\"undefined\\"!=typeof module?module.exports=t():\\"function\\"==typeof define&&define.amd?define(t):(e||self).classDecoratorsTs=t()}(this,function(){var e=function(){function e(e){this.greeting=e}return e.prototype.greet=function(){return\\"Hello, \\"+this.greeting},e}();return new(e=function(e,t,o,n){var r,f=arguments.length,i=f<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,o):n;if(\\"object\\"==typeof Reflect&&\\"function\\"==typeof Reflect.decorate)i=Reflect.decorate(e,t,o,n);else for(var c=e.length-1;c>=0;c--)(r=e[c])&&(i=(f<3?r(i):f>3?r(t,o,i):r(t,o))||i);return f>3&&i&&Object.defineProperty(t,o,i),i}([function(e){Object.seal(e),Object.seal(e.prototype)}],e))(\\"Hello World\\")});
+"!function(e,t){\\"object\\"==typeof exports&&\\"undefined\\"!=typeof module?module.exports=t():\\"function\\"==typeof define&&define.amd?define(t):(e||self).classDecoratorsTs=t()}(this,function(){var e=/*#__PURE__*/function(){function e(e){this.greeting=e}return e.prototype.greet=function(){return\\"Hello, \\"+this.greeting},e}();return new(e=function(e,t,o,n){var r,f=arguments.length,i=f<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,o):n;if(\\"object\\"==typeof Reflect&&\\"function\\"==typeof Reflect.decorate)i=Reflect.decorate(e,t,o,n);else for(var c=e.length-1;c>=0;c--)(r=e[c])&&(i=(f<3?r(i):f>3?r(t,o,i):r(t,o))||i);return f>3&&i&&Object.defineProperty(t,o,i),i}([function(e){Object.seal(e),Object.seal(e.prototype)}],e))(\\"Hello World\\")});
//# sourceMappingURL=class-decorators-ts.umd.js.map
"
`;
@@ -1646,30 +1647,30 @@ esnext-ts
Build \\"esnextTs\\" to dist:
-989 B: esnext-ts.js.gz
-883 B: esnext-ts.js.br
-990 B: esnext-ts.esm.js.gz
-881 B: esnext-ts.esm.js.br
-1050 B: esnext-ts.umd.js.gz
-932 B: esnext-ts.umd.js.br"
+1007 B: esnext-ts.js.gz
+898 B: esnext-ts.js.br
+1008 B: esnext-ts.esm.js.gz
+898 B: esnext-ts.esm.js.br
+1068 B: esnext-ts.umd.js.gz
+950 B: esnext-ts.umd.js.br"
`;
exports[`fixtures build esnext-ts with microbundle 2`] = `7`;
exports[`fixtures build esnext-ts with microbundle 3`] = `
-"function n(t,e,i){if(!t.s){if(i instanceof r){if(!i.s)return void(i.o=n.bind(null,t,e));1&e&&(e=i.s),i=i.v}if(i&&i.then)return void i.then(n.bind(null,t,e),n.bind(null,t,2));t.s=e,t.v=i;var o=t.o;o&&o(t)}}var t=function(){try{var t,o,u,f,h=[],c=!0,v=!1,a=i(function(){return function(i,f){try{var v=function(){t=function(n){var t;if(\\"undefined\\"!=typeof Symbol){if(Symbol.asyncIterator&&null!=(t=n[Symbol.asyncIterator]))return t.call(n);if(Symbol.iterator&&null!=(t=n[Symbol.iterator]))return t.call(n)}throw new TypeError(\\"Object is not async iterable\\")}([1,2]);var i=function(t,i,o){for(var u;;){var f=t();if(e(f)&&(f=f.v),!f)return h;if(f.then){u=0;break}var h=o();if(h&&h.then){if(!e(h)){u=1;break}h=h.s}if(i){var c=i();if(c&&c.then&&!e(c)){u=2;break}}}var v=new r,a=n.bind(null,v,2);return(0===u?f.then(s):1===u?h.then(l):c.then(d)).then(void 0,a),v;function l(r){h=r;do{if(i&&(c=i())&&c.then&&!e(c))return void c.then(d).then(void 0,a);if(!(f=t())||e(f)&&!f.v)return void n(v,1,h);if(f.then)return void f.then(s).then(void 0,a);e(h=o())&&(h=h.v)}while(!h||!h.then);h.then(l).then(void 0,a)}function s(t){t?(h=o())&&h.then?h.then(l).then(void 0,a):l(h):n(v,1,h)}function d(){(f=t())?f.then?f.then(s).then(void 0,a):s(f):n(v,1,h)}}(function(){return!!Promise.resolve(t.next()).then(function(n){return c=o.done,o=n,Promise.resolve(o.value).then(function(n){return u=n,!c})})},function(){return!!(c=!0)},function(){h.push(u)});if(i&&i.then)return i.then(function(){})}()}catch(n){return f(n)}return v&&v.then?v.then(void 0,f):v}(0,function(n){v=!0,f=n})},function(n,r){function e(t){if(n)throw r;return r}var o=i(function(){var n=function(){if(!c&&null!=t.return)return Promise.resolve(t.return()).then(function(){})}();if(n&&n.then)return n.then(function(){})},function(n,t){if(v)throw f;if(n)throw t;return t});return o&&o.then?o.then(e):e()});return Promise.resolve(a&&a.then?a.then(function(n){return h}):h)}catch(n){return Promise.reject(n)}},r=function(){function t(){}return t.prototype.then=function(r,e){var i=new t,o=this.s;if(o){var u=1&o?r:e;if(u){try{n(i,1,u(this.v))}catch(t){n(i,2,t)}return i}return this}return this.o=function(t){try{var o=t.v;1&t.s?n(i,1,r?r(o):o):e?n(i,1,e(o)):n(i,2,o)}catch(t){n(i,2,t)}},i},t}();function e(n){return n instanceof r&&1&n.s}function i(n,t){try{var r=n()}catch(n){return t(!0,n)}return r&&r.then?r.then(t.bind(null,!1),t.bind(null,!0)):t(!1,r)}t().then(console.log);export default t;
+"function n(t,e,i){if(!t.s){if(i instanceof r){if(!i.s)return void(i.o=n.bind(null,t,e));1&e&&(e=i.s),i=i.v}if(i&&i.then)return void i.then(n.bind(null,t,e),n.bind(null,t,2));t.s=e,t.v=i;var o=t.o;o&&o(t)}}var t=function(){try{var t,o,u,f,h=[],c=!0,v=!1,a=i(function(){return function(i,f){try{var v=function(){t=function(n){var t;if(\\"undefined\\"!=typeof Symbol){if(Symbol.asyncIterator&&null!=(t=n[Symbol.asyncIterator]))return t.call(n);if(Symbol.iterator&&null!=(t=n[Symbol.iterator]))return t.call(n)}throw new TypeError(\\"Object is not async iterable\\")}([1,2]);var i=function(t,i,o){for(var u;;){var f=t();if(e(f)&&(f=f.v),!f)return h;if(f.then){u=0;break}var h=o();if(h&&h.then){if(!e(h)){u=1;break}h=h.s}if(i){var c=i();if(c&&c.then&&!e(c)){u=2;break}}}var v=new r,a=n.bind(null,v,2);return(0===u?f.then(s):1===u?h.then(l):c.then(d)).then(void 0,a),v;function l(r){h=r;do{if(i&&(c=i())&&c.then&&!e(c))return void c.then(d).then(void 0,a);if(!(f=t())||e(f)&&!f.v)return void n(v,1,h);if(f.then)return void f.then(s).then(void 0,a);e(h=o())&&(h=h.v)}while(!h||!h.then);h.then(l).then(void 0,a)}function s(t){t?(h=o())&&h.then?h.then(l).then(void 0,a):l(h):n(v,1,h)}function d(){(f=t())?f.then?f.then(s).then(void 0,a):s(f):n(v,1,h)}}(function(){return!!Promise.resolve(t.next()).then(function(n){return c=o.done,o=n,Promise.resolve(o.value).then(function(n){return u=n,!c})})},function(){return!!(c=!0)},function(){h.push(u)});if(i&&i.then)return i.then(function(){})}()}catch(n){return f(n)}return v&&v.then?v.then(void 0,f):v}(0,function(n){v=!0,f=n})},function(n,r){function e(t){if(n)throw r;return r}var o=i(function(){var n=function(){if(!c&&null!=t.return)return Promise.resolve(t.return()).then(function(){})}();if(n&&n.then)return n.then(function(){})},function(n,t){if(v)throw f;if(n)throw t;return t});return o&&o.then?o.then(e):e()});return Promise.resolve(a&&a.then?a.then(function(n){return h}):h)}catch(n){return Promise.reject(n)}},r=/*#__PURE__*/function(){function t(){}return t.prototype.then=function(r,e){var i=new t,o=this.s;if(o){var u=1&o?r:e;if(u){try{n(i,1,u(this.v))}catch(t){n(i,2,t)}return i}return this}return this.o=function(t){try{var o=t.v;1&t.s?n(i,1,r?r(o):o):e?n(i,1,e(o)):n(i,2,o)}catch(t){n(i,2,t)}},i},t}();function e(n){return n instanceof r&&1&n.s}function i(n,t){try{var r=n()}catch(n){return t(!0,n)}return r&&r.then?r.then(t.bind(null,!1),t.bind(null,!0)):t(!1,r)}t().then(console.log);export default t;
//# sourceMappingURL=esnext-ts.esm.js.map
"
`;
exports[`fixtures build esnext-ts with microbundle 4`] = `
-"function n(t,e,i){if(!t.s){if(i instanceof r){if(!i.s)return void(i.o=n.bind(null,t,e));1&e&&(e=i.s),i=i.v}if(i&&i.then)return void i.then(n.bind(null,t,e),n.bind(null,t,2));t.s=e,t.v=i;var o=t.o;o&&o(t)}}var t=function(){try{var t,o,u,f,h=[],c=!0,v=!1,a=i(function(){return function(i,f){try{var v=function(){t=function(n){var t;if(\\"undefined\\"!=typeof Symbol){if(Symbol.asyncIterator&&null!=(t=n[Symbol.asyncIterator]))return t.call(n);if(Symbol.iterator&&null!=(t=n[Symbol.iterator]))return t.call(n)}throw new TypeError(\\"Object is not async iterable\\")}([1,2]);var i=function(t,i,o){for(var u;;){var f=t();if(e(f)&&(f=f.v),!f)return h;if(f.then){u=0;break}var h=o();if(h&&h.then){if(!e(h)){u=1;break}h=h.s}if(i){var c=i();if(c&&c.then&&!e(c)){u=2;break}}}var v=new r,a=n.bind(null,v,2);return(0===u?f.then(s):1===u?h.then(l):c.then(d)).then(void 0,a),v;function l(r){h=r;do{if(i&&(c=i())&&c.then&&!e(c))return void c.then(d).then(void 0,a);if(!(f=t())||e(f)&&!f.v)return void n(v,1,h);if(f.then)return void f.then(s).then(void 0,a);e(h=o())&&(h=h.v)}while(!h||!h.then);h.then(l).then(void 0,a)}function s(t){t?(h=o())&&h.then?h.then(l).then(void 0,a):l(h):n(v,1,h)}function d(){(f=t())?f.then?f.then(s).then(void 0,a):s(f):n(v,1,h)}}(function(){return!!Promise.resolve(t.next()).then(function(n){return c=o.done,o=n,Promise.resolve(o.value).then(function(n){return u=n,!c})})},function(){return!!(c=!0)},function(){h.push(u)});if(i&&i.then)return i.then(function(){})}()}catch(n){return f(n)}return v&&v.then?v.then(void 0,f):v}(0,function(n){v=!0,f=n})},function(n,r){function e(t){if(n)throw r;return r}var o=i(function(){var n=function(){if(!c&&null!=t.return)return Promise.resolve(t.return()).then(function(){})}();if(n&&n.then)return n.then(function(){})},function(n,t){if(v)throw f;if(n)throw t;return t});return o&&o.then?o.then(e):e()});return Promise.resolve(a&&a.then?a.then(function(n){return h}):h)}catch(n){return Promise.reject(n)}},r=function(){function t(){}return t.prototype.then=function(r,e){var i=new t,o=this.s;if(o){var u=1&o?r:e;if(u){try{n(i,1,u(this.v))}catch(t){n(i,2,t)}return i}return this}return this.o=function(t){try{var o=t.v;1&t.s?n(i,1,r?r(o):o):e?n(i,1,e(o)):n(i,2,o)}catch(t){n(i,2,t)}},i},t}();function e(n){return n instanceof r&&1&n.s}function i(n,t){try{var r=n()}catch(n){return t(!0,n)}return r&&r.then?r.then(t.bind(null,!1),t.bind(null,!0)):t(!1,r)}t().then(console.log),module.exports=t;
+"function n(t,e,i){if(!t.s){if(i instanceof r){if(!i.s)return void(i.o=n.bind(null,t,e));1&e&&(e=i.s),i=i.v}if(i&&i.then)return void i.then(n.bind(null,t,e),n.bind(null,t,2));t.s=e,t.v=i;var o=t.o;o&&o(t)}}var t=function(){try{var t,o,u,f,h=[],c=!0,v=!1,a=i(function(){return function(i,f){try{var v=function(){t=function(n){var t;if(\\"undefined\\"!=typeof Symbol){if(Symbol.asyncIterator&&null!=(t=n[Symbol.asyncIterator]))return t.call(n);if(Symbol.iterator&&null!=(t=n[Symbol.iterator]))return t.call(n)}throw new TypeError(\\"Object is not async iterable\\")}([1,2]);var i=function(t,i,o){for(var u;;){var f=t();if(e(f)&&(f=f.v),!f)return h;if(f.then){u=0;break}var h=o();if(h&&h.then){if(!e(h)){u=1;break}h=h.s}if(i){var c=i();if(c&&c.then&&!e(c)){u=2;break}}}var v=new r,a=n.bind(null,v,2);return(0===u?f.then(s):1===u?h.then(l):c.then(d)).then(void 0,a),v;function l(r){h=r;do{if(i&&(c=i())&&c.then&&!e(c))return void c.then(d).then(void 0,a);if(!(f=t())||e(f)&&!f.v)return void n(v,1,h);if(f.then)return void f.then(s).then(void 0,a);e(h=o())&&(h=h.v)}while(!h||!h.then);h.then(l).then(void 0,a)}function s(t){t?(h=o())&&h.then?h.then(l).then(void 0,a):l(h):n(v,1,h)}function d(){(f=t())?f.then?f.then(s).then(void 0,a):s(f):n(v,1,h)}}(function(){return!!Promise.resolve(t.next()).then(function(n){return c=o.done,o=n,Promise.resolve(o.value).then(function(n){return u=n,!c})})},function(){return!!(c=!0)},function(){h.push(u)});if(i&&i.then)return i.then(function(){})}()}catch(n){return f(n)}return v&&v.then?v.then(void 0,f):v}(0,function(n){v=!0,f=n})},function(n,r){function e(t){if(n)throw r;return r}var o=i(function(){var n=function(){if(!c&&null!=t.return)return Promise.resolve(t.return()).then(function(){})}();if(n&&n.then)return n.then(function(){})},function(n,t){if(v)throw f;if(n)throw t;return t});return o&&o.then?o.then(e):e()});return Promise.resolve(a&&a.then?a.then(function(n){return h}):h)}catch(n){return Promise.reject(n)}},r=/*#__PURE__*/function(){function t(){}return t.prototype.then=function(r,e){var i=new t,o=this.s;if(o){var u=1&o?r:e;if(u){try{n(i,1,u(this.v))}catch(t){n(i,2,t)}return i}return this}return this.o=function(t){try{var o=t.v;1&t.s?n(i,1,r?r(o):o):e?n(i,1,e(o)):n(i,2,o)}catch(t){n(i,2,t)}},i},t}();function e(n){return n instanceof r&&1&n.s}function i(n,t){try{var r=n()}catch(n){return t(!0,n)}return r&&r.then?r.then(t.bind(null,!1),t.bind(null,!0)):t(!1,r)}t().then(console.log),module.exports=t;
//# sourceMappingURL=esnext-ts.js.map
"
`;
exports[`fixtures build esnext-ts with microbundle 5`] = `
-"!function(n,t){\\"object\\"==typeof exports&&\\"undefined\\"!=typeof module?module.exports=t():\\"function\\"==typeof define&&define.amd?define(t):(n||self).esnextTs=t()}(this,function(){function n(t,r,i){if(!t.s){if(i instanceof e){if(!i.s)return void(i.o=n.bind(null,t,r));1&r&&(r=i.s),i=i.v}if(i&&i.then)return void i.then(n.bind(null,t,r),n.bind(null,t,2));t.s=r,t.v=i;var o=t.o;o&&o(t)}}var t=function(){try{var t,o,u,f,h=[],c=!0,l=!1,a=i(function(){return function(i,f){try{var l=function(){t=function(n){var t;if(\\"undefined\\"!=typeof Symbol){if(Symbol.asyncIterator&&null!=(t=n[Symbol.asyncIterator]))return t.call(n);if(Symbol.iterator&&null!=(t=n[Symbol.iterator]))return t.call(n)}throw new TypeError(\\"Object is not async iterable\\")}([1,2]);var i=function(t,i,o){for(var u;;){var f=t();if(r(f)&&(f=f.v),!f)return h;if(f.then){u=0;break}var h=o();if(h&&h.then){if(!r(h)){u=1;break}h=h.s}if(i){var c=i();if(c&&c.then&&!r(c)){u=2;break}}}var l=new e,a=n.bind(null,l,2);return(0===u?f.then(s):1===u?h.then(v):c.then(d)).then(void 0,a),l;function v(e){h=e;do{if(i&&(c=i())&&c.then&&!r(c))return void c.then(d).then(void 0,a);if(!(f=t())||r(f)&&!f.v)return void n(l,1,h);if(f.then)return void f.then(s).then(void 0,a);r(h=o())&&(h=h.v)}while(!h||!h.then);h.then(v).then(void 0,a)}function s(t){t?(h=o())&&h.then?h.then(v).then(void 0,a):v(h):n(l,1,h)}function d(){(f=t())?f.then?f.then(s).then(void 0,a):s(f):n(l,1,h)}}(function(){return!!Promise.resolve(t.next()).then(function(n){return c=o.done,o=n,Promise.resolve(o.value).then(function(n){return u=n,!c})})},function(){return!!(c=!0)},function(){h.push(u)});if(i&&i.then)return i.then(function(){})}()}catch(n){return f(n)}return l&&l.then?l.then(void 0,f):l}(0,function(n){l=!0,f=n})},function(n,e){function r(t){if(n)throw e;return e}var o=i(function(){var n=function(){if(!c&&null!=t.return)return Promise.resolve(t.return()).then(function(){})}();if(n&&n.then)return n.then(function(){})},function(n,t){if(l)throw f;if(n)throw t;return t});return o&&o.then?o.then(r):r()});return Promise.resolve(a&&a.then?a.then(function(n){return h}):h)}catch(n){return Promise.reject(n)}},e=function(){function t(){}return t.prototype.then=function(e,r){var i=new t,o=this.s;if(o){var u=1&o?e:r;if(u){try{n(i,1,u(this.v))}catch(t){n(i,2,t)}return i}return this}return this.o=function(t){try{var o=t.v;1&t.s?n(i,1,e?e(o):o):r?n(i,1,r(o)):n(i,2,o)}catch(t){n(i,2,t)}},i},t}();function r(n){return n instanceof e&&1&n.s}function i(n,t){try{var e=n()}catch(n){return t(!0,n)}return e&&e.then?e.then(t.bind(null,!1),t.bind(null,!0)):t(!1,e)}return t().then(console.log),t});
+"!function(n,t){\\"object\\"==typeof exports&&\\"undefined\\"!=typeof module?module.exports=t():\\"function\\"==typeof define&&define.amd?define(t):(n||self).esnextTs=t()}(this,function(){function n(t,r,i){if(!t.s){if(i instanceof e){if(!i.s)return void(i.o=n.bind(null,t,r));1&r&&(r=i.s),i=i.v}if(i&&i.then)return void i.then(n.bind(null,t,r),n.bind(null,t,2));t.s=r,t.v=i;var o=t.o;o&&o(t)}}var t=function(){try{var t,o,u,f,h=[],c=!0,l=!1,a=i(function(){return function(i,f){try{var l=function(){t=function(n){var t;if(\\"undefined\\"!=typeof Symbol){if(Symbol.asyncIterator&&null!=(t=n[Symbol.asyncIterator]))return t.call(n);if(Symbol.iterator&&null!=(t=n[Symbol.iterator]))return t.call(n)}throw new TypeError(\\"Object is not async iterable\\")}([1,2]);var i=function(t,i,o){for(var u;;){var f=t();if(r(f)&&(f=f.v),!f)return h;if(f.then){u=0;break}var h=o();if(h&&h.then){if(!r(h)){u=1;break}h=h.s}if(i){var c=i();if(c&&c.then&&!r(c)){u=2;break}}}var l=new e,a=n.bind(null,l,2);return(0===u?f.then(s):1===u?h.then(v):c.then(d)).then(void 0,a),l;function v(e){h=e;do{if(i&&(c=i())&&c.then&&!r(c))return void c.then(d).then(void 0,a);if(!(f=t())||r(f)&&!f.v)return void n(l,1,h);if(f.then)return void f.then(s).then(void 0,a);r(h=o())&&(h=h.v)}while(!h||!h.then);h.then(v).then(void 0,a)}function s(t){t?(h=o())&&h.then?h.then(v).then(void 0,a):v(h):n(l,1,h)}function d(){(f=t())?f.then?f.then(s).then(void 0,a):s(f):n(l,1,h)}}(function(){return!!Promise.resolve(t.next()).then(function(n){return c=o.done,o=n,Promise.resolve(o.value).then(function(n){return u=n,!c})})},function(){return!!(c=!0)},function(){h.push(u)});if(i&&i.then)return i.then(function(){})}()}catch(n){return f(n)}return l&&l.then?l.then(void 0,f):l}(0,function(n){l=!0,f=n})},function(n,e){function r(t){if(n)throw e;return e}var o=i(function(){var n=function(){if(!c&&null!=t.return)return Promise.resolve(t.return()).then(function(){})}();if(n&&n.then)return n.then(function(){})},function(n,t){if(l)throw f;if(n)throw t;return t});return o&&o.then?o.then(r):r()});return Promise.resolve(a&&a.then?a.then(function(n){return h}):h)}catch(n){return Promise.reject(n)}},e=/*#__PURE__*/function(){function t(){}return t.prototype.then=function(e,r){var i=new t,o=this.s;if(o){var u=1&o?e:r;if(u){try{n(i,1,u(this.v))}catch(t){n(i,2,t)}return i}return this}return this.o=function(t){try{var o=t.v;1&t.s?n(i,1,e?e(o):o):r?n(i,1,r(o)):n(i,2,o)}catch(t){n(i,2,t)}},i},t}();function r(n){return n instanceof e&&1&n.s}function i(n,t){try{var e=n()}catch(n){return t(!0,n)}return e&&e.then?e.then(t.bind(null,!1),t.bind(null,!0)):t(!1,e)}return t().then(console.log),t});
//# sourceMappingURL=esnext-ts.umd.js.map
"
`;
@@ -1742,30 +1743,31 @@ jsx
Build \\"jsx\\" to dist:
-221 B: jsx.js.gz
-179 B: jsx.js.br
-223 B: jsx.esm.js.gz
-193 B: jsx.esm.js.br
-297 B: jsx.umd.js.gz
-236 B: jsx.umd.js.br"
+239 B: jsx.js.gz
+195 B: jsx.js.br
+237 B: jsx.esm.js.gz
+201 B: jsx.esm.js.br
+313 B: jsx.umd.js.gz
+248 B: jsx.umd.js.br"
`;
exports[`fixtures build jsx with microbundle 2`] = `6`;
exports[`fixtures build jsx with microbundle 3`] = `
-"var n=function(n,r){return{tag:n,props:r,children:[].slice.call(arguments,2)}},r=function(n){return n.children},l=function(){function l(){}return l.prototype.render=function(){return n(\\"div\\",{id:\\"app\\"},n(\\"h1\\",null,\\"Hello, World!\\"),n(\\"p\\",null,\\"A JSX demo.\\"),n(r,null,n(\\"p\\",null,\\"Test fragment\\")))},l}();export default l;
+"var n=function(n,r){return{tag:n,props:r,children:[].slice.call(arguments,2)}},r=function(n){return n.children},l=/*#__PURE__*/function(){function l(){}return l.prototype.render=function(){return n(\\"div\\",{id:\\"app\\"},n(\\"h1\\",null,\\"Hello, World!\\"),n(\\"p\\",null,\\"A JSX demo.\\"),n(r,null,n(\\"p\\",null,\\"Test fragment\\")))},l}();export default l;
//# sourceMappingURL=jsx.esm.js.map
"
`;
exports[`fixtures build jsx with microbundle 4`] = `
-"var n=function(n,r){return{tag:n,props:r,children:[].slice.call(arguments,2)}},r=function(n){return n.children};module.exports=function(){function l(){}return l.prototype.render=function(){return n(\\"div\\",{id:\\"app\\"},n(\\"h1\\",null,\\"Hello, World!\\"),n(\\"p\\",null,\\"A JSX demo.\\"),n(r,null,n(\\"p\\",null,\\"Test fragment\\")))},l}();
+"var n=function(n,r){return{tag:n,props:r,children:[].slice.call(arguments,2)}},r=function(n){return n.children};module.exports=/*#__PURE__*/function(){function l(){}return l.prototype.render=function(){return n(\\"div\\",{id:\\"app\\"},n(\\"h1\\",null,\\"Hello, World!\\"),n(\\"p\\",null,\\"A JSX demo.\\"),n(r,null,n(\\"p\\",null,\\"Test fragment\\")))},l}();
//# sourceMappingURL=jsx.js.map
"
`;
exports[`fixtures build jsx with microbundle 5`] = `
-"!function(n,e){\\"object\\"==typeof exports&&\\"undefined\\"!=typeof module?module.exports=e():\\"function\\"==typeof define&&define.amd?define(e):(n||self).jsx=e()}(this,function(){var n=function(n,e){return{tag:n,props:e,children:[].slice.call(arguments,2)}},e=function(n){return n.children};return function(){function t(){}return t.prototype.render=function(){return n(\\"div\\",{id:\\"app\\"},n(\\"h1\\",null,\\"Hello, World!\\"),n(\\"p\\",null,\\"A JSX demo.\\"),n(e,null,n(\\"p\\",null,\\"Test fragment\\")))},t}()});
+"!function(n,e){\\"object\\"==typeof exports&&\\"undefined\\"!=typeof module?module.exports=e():\\"function\\"==typeof define&&define.amd?define(e):(n||self).jsx=e()}(this,function(){var n=function(n,e){return{tag:n,props:e,children:[].slice.call(arguments,2)}},e=function(n){return n.children};/*#__PURE__*/
+return function(){function t(){}return t.prototype.render=function(){return n(\\"div\\",{id:\\"app\\"},n(\\"h1\\",null,\\"Hello, World!\\"),n(\\"p\\",null,\\"A JSX demo.\\"),n(e,null,n(\\"p\\",null,\\"Test fragment\\")))},t}()});
//# sourceMappingURL=jsx.umd.js.map
"
`;
@@ -2109,26 +2111,26 @@ modern-generators
Build \\"modernGenerators\\" to dist:
-234 B: modern-generators.js.gz
-207 B: modern-generators.js.br
+248 B: modern-generators.js.gz
+201 B: modern-generators.js.br
118 B: modern-generators.modern.js.gz
99 B: modern-generators.modern.js.br
-233 B: modern-generators.esm.js.gz
-191 B: modern-generators.esm.js.br
-310 B: modern-generators.umd.js.gz
-257 B: modern-generators.umd.js.br"
+247 B: modern-generators.esm.js.gz
+218 B: modern-generators.esm.js.br
+326 B: modern-generators.umd.js.gz
+267 B: modern-generators.umd.js.br"
`;
exports[`fixtures build modern-generators with microbundle 2`] = `8`;
exports[`fixtures build modern-generators with microbundle 3`] = `
-"var e=regeneratorRuntime.mark(r);function r(){var r;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:r=0;case 1:return e.next=4,r++;case 4:e.next=1;break;case 6:case\\"end\\":return e.stop()}},e)}export default function(){try{var e=r();return Promise.resolve([e.next().value,e.next().value])}catch(e){return Promise.reject(e)}}
+"var e=/*#__PURE__*/regeneratorRuntime.mark(r);function r(){var r;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:r=0;case 1:return e.next=4,r++;case 4:e.next=1;break;case 6:case\\"end\\":return e.stop()}},e)}export default function(){try{var e=r();return Promise.resolve([e.next().value,e.next().value])}catch(e){return Promise.reject(e)}}
//# sourceMappingURL=modern-generators.esm.js.map
"
`;
exports[`fixtures build modern-generators with microbundle 4`] = `
-"var e=regeneratorRuntime.mark(r);function r(){var r;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:r=0;case 1:return e.next=4,r++;case 4:e.next=1;break;case 6:case\\"end\\":return e.stop()}},e)}module.exports=function(){try{var e=r();return Promise.resolve([e.next().value,e.next().value])}catch(e){return Promise.reject(e)}};
+"var e=/*#__PURE__*/regeneratorRuntime.mark(r);function r(){var r;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:r=0;case 1:return e.next=4,r++;case 4:e.next=1;break;case 6:case\\"end\\":return e.stop()}},e)}module.exports=function(){try{var e=r();return Promise.resolve([e.next().value,e.next().value])}catch(e){return Promise.reject(e)}};
//# sourceMappingURL=modern-generators.js.map
"
`;
@@ -2140,7 +2142,7 @@ exports[`fixtures build modern-generators with microbundle 5`] = `
`;
exports[`fixtures build modern-generators with microbundle 6`] = `
-"!function(e,n){\\"object\\"==typeof exports&&\\"undefined\\"!=typeof module?module.exports=n():\\"function\\"==typeof define&&define.amd?define(n):(e||self).modernGenerators=n()}(this,function(){var e=regeneratorRuntime.mark(n);function n(){var n;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:n=0;case 1:return e.next=4,n++;case 4:e.next=1;break;case 6:case\\"end\\":return e.stop()}},e)}return function(){try{var e=n();return Promise.resolve([e.next().value,e.next().value])}catch(e){return Promise.reject(e)}}});
+"!function(e,n){\\"object\\"==typeof exports&&\\"undefined\\"!=typeof module?module.exports=n():\\"function\\"==typeof define&&define.amd?define(n):(e||self).modernGenerators=n()}(this,function(){var e=/*#__PURE__*/regeneratorRuntime.mark(n);function n(){var n;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:n=0;case 1:return e.next=4,n++;case 4:e.next=1;break;case 6:case\\"end\\":return e.stop()}},e)}return function(){try{var e=n();return Promise.resolve([e.next().value,e.next().value])}catch(e){return Promise.reject(e)}}});
//# sourceMappingURL=modern-generators.umd.js.map
"
`;
@@ -2687,30 +2689,30 @@ terser-annotations
Build \\"terserAnnotations\\" to dist:
-112 B: terser-annotations.js.gz
-86 B: terser-annotations.js.br
-117 B: terser-annotations.esm.js.gz
-88 B: terser-annotations.esm.js.br
-200 B: terser-annotations.umd.js.gz
-159 B: terser-annotations.umd.js.br"
+133 B: terser-annotations.js.gz
+104 B: terser-annotations.js.br
+138 B: terser-annotations.esm.js.gz
+97 B: terser-annotations.esm.js.br
+224 B: terser-annotations.umd.js.gz
+169 B: terser-annotations.umd.js.br"
`;
exports[`fixtures build terser-annotations with microbundle 2`] = `6`;
exports[`fixtures build terser-annotations with microbundle 3`] = `
-"function shouldBePreserved(e,n){return e-n}function main(e,n){return{inlined:function(e,n){return e+n}(e,n),preserved:shouldBePreserved(e,n)}}export default main;
+"function shouldBePreserved(e,n){return e-n}function main(e,n){return{inlined:/*@__INLINE__*/function(e,n){return e+n}(e,n),preserved:/*@__NOINLINE__*/shouldBePreserved(e,n)}}export default main;
//# sourceMappingURL=terser-annotations.esm.js.map
"
`;
exports[`fixtures build terser-annotations with microbundle 4`] = `
-"function shouldBePreserved(e,r){return e-r}module.exports=function(e,r){return{inlined:function(e,r){return e+r}(e,r),preserved:shouldBePreserved(e,r)}};
+"function shouldBePreserved(e,r){return e-r}module.exports=function(e,r){return{inlined:/*@__INLINE__*/function(e,r){return e+r}(e,r),preserved:/*@__NOINLINE__*/shouldBePreserved(e,r)}};
//# sourceMappingURL=terser-annotations.js.map
"
`;
exports[`fixtures build terser-annotations with microbundle 5`] = `
-"!function(e,n){\\"object\\"==typeof exports&&\\"undefined\\"!=typeof module?module.exports=n():\\"function\\"==typeof define&&define.amd?define(n):(e||self).terserAnnotations=n()}(this,function(){function shouldBePreserved(e,n){return e-n}return function(e,n){return{inlined:function(e,n){return e+n}(e,n),preserved:shouldBePreserved(e,n)}}});
+"!function(e,n){\\"object\\"==typeof exports&&\\"undefined\\"!=typeof module?module.exports=n():\\"function\\"==typeof define&&define.amd?define(n):(e||self).terserAnnotations=n()}(this,function(){function shouldBePreserved(e,n){return e-n}return function(e,n){return{inlined:/*@__INLINE__*/function(e,n){return e+n}(e,n),preserved:/*@__NOINLINE__*/shouldBePreserved(e,n)}}});
//# sourceMappingURL=terser-annotations.umd.js.map
"
`;
@@ -2909,12 +2911,12 @@ ts-mixed-exports
Build \\"tsMixedExports\\" to dist:
-112 B: ts-mixed-exports.js.gz
-89 B: ts-mixed-exports.js.br
-115 B: ts-mixed-exports.esm.js.gz
-100 B: ts-mixed-exports.esm.js.br
-212 B: ts-mixed-exports.umd.js.gz
-170 B: ts-mixed-exports.umd.js.br"
+130 B: ts-mixed-exports.js.gz
+104 B: ts-mixed-exports.js.br
+134 B: ts-mixed-exports.esm.js.gz
+118 B: ts-mixed-exports.esm.js.br
+228 B: ts-mixed-exports.umd.js.gz
+185 B: ts-mixed-exports.umd.js.br"
`;
exports[`fixtures build ts-mixed-exports with microbundle 2`] = `8`;
@@ -2938,19 +2940,19 @@ export default Ferrari;
`;
exports[`fixtures build ts-mixed-exports with microbundle 5`] = `
-"var t=function(){function t(){}return t.prototype.drive=function(t){return!0},t}(),n=new t;export default n;export{t as Car};
+"var t=/*#__PURE__*/function(){function t(){}return t.prototype.drive=function(t){return!0},t}(),n=new t;export default n;export{t as Car};
//# sourceMappingURL=ts-mixed-exports.esm.js.map
"
`;
exports[`fixtures build ts-mixed-exports with microbundle 6`] = `
-"var r=function(){function r(){}return r.prototype.drive=function(r){return!0},r}(),t=new r;exports.Car=r,exports.default=t;
+"var r=/*#__PURE__*/function(){function r(){}return r.prototype.drive=function(r){return!0},r}(),t=new r;exports.Car=r,exports.default=t;
//# sourceMappingURL=ts-mixed-exports.js.map
"
`;
exports[`fixtures build ts-mixed-exports with microbundle 7`] = `
-"!function(e,n){\\"object\\"==typeof exports&&\\"undefined\\"!=typeof module?n(exports):\\"function\\"==typeof define&&define.amd?define([\\"exports\\"],n):n((e||self).tsMixedExports={})}(this,function(e){var n=function(){function e(){}return e.prototype.drive=function(e){return!0},e}(),t=new n;e.Car=n,e.default=t});
+"!function(e,n){\\"object\\"==typeof exports&&\\"undefined\\"!=typeof module?n(exports):\\"function\\"==typeof define&&define.amd?define([\\"exports\\"],n):n((e||self).tsMixedExports={})}(this,function(e){var n=/*#__PURE__*/function(){function e(){}return e.prototype.drive=function(e){return!0},e}(),t=new n;e.Car=n,e.default=t});
//# sourceMappingURL=ts-mixed-exports.umd.js.map
"
`;
From 5e93a0e4cc28ea8f080a08e3a8530b6bfdf25f42 Mon Sep 17 00:00:00 2001
From: Jason Miller
Date: Wed, 6 Oct 2021 09:59:44 -0400
Subject: [PATCH 03/50] Fix exports walk (#852) (#853)
* Fix exports walk (#852)
Fixes #852
* Create eight-toes-pump.md
* traverse default exports in type:module packages
---
.changeset/eight-toes-pump.md | 5 +++++
src/index.js | 9 ++++++---
2 files changed, 11 insertions(+), 3 deletions(-)
create mode 100644 .changeset/eight-toes-pump.md
diff --git a/.changeset/eight-toes-pump.md b/.changeset/eight-toes-pump.md
new file mode 100644
index 00000000..bd89f985
--- /dev/null
+++ b/.changeset/eight-toes-pump.md
@@ -0,0 +1,5 @@
+---
+"microbundle": patch
+---
+
+Fix crash when traversing `"exports"` objects (#852)
diff --git a/src/index.js b/src/index.js
index ed1e3f68..7ad55a0f 100644
--- a/src/index.js
+++ b/src/index.js
@@ -260,9 +260,12 @@ function replaceName(filename, name) {
);
}
-function walk(exports) {
+function walk(exports, includeDefault) {
+ if (!exports) return null;
if (typeof exports === 'string') return exports;
- return walk(exports['.'] || exports.import || exports.module);
+ let p = exports['.'] || exports.import || exports.module;
+ if (!p && includeDefault) p = exports.default;
+ return walk(p, includeDefault);
}
function getMain({ options, entry, format }) {
@@ -296,7 +299,7 @@ function getMain({ options, entry, format }) {
mainNoExtension,
);
mainsByFormat.modern = replaceName(
- (pkg.exports && walk(pkg.exports)) ||
+ (pkg.exports && walk(pkg.exports, pkg.type === 'module')) ||
(pkg.syntax && pkg.syntax.esmodules) ||
pkg.esmodule ||
'x.modern.js',
From 76272fdf039d4db6a5c90ba76cb11cf561062e27 Mon Sep 17 00:00:00 2001
From: Ryan Christian <33403762+rschristian@users.noreply.github.com>
Date: Wed, 6 Oct 2021 09:05:51 -0500
Subject: [PATCH 04/50] docs: Adding comment about file inclusion in TS section
(#888)
---
README.md | 2 ++
1 file changed, 2 insertions(+)
diff --git a/README.md b/README.md
index b1712fa2..445824a1 100644
--- a/README.md
+++ b/README.md
@@ -223,6 +223,8 @@ Just point the input to a `.ts` file through either the cli or the `source` key
Microbundle will generally respect your TypeScript config defined in a `tsconfig.json` file with notable exceptions being the "[target](https://www.typescriptlang.org/tsconfig#target)" and "[module](https://www.typescriptlang.org/tsconfig#module)" settings. To ensure your TypeScript configuration matches the configuration that Microbundle uses internally it's strongly recommended that you set `"module": "ESNext"` and `"target": "ESNext"` in your `tsconfig.json`.
+To ensure Microbundle does not process extraneous files, by default it only includes your entry point. If you want to include other files for compilation, such as ambient declarations, make sure to add either "[files](https://www.typescriptlang.org/tsconfig#files)" or "[include](https://www.typescriptlang.org/tsconfig#include)" into your `tsconfig.json`.
+
If you're using TypeScript with CSS Modules, you will want to set `"include": ["node_modules/microbundle/index.d.ts"]` in your `tsconfig.json` to tell TypeScript how to handle your CSS Module imports.
### CSS and CSS Modules
From 29803364fe54cc1a7a8543d61e694c90b4cdce6a Mon Sep 17 00:00:00 2001
From: Ryan Christian <33403762+rschristian@users.noreply.github.com>
Date: Wed, 6 Oct 2021 09:07:28 -0500
Subject: [PATCH 05/50] feat: Expands generateTypes flag to support TS entries
(#865)
* feat: Expands generateTypes flag to support TS entries
* fix: Returning previous .d.ts generation
* test: Modifying `--generateTypes false` test for use on TS projects
* docs: Adding changeset
---
.changeset/slimy-roses-explain.md | 5 +++++
src/index.js | 6 ++++--
test/__snapshots__/index.test.js.snap | 3 ++-
test/fixtures/ts-custom-declaration/package.json | 2 +-
.../ts-custom-declaration/src/{index.js => index.ts} | 0
5 files changed, 12 insertions(+), 4 deletions(-)
create mode 100644 .changeset/slimy-roses-explain.md
rename test/fixtures/ts-custom-declaration/src/{index.js => index.ts} (100%)
diff --git a/.changeset/slimy-roses-explain.md b/.changeset/slimy-roses-explain.md
new file mode 100644
index 00000000..0a4c75ae
--- /dev/null
+++ b/.changeset/slimy-roses-explain.md
@@ -0,0 +1,5 @@
+---
+'microbundle': patch
+---
+
+Expands generateTypes flag to support libs with TS entrypoints
diff --git a/src/index.js b/src/index.js
index 7ad55a0f..27619981 100644
--- a/src/index.js
+++ b/src/index.js
@@ -524,10 +524,12 @@ function createConfig(options, entry, format, writeMeta) {
tsconfigDefaults: {
compilerOptions: {
sourceMap: options.sourcemap,
- declaration: true,
+ declaration: options.generateTypes !== false,
allowJs: true,
emitDeclarationOnly: options.generateTypes && !useTypescript,
- declarationDir: getDeclarationDir({ options, pkg }),
+ ...(options.generateTypes !== false && {
+ declarationDir: getDeclarationDir({ options, pkg }),
+ }),
jsx: 'preserve',
jsxFactory:
// TypeScript fails to resolve Fragments when jsxFactory
diff --git a/test/__snapshots__/index.test.js.snap b/test/__snapshots__/index.test.js.snap
index a2a9d88b..6f4aacb9 100644
--- a/test/__snapshots__/index.test.js.snap
+++ b/test/__snapshots__/index.test.js.snap
@@ -2730,9 +2730,10 @@ ts-custom-declaration
index.js.map
index.umd.js
index.umd.js.map
+ node_modules
package.json
src
- index.js
+ index.ts
tsconfig.json
types
index.d.ts
diff --git a/test/fixtures/ts-custom-declaration/package.json b/test/fixtures/ts-custom-declaration/package.json
index 2fd7573b..00a923ee 100644
--- a/test/fixtures/ts-custom-declaration/package.json
+++ b/test/fixtures/ts-custom-declaration/package.json
@@ -2,7 +2,7 @@
"name": "ts-custom-declarations",
"main": "dist/index.js",
"types": "types/index.d.ts",
- "source": "src/index.js",
+ "source": "src/index.ts",
"scripts": {
"build": "microbundle --generateTypes false"
}
diff --git a/test/fixtures/ts-custom-declaration/src/index.js b/test/fixtures/ts-custom-declaration/src/index.ts
similarity index 100%
rename from test/fixtures/ts-custom-declaration/src/index.js
rename to test/fixtures/ts-custom-declaration/src/index.ts
From 96b85da1e32b4ffbef9d83387ff399d8b3ee3852 Mon Sep 17 00:00:00 2001
From: Jason Miller
Date: Wed, 6 Oct 2021 10:11:06 -0400
Subject: [PATCH 06/50] Resolve using "node" export condition for --target node
(#887)
* Resolve using "node" export condition for --target node
When bundling for a Node.js target, Microbundle should follow the "node" conditional package export key to match Node's own resolution. Fixes #886.
* lint
* Create fuzzy-trains-switch.md
* Update index.js
---
.changeset/fuzzy-trains-switch.md | 5 +++++
src/index.js | 1 +
2 files changed, 6 insertions(+)
create mode 100644 .changeset/fuzzy-trains-switch.md
diff --git a/.changeset/fuzzy-trains-switch.md b/.changeset/fuzzy-trains-switch.md
new file mode 100644
index 00000000..025c0a85
--- /dev/null
+++ b/.changeset/fuzzy-trains-switch.md
@@ -0,0 +1,5 @@
+---
+"microbundle": patch
+---
+
+When using `--target node`, resolve "node" conditional Package Export keys, otherwise resolve "browser" keys.
diff --git a/src/index.js b/src/index.js
index 27619981..3e1a0a32 100644
--- a/src/index.js
+++ b/src/index.js
@@ -493,6 +493,7 @@ function createConfig(options, entry, format, writeMeta) {
nodeResolve({
mainFields: ['module', 'jsnext', 'main'],
browser: options.target !== 'node',
+ exportConditions: [options.target === 'node' ? 'node' : 'browser'],
// defaults + .jsx
extensions: ['.mjs', '.js', '.jsx', '.json', '.node'],
preferBuiltins: options.target === 'node',
From d94bd975f433d5d98d805a298d376d98abc7aba3 Mon Sep 17 00:00:00 2001
From: Preact Bot <71229973+preact-bot@users.noreply.github.com>
Date: Wed, 6 Oct 2021 10:19:18 -0400
Subject: [PATCH 07/50] Version Packages (#859)
Co-authored-by: github-actions[bot]
---
.changeset/curly-eels-watch.md | 5 -----
.changeset/eight-toes-pump.md | 5 -----
.changeset/fuzzy-trains-switch.md | 5 -----
.changeset/gold-cherries-deliver.md | 5 -----
.changeset/rude-books-judge.md | 5 -----
.changeset/slimy-roses-explain.md | 5 -----
CHANGELOG.md | 18 ++++++++++++++++++
package.json | 2 +-
8 files changed, 19 insertions(+), 31 deletions(-)
delete mode 100644 .changeset/curly-eels-watch.md
delete mode 100644 .changeset/eight-toes-pump.md
delete mode 100644 .changeset/fuzzy-trains-switch.md
delete mode 100644 .changeset/gold-cherries-deliver.md
delete mode 100644 .changeset/rude-books-judge.md
delete mode 100644 .changeset/slimy-roses-explain.md
diff --git a/.changeset/curly-eels-watch.md b/.changeset/curly-eels-watch.md
deleted file mode 100644
index 1ae292be..00000000
--- a/.changeset/curly-eels-watch.md
+++ /dev/null
@@ -1,5 +0,0 @@
----
-'microbundle': minor
----
-
-- Add support for Module Workers with a new `--workers` flag
diff --git a/.changeset/eight-toes-pump.md b/.changeset/eight-toes-pump.md
deleted file mode 100644
index bd89f985..00000000
--- a/.changeset/eight-toes-pump.md
+++ /dev/null
@@ -1,5 +0,0 @@
----
-"microbundle": patch
----
-
-Fix crash when traversing `"exports"` objects (#852)
diff --git a/.changeset/fuzzy-trains-switch.md b/.changeset/fuzzy-trains-switch.md
deleted file mode 100644
index 025c0a85..00000000
--- a/.changeset/fuzzy-trains-switch.md
+++ /dev/null
@@ -1,5 +0,0 @@
----
-"microbundle": patch
----
-
-When using `--target node`, resolve "node" conditional Package Export keys, otherwise resolve "browser" keys.
diff --git a/.changeset/gold-cherries-deliver.md b/.changeset/gold-cherries-deliver.md
deleted file mode 100644
index 5f862dce..00000000
--- a/.changeset/gold-cherries-deliver.md
+++ /dev/null
@@ -1,5 +0,0 @@
----
-'microbundle': patch
----
-
-Preserve terser annotations in compressed bundle
diff --git a/.changeset/rude-books-judge.md b/.changeset/rude-books-judge.md
deleted file mode 100644
index 1737bcfb..00000000
--- a/.changeset/rude-books-judge.md
+++ /dev/null
@@ -1,5 +0,0 @@
----
-'microbundle': patch
----
-
-- Allow the minify options `compress` and `mangle` to be set as booleans
diff --git a/.changeset/slimy-roses-explain.md b/.changeset/slimy-roses-explain.md
deleted file mode 100644
index 0a4c75ae..00000000
--- a/.changeset/slimy-roses-explain.md
+++ /dev/null
@@ -1,5 +0,0 @@
----
-'microbundle': patch
----
-
-Expands generateTypes flag to support libs with TS entrypoints
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 69706399..4d1af3ef 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,23 @@
# microbundle
+## 0.14.0
+
+### Minor Changes
+
+- [`1b61029`](https://github.com/developit/microbundle/commit/1b6102966440bd7000e0e457f8c0b7eeb7e05593) [#867](https://github.com/developit/microbundle/pull/867) Thanks [@bouchenoiremarc](https://github.com/bouchenoiremarc)! - - Add support for Module Workers with a new `--workers` flag
+
+### Patch Changes
+
+- [`5e93a0e`](https://github.com/developit/microbundle/commit/5e93a0e4cc28ea8f080a08e3a8530b6bfdf25f42) [#853](https://github.com/developit/microbundle/pull/853) Thanks [@developit](https://github.com/developit)! - Fix crash when traversing `"exports"` objects (#852)
+
+* [`96b85da`](https://github.com/developit/microbundle/commit/96b85da1e32b4ffbef9d83387ff399d8b3ee3852) [#887](https://github.com/developit/microbundle/pull/887) Thanks [@developit](https://github.com/developit)! - When using `--target node`, resolve "node" conditional Package Export keys, otherwise resolve "browser" keys.
+
+- [`5d0465b`](https://github.com/developit/microbundle/commit/5d0465b39bccff31673d351fc9d29cb4c470407d) [#875](https://github.com/developit/microbundle/pull/875) Thanks [@dwightjack](https://github.com/dwightjack)! - Preserve terser annotations in compressed bundle
+
+* [`b1a6374`](https://github.com/developit/microbundle/commit/b1a637486234a2ae784ccf0c512321e2d3efef7c) [#858](https://github.com/developit/microbundle/pull/858) Thanks [@bouchenoiremarc](https://github.com/bouchenoiremarc)! - - Allow the minify options `compress` and `mangle` to be set as booleans
+
+- [`2980336`](https://github.com/developit/microbundle/commit/29803364fe54cc1a7a8543d61e694c90b4cdce6a) [#865](https://github.com/developit/microbundle/pull/865) Thanks [@rschristian](https://github.com/rschristian)! - Expands generateTypes flag to support libs with TS entrypoints
+
## 0.13.3
### Patch Changes
diff --git a/package.json b/package.json
index a335cd82..d21061dd 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "microbundle",
- "version": "0.13.3",
+ "version": "0.14.0",
"description": "Zero-configuration bundler for tiny JS libs, powered by Rollup.",
"main": "dist/microbundle.js",
"source": "src/index.js",
From 26f382a989e86fdcc5149f73f7b6c9d314a4bf37 Mon Sep 17 00:00:00 2001
From: Ryan Christian <33403762+rschristian@users.noreply.github.com>
Date: Mon, 11 Oct 2021 14:39:44 -0500
Subject: [PATCH 08/50] fix: Corrects completion message to show the package's
name, rather than the safe name (#895)
---
.changeset/thirty-bats-help.md | 5 ++
src/index.js | 4 +-
test/__snapshots__/index.test.js.snap | 104 +++++++++++++-------------
3 files changed, 59 insertions(+), 54 deletions(-)
create mode 100644 .changeset/thirty-bats-help.md
diff --git a/.changeset/thirty-bats-help.md b/.changeset/thirty-bats-help.md
new file mode 100644
index 00000000..abf25e8d
--- /dev/null
+++ b/.changeset/thirty-bats-help.md
@@ -0,0 +1,5 @@
+---
+'microbundle': patch
+---
+
+Completion message shows pkg's actual name, rather than safe name
diff --git a/src/index.js b/src/index.js
index 3e1a0a32..719bfcf9 100644
--- a/src/index.js
+++ b/src/index.js
@@ -133,8 +133,8 @@ export default async function microbundle(inputOptions) {
const targetDir = relative(cwd, dirname(options.output)) || '.';
const sourceExist = options.input.length > 0;
const banner = sourceExist
- ? blue(`Build "${options.name}" to ${targetDir}:`)
- : red(`Error: No entry module found for "${options.name}"`);
+ ? blue(`Build "${options.pkg.name}" to ${targetDir}:`)
+ : red(`Error: No entry module found for "${options.pkg.name}"`);
return {
output: `${banner}\n ${out.join('\n ')}`,
};
diff --git a/test/__snapshots__/index.test.js.snap b/test/__snapshots__/index.test.js.snap
index 6f4aacb9..566631f0 100644
--- a/test/__snapshots__/index.test.js.snap
+++ b/test/__snapshots__/index.test.js.snap
@@ -17,7 +17,7 @@ alias
index.js
-Build \\"aliasMapping\\" to dist:
+Build \\"alias-mapping\\" to dist:
62 B: alias-mapping.js.gz
46 B: alias-mapping.js.br
62 B: alias-mapping.esm.js.gz
@@ -62,7 +62,7 @@ alias-external
index.js
-Build \\"aliasExternal\\" to dist:
+Build \\"alias-external\\" to dist:
37 B: alias-external.js.gz
21 B: alias-external.js.br
37 B: alias-external.esm.js.gz
@@ -112,7 +112,7 @@ async-iife-ts
tsconfig.json
-Build \\"asyncIifeTs\\" to dist:
+Build \\"async-iife-ts\\" to dist:
70 B: async-iife-ts.js.gz
55 B: async-iife-ts.js.br
70 B: async-iife-ts.esm.js.gz
@@ -164,7 +164,7 @@ async-ts
tsconfig.json
-Build \\"asyncTs\\" to dist:
+Build \\"async-ts\\" to dist:
117 B: async-ts.js.gz
91 B: async-ts.js.br
128 B: async-ts.esm.js.gz
@@ -219,7 +219,7 @@ basic
two.js
-Build \\"basicLib\\" to dist:
+Build \\"basic-lib\\" to dist:
187 B: basic-lib.js.gz
138 B: basic-lib.js.br
188 B: basic-lib.esm.js.gz
@@ -266,7 +266,7 @@ basic-babelrc
index.js
-Build \\"basicBabelrc\\" to dist:
+Build \\"basic-babelrc\\" to dist:
122 B: basic-babelrc.js.gz
91 B: basic-babelrc.js.br
122 B: basic-babelrc.esm.js.gz
@@ -314,7 +314,7 @@ basic-compress-false
two.js
-Build \\"basicCompressFalse\\" to dist:
+Build \\"basic-compress-false\\" to dist:
260 B: basic-compress-false.js.gz
206 B: basic-compress-false.js.br
258 B: basic-compress-false.esm.js.gz
@@ -446,7 +446,7 @@ basic-css
two.css
-Build \\"basicCss\\" to dist:
+Build \\"basic-css\\" to dist:
107 B: basic-css.js.gz
60 B: basic-css.js.br
109 B: basic-css.esm.js.gz
@@ -499,7 +499,7 @@ basic-dashed-external
two.js
-Build \\"basicDashedExternal\\" to dist:
+Build \\"basic-dashed-external\\" to dist:
276 B: basic-dashed-external.js.gz
212 B: basic-dashed-external.js.br
214 B: basic-dashed-external.esm.js.gz
@@ -547,7 +547,7 @@ basic-flow
index.js
-Build \\"basicLibFlow\\" to dist:
+Build \\"basic-lib-flow\\" to dist:
57 B: basic-lib-flow.js.gz
43 B: basic-lib-flow.js.br
56 B: basic-lib-flow.esm.js.gz
@@ -595,7 +595,7 @@ basic-json
two.json
-Build \\"basicJson\\" to dist:
+Build \\"basic-json\\" to dist:
93 B: basic-json.js.gz
65 B: basic-json.js.br
92 B: basic-json.esm.js.gz
@@ -648,7 +648,7 @@ basic-multi-source
package.json
-Build \\"basicMultiSource\\" to dist:
+Build \\"basic-multi-source\\" to dist:
43 B: a.js.gz
27 B: a.js.br
43 B: a.esm.js.gz
@@ -720,7 +720,7 @@ basic-no-compress
two.js
-Build \\"basicNoCompress\\" to dist:
+Build \\"basic-no-compress\\" to dist:
260 B: basic-no-compress.js.gz
206 B: basic-no-compress.js.br
258 B: basic-no-compress.esm.js.gz
@@ -846,7 +846,7 @@ basic-no-pkg-main
two.js
-Build \\"basicNoPkgMain\\" to dist:
+Build \\"basic-no-pkg-main\\" to dist:
187 B: basic-no-pkg-main.js.gz
138 B: basic-no-pkg-main.js.br
188 B: basic-no-pkg-main.js.gz
@@ -877,7 +877,7 @@ basic-node-internals
index.js
-Build \\"basicNodeInternals\\" to dist:
+Build \\"basic-node-internals\\" to dist:
191 B: basic-node-internals.js.gz
149 B: basic-node-internals.js.br"
`;
@@ -927,7 +927,7 @@ basic-ts
tsconfig.json
-Build \\"basicLibTs\\" to dist:
+Build \\"basic-lib-ts\\" to dist:
118 B: basic-lib-ts.js.gz
94 B: basic-lib-ts.js.br
118 B: basic-lib-ts.esm.js.gz
@@ -994,7 +994,7 @@ basic-tsx
tsconfig.json
-Build \\"basicLibTsx\\" to dist:
+Build \\"basic-lib-tsx\\" to dist:
213 B: basic-lib-tsx.js.gz
164 B: basic-lib-tsx.js.br
218 B: basic-lib-tsx.esm.js.gz
@@ -1100,7 +1100,7 @@ class-decorators-ts
tsconfig.json
-Build \\"classDecoratorsTs\\" to dist:
+Build \\"class-decorators-ts\\" to dist:
348 B: class-decorators-ts.js.gz
288 B: class-decorators-ts.js.br
348 B: class-decorators-ts.esm.js.gz
@@ -1158,7 +1158,7 @@ class-properties
index.js
-Build \\"classProperties\\" to dist:
+Build \\"class-properties\\" to dist:
93 B: class-properties.js.gz
79 B: class-properties.js.br
96 B: class-properties.esm.js.gz
@@ -1205,7 +1205,7 @@ css-modules--false
not_scoped.module.css
-Build \\"cssModulesFalse\\" to dist:
+Build \\"css-modules--false\\" to dist:
49 B: css-modules--false.js.gz
23 B: css-modules--false.js.br
52 B: css-modules--false.esm.js.gz
@@ -1251,7 +1251,7 @@ css-modules--null
scoped.module.css
-Build \\"cssModulesNull\\" to dist:
+Build \\"css-modules--null\\" to dist:
110 B: css-modules--null.js.gz
72 B: css-modules--null.js.br
112 B: css-modules--null.esm.js.gz
@@ -1297,7 +1297,7 @@ css-modules--string
scoped.module.css
-Build \\"cssModulesString\\" to dist:
+Build \\"css-modules--string\\" to dist:
166 B: css-modules--string.js.gz
118 B: css-modules--string.js.br
168 B: css-modules--string.esm.js.gz
@@ -1343,7 +1343,7 @@ css-modules--true
scoped.module.css
-Build \\"cssModulesTrue\\" to dist:
+Build \\"css-modules--true\\" to dist:
139 B: css-modules--true.js.gz
94 B: css-modules--true.js.br
141 B: css-modules--true.esm.js.gz
@@ -1389,7 +1389,7 @@ custom-babelrc
index.js
-Build \\"customBabelrc\\" to dist:
+Build \\"custom-babelrc\\" to dist:
218 B: custom-babelrc.js.gz
193 B: custom-babelrc.js.br
222 B: custom-babelrc.esm.js.gz
@@ -1437,7 +1437,7 @@ custom-source
two.js
-Build \\"customSource\\" to dist:
+Build \\"custom-source\\" to dist:
187 B: custom-source.js.gz
138 B: custom-source.js.br
188 B: custom-source.esm.js.gz
@@ -1485,7 +1485,7 @@ custom-source
two.js
-Build \\"customSrc\\" to dist:
+Build \\"custom-src\\" to dist:
187 B: custom-src.js.gz
138 B: custom-src.js.br
188 B: custom-src.esm.js.gz
@@ -1532,7 +1532,7 @@ default-named
index.js
-Build \\"defaultNamed\\" to dist:
+Build \\"default-named\\" to dist:
60 B: default-named.js.gz
46 B: default-named.js.br
74 B: default-named.esm.js.gz
@@ -1613,7 +1613,7 @@ define-expression
package.json
-Build \\"defineExpression\\" to dist:
+Build \\"define-expression\\" to dist:
56 B: define-expression.esm.js.gz
40 B: define-expression.esm.js.br"
`;
@@ -1646,7 +1646,7 @@ esnext-ts
tsconfig.json
-Build \\"esnextTs\\" to dist:
+Build \\"esnext-ts\\" to dist:
1007 B: esnext-ts.js.gz
898 B: esnext-ts.js.br
1008 B: esnext-ts.esm.js.gz
@@ -1696,7 +1696,7 @@ inline-source-map
two.js
-Build \\"inlineSourceMap\\" to dist:
+Build \\"inline-source-map\\" to dist:
187 B: inline-source-map.js.gz
138 B: inline-source-map.js.br
188 B: inline-source-map.esm.js.gz
@@ -1791,7 +1791,7 @@ macro
macro.js
-Build \\"macroLib\\" to dist:
+Build \\"macro-lib\\" to dist:
49 B: macro-lib.js.gz
33 B: macro-lib.js.br
48 B: macro-lib.esm.js.gz
@@ -1840,7 +1840,7 @@ mangle-json-file
two.js
-Build \\"mangleJsonFile\\" to dist:
+Build \\"mangle-json-file\\" to dist:
103 B: mangle-json-file.js.gz
89 B: mangle-json-file.js.br
105 B: mangle-json-file.esm.js.gz
@@ -1888,7 +1888,7 @@ minify-config
two.js
-Build \\"minifyConfig\\" to dist:
+Build \\"minify-config\\" to dist:
99 B: minify-config.js.gz
85 B: minify-config.js.br
101 B: minify-config.esm.js.gz
@@ -1936,7 +1936,7 @@ minify-config-boolean
two.js
-Build \\"minifyConfigBoolean\\" to dist:
+Build \\"minify-config-boolean\\" to dist:
107 B: minify-config-boolean.js.gz
84 B: minify-config-boolean.js.br
114 B: minify-config-boolean.esm.js.gz
@@ -1985,7 +1985,7 @@ minify-path-config
two.js
-Build \\"minifyPathConfig\\" to dist:
+Build \\"minify-path-config\\" to dist:
103 B: minify-path-config.js.gz
89 B: minify-path-config.js.br
105 B: minify-path-config.esm.js.gz
@@ -2032,7 +2032,7 @@ minify-path-parent-dir
two.js
-Build \\"minifyPathParentDir\\" to dist:
+Build \\"minify-path-parent-dir\\" to dist:
103 B: minify-path-parent-dir.js.gz
89 B: minify-path-parent-dir.js.br
105 B: minify-path-parent-dir.esm.js.gz
@@ -2076,7 +2076,7 @@ modern
two.js
-Build \\"modernLib\\" to dist:
+Build \\"modern-lib\\" to dist:
113 B: modern-lib.modern.js.gz
92 B: modern-lib.modern.js.br"
`;
@@ -2110,7 +2110,7 @@ modern-generators
two.js
-Build \\"modernGenerators\\" to dist:
+Build \\"modern-generators\\" to dist:
248 B: modern-generators.js.gz
201 B: modern-generators.js.br
118 B: modern-generators.modern.js.gz
@@ -2166,7 +2166,7 @@ name-custom-amd
two.js
-Build \\"customNameAmd\\" to dist:
+Build \\"name-custom-amd\\" to dist:
187 B: name-custom-amd.js.gz
138 B: name-custom-amd.js.br
188 B: name-custom-amd.esm.js.gz
@@ -2214,7 +2214,7 @@ name-custom-cli
two.js
-Build \\"nameCustomCli\\" to dist:
+Build \\"name-custom\\" to dist:
187 B: name-custom.js.gz
138 B: name-custom.js.br
188 B: name-custom.esm.js.gz
@@ -2261,7 +2261,7 @@ no-pkg
two.js
-Build \\"noPkg\\" to dist:
+Build \\"no-pkg\\" to dist:
187 B: no-pkg.js.gz
138 B: no-pkg.js.br
188 B: no-pkg.esm.js.gz
@@ -2309,7 +2309,7 @@ no-pkg-name
two.js
-Build \\"noPkgName\\" to dist:
+Build \\"no-pkg-name\\" to dist:
187 B: no-pkg-name.js.gz
138 B: no-pkg-name.js.br
188 B: no-pkg-name.esm.js.gz
@@ -2359,7 +2359,7 @@ optional-chaining-ts
tsconfig.json
-Build \\"optionalChainingTs\\" to dist:
+Build \\"optional-chaining-ts\\" to dist:
109 B: optional-chaining-ts.js.gz
88 B: optional-chaining-ts.js.br
111 B: optional-chaining-ts.esm.js.gz
@@ -2415,7 +2415,7 @@ parameters-rest-closure
index.js
-Build \\"parametersRestClosure\\" to dist:
+Build \\"parameters-rest-closure\\" to dist:
157 B: parameters-rest-closure.js.gz
115 B: parameters-rest-closure.js.br
165 B: parameters-rest-closure.esm.js.gz
@@ -2507,7 +2507,7 @@ publish-config
foo.ts
-Build \\"publishConfig\\" to dist:
+Build \\"publish-config\\" to dist:
55 B: bar.js.gz
33 B: bar.js.br"
`;
@@ -2688,7 +2688,7 @@ terser-annotations
index.js
-Build \\"terserAnnotations\\" to dist:
+Build \\"terser-annotations\\" to dist:
133 B: terser-annotations.js.gz
104 B: terser-annotations.js.br
138 B: terser-annotations.esm.js.gz
@@ -2739,7 +2739,7 @@ ts-custom-declaration
index.d.ts
-Build \\"tsCustomDeclarations\\" to dist:
+Build \\"ts-custom-declarations\\" to dist:
55 B: index.js.gz
33 B: index.js.br
61 B: index.esm.js.gz
@@ -2797,7 +2797,7 @@ ts-declaration
index.d.ts
-Build \\"tsDeclarations\\" to dist:
+Build \\"ts-declarations\\" to dist:
55 B: index.js.gz
33 B: index.js.br
61 B: index.esm.js.gz
@@ -2854,7 +2854,7 @@ ts-jsx
tsconfig.json
-Build \\"tsJsx\\" to dist:
+Build \\"ts-jsx\\" to dist:
130 B: ts-jsx.js.gz
94 B: ts-jsx.js.br
131 B: ts-jsx.esm.js.gz
@@ -2911,7 +2911,7 @@ ts-mixed-exports
tsconfig.json
-Build \\"tsMixedExports\\" to dist:
+Build \\"ts-mixed-exports\\" to dist:
130 B: ts-mixed-exports.js.gz
104 B: ts-mixed-exports.js.br
134 B: ts-mixed-exports.esm.js.gz
@@ -2981,7 +2981,7 @@ ts-module
tsconfig.json
-Build \\"tsModule\\" to dist:
+Build \\"ts-module\\" to dist:
59 B: ts-module.js.gz
42 B: ts-module.js.br
65 B: ts-module.esm.js.gz
@@ -3043,7 +3043,7 @@ worker-loader
worker.js
-Build \\"workerLoader\\" to dist:
+Build \\"worker-loader\\" to dist:
140 B: worker-loader.modern.js.gz
112 B: worker-loader.modern.js.br
63 B: worker-7e1b9921.js.gz
From 2a0ca8843f34c3773bb41eb3f8f571fb6b2b2d52 Mon Sep 17 00:00:00 2001
From: Mihir Kumar
Date: Thu, 14 Oct 2021 20:57:44 +0530
Subject: [PATCH 09/50] feat: :sparkles: Closes #497: preserve trailing newline
in mangle.json (#882)
Co-authored-by: Leah
---
.changeset/quick-wasps-itch.md | 5 +++++
src/index.js | 13 +++++++++++--
2 files changed, 16 insertions(+), 2 deletions(-)
create mode 100644 .changeset/quick-wasps-itch.md
diff --git a/.changeset/quick-wasps-itch.md b/.changeset/quick-wasps-itch.md
new file mode 100644
index 00000000..ab3079c0
--- /dev/null
+++ b/.changeset/quick-wasps-itch.md
@@ -0,0 +1,5 @@
+---
+"microbundle": patch
+---
+
+feat: :sparkles: Closes #497: preserve trailing newline in mangle.json
diff --git a/src/index.js b/src/index.js
index 719bfcf9..b83c007f 100644
--- a/src/index.js
+++ b/src/index.js
@@ -30,6 +30,7 @@ import {
} from './lib/option-normalization';
import { getConfigFromPkgJson, getName } from './lib/package-info';
import { shouldCssModules, cssModulesConfig } from './lib/css-modules';
+import { EOL } from 'os';
// Extensions to use when resolving modules
const EXTENSIONS = ['.ts', '.tsx', '.js', '.jsx', '.es6', '.es', '.mjs'];
@@ -403,9 +404,13 @@ function createConfig(options, entry, format, writeMeta) {
const externalTest =
external.length === 0 ? id => false : id => externalPredicate.test(id);
+ let endsWithNewLine = false;
+
function loadNameCache() {
try {
- nameCache = JSON.parse(fs.readFileSync(getNameCachePath(), 'utf8'));
+ const data = fs.readFileSync(getNameCachePath(), 'utf8');
+ endsWithNewLine = data.endsWith(EOL);
+ nameCache = JSON.parse(data);
// mangle.json can contain a "minify" field, same format as the pkg.mangle:
if (nameCache.minify) {
minifyOptions = Object.assign(
@@ -618,7 +623,11 @@ function createConfig(options, entry, format, writeMeta) {
if (writeMeta && nameCache) {
fs.writeFile(
getNameCachePath(),
- JSON.stringify(nameCache, null, 2),
+ JSON.stringify(
+ endsWithNewLine ? `${nameCache}${EOL}` : nameCache,
+ null,
+ 2,
+ ),
() => {},
);
}
From c04bd48cd2e6ef08a7a84720096a22dced317b7b Mon Sep 17 00:00:00 2001
From: Preact Bot <71229973+preact-bot@users.noreply.github.com>
Date: Thu, 14 Oct 2021 11:52:07 -0400
Subject: [PATCH 10/50] Version Packages (#900)
Co-authored-by: github-actions[bot]
---
.changeset/quick-wasps-itch.md | 5 -----
.changeset/thirty-bats-help.md | 5 -----
CHANGELOG.md | 8 ++++++++
package.json | 2 +-
4 files changed, 9 insertions(+), 11 deletions(-)
delete mode 100644 .changeset/quick-wasps-itch.md
delete mode 100644 .changeset/thirty-bats-help.md
diff --git a/.changeset/quick-wasps-itch.md b/.changeset/quick-wasps-itch.md
deleted file mode 100644
index ab3079c0..00000000
--- a/.changeset/quick-wasps-itch.md
+++ /dev/null
@@ -1,5 +0,0 @@
----
-"microbundle": patch
----
-
-feat: :sparkles: Closes #497: preserve trailing newline in mangle.json
diff --git a/.changeset/thirty-bats-help.md b/.changeset/thirty-bats-help.md
deleted file mode 100644
index abf25e8d..00000000
--- a/.changeset/thirty-bats-help.md
+++ /dev/null
@@ -1,5 +0,0 @@
----
-'microbundle': patch
----
-
-Completion message shows pkg's actual name, rather than safe name
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 4d1af3ef..b07ca964 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,13 @@
# microbundle
+## 0.14.1
+
+### Patch Changes
+
+- [`2a0ca88`](https://github.com/developit/microbundle/commit/2a0ca8843f34c3773bb41eb3f8f571fb6b2b2d52) [#882](https://github.com/developit/microbundle/pull/882) Thanks [@MiKr13](https://github.com/MiKr13)! - feat: :sparkles: Closes #497: preserve trailing newline in mangle.json
+
+* [`26f382a`](https://github.com/developit/microbundle/commit/26f382a989e86fdcc5149f73f7b6c9d314a4bf37) [#895](https://github.com/developit/microbundle/pull/895) Thanks [@rschristian](https://github.com/rschristian)! - Completion message shows pkg's actual name, rather than safe name
+
## 0.14.0
### Minor Changes
diff --git a/package.json b/package.json
index d21061dd..fa849d90 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "microbundle",
- "version": "0.14.0",
+ "version": "0.14.1",
"description": "Zero-configuration bundler for tiny JS libs, powered by Rollup.",
"main": "dist/microbundle.js",
"source": "src/index.js",
From afa74ca46b455c7cb76ac7e6c656b1f32012d2cd Mon Sep 17 00:00:00 2001
From: Jason Miller
Date: Thu, 21 Oct 2021 12:06:48 -0400
Subject: [PATCH 11/50] [docs] Fix incorrect package exports recommendation
(#903)
Fixes #902.
---
README.md | 19 +++++++++++--------
1 file changed, 11 insertions(+), 8 deletions(-)
diff --git a/README.md b/README.md
index 445824a1..fc8e9112 100644
--- a/README.md
+++ b/README.md
@@ -38,16 +38,19 @@
```jsonc
{
- "name": "foo", // your package name
+ "name": "foo", // your package name
"type": "module",
- "source": "src/foo.js", // your source code
- "exports": "./dist/foo.modern.js", // where to generate the modern bundle (see below)
- "main": "./dist/foo.cjs", // where to generate the CommonJS 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")
+ "source": "src/foo.js", // your source code
+ "exports": {
+ "require": "./dist/foo.cjs", // used for require() in Node 12+
+ "default": "./dist/foo.modern.js" // where to generate the modern bundle (see below)
+ },
+ "main": "./dist/foo.cjs", // where to generate the CommonJS 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
+ "build": "microbundle", // compiles "source" to "main"/"module"/"unpkg"
+ "dev": "microbundle watch" // re-build when source files change
}
}
```
From dd0bdde9c6ae7d0690fa73aead1c1744ae3b086a Mon Sep 17 00:00:00 2001
From: Ryan Christian <33403762+rschristian@users.noreply.github.com>
Date: Wed, 17 Nov 2021 11:38:19 -0600
Subject: [PATCH 12/50] fix: Ensuring CLI & docs match up with each other
(#904)
---
.changeset/tame-horses-type.md | 5 +++++
README.md | 3 +--
src/prog.js | 37 +++++++++++++++++-----------------
3 files changed, 25 insertions(+), 20 deletions(-)
create mode 100644 .changeset/tame-horses-type.md
diff --git a/.changeset/tame-horses-type.md b/.changeset/tame-horses-type.md
new file mode 100644
index 00000000..620146de
--- /dev/null
+++ b/.changeset/tame-horses-type.md
@@ -0,0 +1,5 @@
+---
+'microbundle': patch
+---
+
+Added missing CLI doc for 'jsxImportSource' and correcting the Examples section of the '--help' output
diff --git a/README.md b/README.md
index fc8e9112..55731506 100644
--- a/README.md
+++ b/README.md
@@ -329,14 +329,13 @@ Options
--define Replace constants with hard-coded values (use @key=exp to replace an expression)
--alias Map imports to different modules
--compress Compress output using Terser
- --no-compress Disable output compressing
--strict Enforce undefined global context and add "use strict"
--name Specify name exposed in UMD and IIFE builds
--cwd Use an alternative working directory (default .)
--sourcemap Generate source map (default true)
--raw Show raw byte size (default false)
--jsx A custom JSX pragma like React.createElement (default: h)
- --jsxImportSource Specify the automatic import source for JSX like preact
+ --jsxImportSource Declares the module specifier to be used for importing jsx factory functions
--tsconfig Specify the path to a custom tsconfig.json
--generateTypes Whether or not to generate types, if `types` or `typings` is set in `package.json` then it will default to be `true`
--css Where to output CSS: "inline" or "external" (default: "external")
diff --git a/src/prog.js b/src/prog.js
index e07a7d66..4f48a573 100644
--- a/src/prog.js
+++ b/src/prog.js
@@ -46,39 +46,40 @@ export default handler => {
.option('--target', 'Specify your target environment (node or web)', 'web')
.option('--external', `Specify external dependencies, or 'none'`)
.option('--globals', `Specify globals dependencies, or 'none'`)
- .example('microbundle --globals react=React,jquery=$')
+ .example('--globals react=React,jquery=$')
.option('--define', 'Replace constants with hard-coded values')
- .example('microbundle --define API_KEY=1234')
+ .example('--define API_KEY=1234')
.option('--alias', `Map imports to different modules`)
- .example('microbundle --alias react=preact')
+ .example('--alias react=preact')
.option('--compress', 'Compress output using Terser', null)
.option('--strict', 'Enforce undefined global context and add "use strict"')
.option('--name', 'Specify name exposed in UMD builds')
.option('--cwd', 'Use an alternative working directory', '.')
.option('--sourcemap', 'Generate source map')
- .option('--css', 'Where to output CSS: "inline" or "external"', 'external')
- .option(
- '--workers',
- 'Bundle module workers - see https://git.io/J3oSF',
- false,
- )
- .option(
- '--css-modules',
- 'Turns on css-modules for all .css imports. Passing a string will override the scopeName. eg --css-modules="_[hash]"',
- null,
- )
- .example("microbundle --no-sourcemap # don't generate sourcemaps")
+ .example("watch --no-sourcemap # don't generate sourcemaps")
.option('--raw', 'Show raw byte size', false)
+ .option('--jsx', 'A custom JSX pragma like React.createElement', 'h')
.option(
- '--jsx',
- 'A custom JSX pragma like React.createElement (default: h)',
+ '--jsxImportSource',
+ 'Declares the module specifier to be used for importing jsx factory functions',
)
.option('--tsconfig', 'Specify the path to a custom tsconfig.json')
+ .example('build --tsconfig tsconfig.build.json')
.option(
'--generateTypes',
'Whether or not to generate types , if `types` or `typings` is set in `package.json` then it will default to be `true`',
)
- .example('microbundle build --tsconfig tsconfig.build.json');
+ .option('--css', 'Where to output CSS: "inline" or "external"', 'external')
+ .option(
+ '--css-modules',
+ 'Turns on css-modules for all .css imports. Passing a string will override the scopeName. eg --css-modules="_[hash]"',
+ null,
+ )
+ .option(
+ '--workers',
+ 'Bundle module workers - see https://git.io/J3oSF',
+ false,
+ );
prog
.command('build [...entries]', '', { default: true })
From 75525a31dd015b6dafa355302fb27e3ef277c36b Mon Sep 17 00:00:00 2001
From: Aral Roca Gomez
Date: Wed, 17 Nov 2021 18:39:55 +0100
Subject: [PATCH 13/50] Add Teaful as "Built with Microbundle" in README (#910)
---
README.md | 2 ++
1 file changed, 2 insertions(+)
diff --git a/README.md b/README.md
index 55731506..f86d3fee 100644
--- a/README.md
+++ b/README.md
@@ -374,6 +374,8 @@ Here's what's coming up for Microbundle:
- [hooked-form](https://github.com/JoviDeCroock/hooked-form) A lightweight form-management library for React.
- [goober](https://github.com/cristianbote/goober) Less than 1KB css-in-js alternative with a familiar API.
- [react-model](https://github.com/byte-fe/react-model) The next generation state management library for React
+- [Teaful](https://github.com/teafuljs/teaful) Tiny, easy and powerful (P)React state management
+
## 🥂 License
From 778ca3ce3e75370ca0f4802b224891bda2417704 Mon Sep 17 00:00:00 2001
From: Preact Bot <71229973+preact-bot@users.noreply.github.com>
Date: Wed, 17 Nov 2021 19:20:28 -0500
Subject: [PATCH 14/50] Version Packages (#911)
Co-authored-by: github-actions[bot]
---
.changeset/tame-horses-type.md | 5 -----
CHANGELOG.md | 6 ++++++
package.json | 2 +-
3 files changed, 7 insertions(+), 6 deletions(-)
delete mode 100644 .changeset/tame-horses-type.md
diff --git a/.changeset/tame-horses-type.md b/.changeset/tame-horses-type.md
deleted file mode 100644
index 620146de..00000000
--- a/.changeset/tame-horses-type.md
+++ /dev/null
@@ -1,5 +0,0 @@
----
-'microbundle': patch
----
-
-Added missing CLI doc for 'jsxImportSource' and correcting the Examples section of the '--help' output
diff --git a/CHANGELOG.md b/CHANGELOG.md
index b07ca964..9b6d8660 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,11 @@
# microbundle
+## 0.14.2
+
+### Patch Changes
+
+- [`dd0bdde`](https://github.com/developit/microbundle/commit/dd0bdde9c6ae7d0690fa73aead1c1744ae3b086a) [#904](https://github.com/developit/microbundle/pull/904) Thanks [@rschristian](https://github.com/rschristian)! - Added missing CLI doc for 'jsxImportSource' and correcting the Examples section of the '--help' output
+
## 0.14.1
### Patch Changes
diff --git a/package.json b/package.json
index fa849d90..e2896487 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "microbundle",
- "version": "0.14.1",
+ "version": "0.14.2",
"description": "Zero-configuration bundler for tiny JS libs, powered by Rollup.",
"main": "dist/microbundle.js",
"source": "src/index.js",
From f04c85a1885a28a16c767665a1d5f17b13834406 Mon Sep 17 00:00:00 2001
From: Jason Miller
Date: Thu, 20 Jan 2022 15:59:17 -0500
Subject: [PATCH 15/50] Fix mangle.json being overwritten with [object Object]
(#926)
* Fix mangle.json being overwritten with [object Object]
Regression from #882.
* Create gorgeous-singers-invite.md
---
.changeset/gorgeous-singers-invite.md | 5 +++++
src/index.js | 13 ++++---------
2 files changed, 9 insertions(+), 9 deletions(-)
create mode 100644 .changeset/gorgeous-singers-invite.md
diff --git a/.changeset/gorgeous-singers-invite.md b/.changeset/gorgeous-singers-invite.md
new file mode 100644
index 00000000..1abd012c
--- /dev/null
+++ b/.changeset/gorgeous-singers-invite.md
@@ -0,0 +1,5 @@
+---
+"microbundle": patch
+---
+
+Fix mangle.json being overwritten with `[object Object]`
diff --git a/src/index.js b/src/index.js
index b83c007f..62a160da 100644
--- a/src/index.js
+++ b/src/index.js
@@ -621,15 +621,10 @@ function createConfig(options, entry, format, writeMeta) {
// after hook
writeBundle() {
if (writeMeta && nameCache) {
- fs.writeFile(
- getNameCachePath(),
- JSON.stringify(
- endsWithNewLine ? `${nameCache}${EOL}` : nameCache,
- null,
- 2,
- ),
- () => {},
- );
+ let filename = getNameCachePath();
+ let json = JSON.stringify(nameCache, null, 2);
+ if (endsWithNewLine) json += EOL;
+ fs.writeFile(filename, json, () => {});
}
},
},
From 392d63ef437f25403c03826f77790722d0234b58 Mon Sep 17 00:00:00 2001
From: Ryan Christian <33403762+rschristian@users.noreply.github.com>
Date: Thu, 3 Mar 2022 11:04:30 -0600
Subject: [PATCH 16/50] fix: Corrects CSS output being overwritten when .cjs
ext used (#919)
---
.changeset/light-trainers-obey.md | 5 +++++
src/index.js | 23 +++++++++++------------
src/utils.js | 2 ++
3 files changed, 18 insertions(+), 12 deletions(-)
create mode 100644 .changeset/light-trainers-obey.md
diff --git a/.changeset/light-trainers-obey.md b/.changeset/light-trainers-obey.md
new file mode 100644
index 00000000..1ad70f93
--- /dev/null
+++ b/.changeset/light-trainers-obey.md
@@ -0,0 +1,5 @@
+---
+'microbundle': patch
+---
+
+Fixes CSS output from being overwritten when also generating .cjs
diff --git a/src/index.js b/src/index.js
index 62a160da..f47a6dda 100644
--- a/src/index.js
+++ b/src/index.js
@@ -20,7 +20,14 @@ import typescript from 'rollup-plugin-typescript2';
import json from '@rollup/plugin-json';
import OMT from '@surma/rollup-plugin-off-main-thread';
import logError from './log-error';
-import { isDir, isFile, stdout, isTruthy, removeScope } from './utils';
+import {
+ EXTENSION,
+ isDir,
+ isFile,
+ isTruthy,
+ stdout,
+ removeScope,
+} from './utils';
import { getSizeInfo } from './lib/compressed-size';
import { normalizeMinifyOptions } from './lib/terser';
import {
@@ -279,17 +286,12 @@ function getMain({ options, entry, format }) {
let mainNoExtension = options.output;
if (options.multipleEntries) {
- let name = entry.match(
- /([\\/])index(\.(umd|cjs|es|m))?\.(mjs|cjs|[tj]sx?)$/,
- )
+ let name = entry.match(new RegExp(/([\\/])index/.source + EXTENSION.source))
? mainNoExtension
: entry;
mainNoExtension = resolve(dirname(mainNoExtension), basename(name));
}
- mainNoExtension = mainNoExtension.replace(
- /(\.(umd|cjs|es|m))?\.(mjs|cjs|[tj]sx?)$/,
- '',
- );
+ mainNoExtension = mainNoExtension.replace(EXTENSION, '');
const mainsByFormat = {};
@@ -482,10 +484,7 @@ function createConfig(options, entry, format, writeMeta) {
extract:
!!writeMeta &&
options.css !== 'inline' &&
- options.output.replace(
- /(\.(umd|cjs|es|m))?\.(mjs|[tj]sx?)$/,
- '.css',
- ),
+ options.output.replace(EXTENSION, '.css'),
minimize: options.compress,
sourceMap: options.sourcemap && options.css !== 'inline',
}),
diff --git a/src/utils.js b/src/utils.js
index dbb5e82f..aa3b8449 100644
--- a/src/utils.js
+++ b/src/utils.js
@@ -43,3 +43,5 @@ export function safeVariableName(name) {
const identifier = normalized.replace(INVALID_ES3_IDENT, '');
return camelCase(identifier);
}
+
+export const EXTENSION = /(\.(umd|cjs|es|m))?\.([cm]?[tj]sx?)$/;
From fb0a43780a7462f4876955c3412638e51a7adb97 Mon Sep 17 00:00:00 2001
From: Ryan Christian <33403762+rschristian@users.noreply.github.com>
Date: Thu, 3 Mar 2022 11:09:14 -0600
Subject: [PATCH 17/50] chore: Adding flag & docs for jsxFragment (#930)
---
.changeset/odd-mayflies-clap.md | 5 +++++
README.md | 1 +
src/index.js | 12 ++++--------
src/prog.js | 5 +++++
4 files changed, 15 insertions(+), 8 deletions(-)
create mode 100644 .changeset/odd-mayflies-clap.md
diff --git a/.changeset/odd-mayflies-clap.md b/.changeset/odd-mayflies-clap.md
new file mode 100644
index 00000000..75984f15
--- /dev/null
+++ b/.changeset/odd-mayflies-clap.md
@@ -0,0 +1,5 @@
+---
+'microbundle': patch
+---
+
+Documenting --jsxFragment flag
diff --git a/README.md b/README.md
index f86d3fee..26e074d8 100644
--- a/README.md
+++ b/README.md
@@ -335,6 +335,7 @@ Options
--sourcemap Generate source map (default true)
--raw Show raw byte size (default false)
--jsx A custom JSX pragma like React.createElement (default: h)
+ --jsxFragment A custom JSX fragment pragma like React.Fragment (default: Fragment)
--jsxImportSource Declares the module specifier to be used for importing jsx factory functions
--tsconfig Specify the path to a custom tsconfig.json
--generateTypes Whether or not to generate types, if `types` or `typings` is set in `package.json` then it will default to be `true`
diff --git a/src/index.js b/src/index.js
index f47a6dda..d5a77954 100644
--- a/src/index.js
+++ b/src/index.js
@@ -536,12 +536,8 @@ function createConfig(options, entry, format, writeMeta) {
declarationDir: getDeclarationDir({ options, pkg }),
}),
jsx: 'preserve',
- jsxFactory:
- // TypeScript fails to resolve Fragments when jsxFactory
- // is set, even when it's the same as the default value.
- options.jsx === 'React.createElement'
- ? undefined
- : options.jsx || 'h',
+ jsxFactory: options.jsx,
+ jsxFragmentFactory: options.jsxFragment,
},
files: options.entries,
},
@@ -578,8 +574,8 @@ function createConfig(options, entry, format, writeMeta) {
modern,
compress: options.compress !== false,
targets: options.target === 'node' ? { node: '8' } : undefined,
- pragma: options.jsx || 'h',
- pragmaFrag: options.jsxFragment || 'Fragment',
+ pragma: options.jsx,
+ pragmaFrag: options.jsxFragment,
typescript: !!useTypescript,
jsxImportSource: options.jsxImportSource || false,
},
diff --git a/src/prog.js b/src/prog.js
index 4f48a573..6049501c 100644
--- a/src/prog.js
+++ b/src/prog.js
@@ -59,6 +59,11 @@ export default handler => {
.example("watch --no-sourcemap # don't generate sourcemaps")
.option('--raw', 'Show raw byte size', false)
.option('--jsx', 'A custom JSX pragma like React.createElement', 'h')
+ .option(
+ '--jsxFragment',
+ 'A custom JSX fragment pragma like React.Fragment',
+ 'Fragment',
+ )
.option(
'--jsxImportSource',
'Declares the module specifier to be used for importing jsx factory functions',
From b51b855794866f3e6a0ef7dfc5672d5c1c717831 Mon Sep 17 00:00:00 2001
From: MYCOIN
Date: Fri, 8 Apr 2022 06:52:26 +0800
Subject: [PATCH 18/50] feat: [auto-commit] fix: _sizeInfo npe (#935)
* feat: [auto-commit] fix: _sizeInfo npe
* docs: Adding changeset
Co-authored-by: Ryan Christian
---
.changeset/clean-shoes-applaud.md | 5 +++++
src/index.js | 8 +++++---
2 files changed, 10 insertions(+), 3 deletions(-)
create mode 100644 .changeset/clean-shoes-applaud.md
diff --git a/.changeset/clean-shoes-applaud.md b/.changeset/clean-shoes-applaud.md
new file mode 100644
index 00000000..019f24a9
--- /dev/null
+++ b/.changeset/clean-shoes-applaud.md
@@ -0,0 +1,5 @@
+---
+'microbundle': patch
+---
+
+Don't attempt to write build stats in watch mode when there has been a build error/sizeInfo is `undefined`
diff --git a/src/index.js b/src/index.js
index d5a77954..deae019b 100644
--- a/src/index.js
+++ b/src/index.js
@@ -177,9 +177,11 @@ function doWatch(options, cwd, steps) {
}
}
if (e.code === 'END') {
- options._sizeInfo.then(text => {
- stdout(`Wrote ${text.trim()}`);
- });
+ if (options._sizeInfo) {
+ options._sizeInfo.then(text => {
+ stdout(`Wrote ${text.trim()}`);
+ });
+ }
if (typeof onBuild === 'function') {
onBuild(e);
}
From c4532cc9ccd846e6bc8176414ddf2c0fc22af1f1 Mon Sep 17 00:00:00 2001
From: Ryan Christian <33403762+rschristian@users.noreply.github.com>
Date: Wed, 20 Apr 2022 15:14:58 -0500
Subject: [PATCH 19/50] docs: compress flag (#940)
* docs: Add info on --compress default value
* docs: Update CLI help menu --compress info
* docs: Adding changeset
---
.changeset/big-cameras-attend.md | 5 +++++
README.md | 10 +++++-----
src/prog.js | 8 ++++++--
3 files changed, 16 insertions(+), 7 deletions(-)
create mode 100644 .changeset/big-cameras-attend.md
diff --git a/.changeset/big-cameras-attend.md b/.changeset/big-cameras-attend.md
new file mode 100644
index 00000000..ddfcd845
--- /dev/null
+++ b/.changeset/big-cameras-attend.md
@@ -0,0 +1,5 @@
+---
+'microbundle': patch
+---
+
+Adds information about `--compress` flag's default value w/ different targets
diff --git a/README.md b/README.md
index 26e074d8..bb68aead 100644
--- a/README.md
+++ b/README.md
@@ -328,19 +328,19 @@ Options
--globals Specify globals dependencies, or 'none'
--define Replace constants with hard-coded values (use @key=exp to replace an expression)
--alias Map imports to different modules
- --compress Compress output using Terser
+ --compress Compress output using Terser (default true when --target is web, false when --target is node)
--strict Enforce undefined global context and add "use strict"
--name Specify name exposed in UMD and IIFE builds
--cwd Use an alternative working directory (default .)
--sourcemap Generate source map (default true)
--raw Show raw byte size (default false)
- --jsx A custom JSX pragma like React.createElement (default: h)
- --jsxFragment A custom JSX fragment pragma like React.Fragment (default: Fragment)
+ --jsx A custom JSX pragma like React.createElement (default h)
+ --jsxFragment A custom JSX fragment pragma like React.Fragment (default Fragment)
--jsxImportSource Declares the module specifier to be used for importing jsx factory functions
--tsconfig Specify the path to a custom tsconfig.json
--generateTypes Whether or not to generate types, if `types` or `typings` is set in `package.json` then it will default to be `true`
- --css Where to output CSS: "inline" or "external" (default: "external")
- --css-modules Configures .css to be treated as modules (default: null)
+ --css Where to output CSS: "inline" or "external" (default "external")
+ --css-modules Configures .css to be treated as modules (default null)
--workers Bundle module workers - see https://git.io/J3oSF (default false)
-h, --help Displays this message
diff --git a/src/prog.js b/src/prog.js
index 6049501c..bbaf7444 100644
--- a/src/prog.js
+++ b/src/prog.js
@@ -13,7 +13,7 @@ export default handler => {
opts.entries = toArray(str || opts.entry).concat(opts._);
- if (opts.compress != null) {
+ if (typeof opts.compress !== 'undefined') {
// Convert `--compress true/false/1/0` to booleans:
if (typeof opts.compress !== 'boolean') {
opts.compress = opts.compress !== 'false' && opts.compress !== '0';
@@ -51,7 +51,11 @@ export default handler => {
.example('--define API_KEY=1234')
.option('--alias', `Map imports to different modules`)
.example('--alias react=preact')
- .option('--compress', 'Compress output using Terser', null)
+ .option(
+ '--compress',
+ 'Compress output using Terser (default true when --target is web, false when --target is node)',
+ )
+ .example('build --target web --no-compress')
.option('--strict', 'Enforce undefined global context and add "use strict"')
.option('--name', 'Specify name exposed in UMD builds')
.option('--cwd', 'Use an alternative working directory', '.')
From 1d0e305d89ad010793c57fc451991a79907e1f3f Mon Sep 17 00:00:00 2001
From: Ryan Christian <33403762+rschristian@users.noreply.github.com>
Date: Wed, 20 Apr 2022 15:15:11 -0500
Subject: [PATCH 20/50] fix: tsconfig cwd differing from microbundle's cwd
(#941)
* fix: 'tsconfig.json' search should start in the set cwd
* docs: Adding changeset
---
.changeset/clever-chicken-end.md | 5 +++++
src/index.js | 1 +
2 files changed, 6 insertions(+)
create mode 100644 .changeset/clever-chicken-end.md
diff --git a/.changeset/clever-chicken-end.md b/.changeset/clever-chicken-end.md
new file mode 100644
index 00000000..5c95c307
--- /dev/null
+++ b/.changeset/clever-chicken-end.md
@@ -0,0 +1,5 @@
+---
+'microbundle': patch
+---
+
+Ensures TS plugin will begin its search for a 'tsconfig.json' in the set cwd
diff --git a/src/index.js b/src/index.js
index deae019b..05e70c46 100644
--- a/src/index.js
+++ b/src/index.js
@@ -522,6 +522,7 @@ function createConfig(options, entry, format, writeMeta) {
},
(useTypescript || emitDeclaration) &&
typescript({
+ cwd: options.cwd,
typescript: require(resolveFrom.silent(
options.cwd,
'typescript',
From 8223ebaee8d750e9757b9ddbfef6384fa00f22ac Mon Sep 17 00:00:00 2001
From: Ryan Christian <33403762+rschristian@users.noreply.github.com>
Date: Thu, 21 Apr 2022 08:46:29 -0500
Subject: [PATCH 21/50] fix: build message formatting (#948)
* fix: Build output message formatting w/ dynamic import module
* docs: Adding changeset
---
.changeset/smart-plants-appear.md | 5 +++++
src/index.js | 2 +-
src/lib/compressed-size.js | 2 +-
3 files changed, 7 insertions(+), 2 deletions(-)
create mode 100644 .changeset/smart-plants-appear.md
diff --git a/.changeset/smart-plants-appear.md b/.changeset/smart-plants-appear.md
new file mode 100644
index 00000000..6767d470
--- /dev/null
+++ b/.changeset/smart-plants-appear.md
@@ -0,0 +1,5 @@
+---
+'microbundle': patch
+---
+
+Corrects formatting in build completion message w/ dynamic import is used
diff --git a/src/index.js b/src/index.js
index 05e70c46..f2ed30b0 100644
--- a/src/index.js
+++ b/src/index.js
@@ -144,7 +144,7 @@ export default async function microbundle(inputOptions) {
? blue(`Build "${options.pkg.name}" to ${targetDir}:`)
: red(`Error: No entry module found for "${options.pkg.name}"`);
return {
- output: `${banner}\n ${out.join('\n ')}`,
+ output: `${banner}\n${out.join('\n')}`,
};
}
diff --git a/src/lib/compressed-size.js b/src/lib/compressed-size.js
index dd7c869a..b8642105 100644
--- a/src/lib/compressed-size.js
+++ b/src/lib/compressed-size.js
@@ -11,7 +11,7 @@ function getPadLeft(str, width, char = ' ') {
function formatSize(size, filename, type, raw) {
const pretty = raw ? `${size} B` : prettyBytes(size);
const color = size < 5000 ? green : size > 40000 ? red : yellow;
- const indent = getPadLeft(pretty, type === 'br' ? 13 : 10);
+ const indent = getPadLeft(pretty, 13);
return `${indent}${color(pretty)}: ${white(basename(filename))}.${type}`;
}
From ecb0b022912397bcf98550c1a783e9e0534f33e5 Mon Sep 17 00:00:00 2001
From: Ryan Christian <33403762+rschristian@users.noreply.github.com>
Date: Thu, 21 Apr 2022 08:47:34 -0500
Subject: [PATCH 22/50] fix: babel exclude for hoisted modules (#947)
* fix: Ensures hoisted node_modules are excluded by babel
* docs: Adding changeset
---
.changeset/hip-olives-allow.md | 5 +++++
src/index.js | 3 ++-
2 files changed, 7 insertions(+), 1 deletion(-)
create mode 100644 .changeset/hip-olives-allow.md
diff --git a/.changeset/hip-olives-allow.md b/.changeset/hip-olives-allow.md
new file mode 100644
index 00000000..fd808e26
--- /dev/null
+++ b/.changeset/hip-olives-allow.md
@@ -0,0 +1,5 @@
+---
+'microbundle': patch
+---
+
+Ensures hoisted node_modules are excluded from babel
diff --git a/src/index.js b/src/index.js
index f2ed30b0..c483152c 100644
--- a/src/index.js
+++ b/src/index.js
@@ -570,7 +570,8 @@ function createConfig(options, entry, format, writeMeta) {
customBabel()({
babelHelpers: 'bundled',
extensions: EXTENSIONS,
- exclude: 'node_modules/**',
+ // use a regex to make sure to exclude eventual hoisted packages
+ exclude: /\/node_modules\//,
passPerPreset: true, // @see https://babeljs.io/docs/en/options#passperpreset
custom: {
defines,
From 242754f43cce1c25a6c475be64bbd2a525eb7cf0 Mon Sep 17 00:00:00 2001
From: Ryan Christian <33403762+rschristian@users.noreply.github.com>
Date: Mon, 25 Apr 2022 14:16:17 -0500
Subject: [PATCH 23/50] feature: bundle visualizer (#949)
* feat: Add --visualizer flag to generate build output stats
Co-authored-by: Alex Hayton
* docs: Adding changeset
* chore: Removing & git ignoring stats.html
Co-authored-by: Alex Hayton
---
.changeset/great-dolphins-tan.md | 5 +
.gitignore | 1 +
README.md | 5 +
package-lock.json | 400 ++++++++++++++++++++------
package.json | 1 +
src/index.js | 2 +
src/prog.js | 5 +
test/__snapshots__/index.test.js.snap | 49 ++++
test/fixtures/visualizer/package.json | 10 +
test/fixtures/visualizer/src/index.js | 3 +
10 files changed, 391 insertions(+), 90 deletions(-)
create mode 100644 .changeset/great-dolphins-tan.md
create mode 100644 test/fixtures/visualizer/package.json
create mode 100644 test/fixtures/visualizer/src/index.js
diff --git a/.changeset/great-dolphins-tan.md b/.changeset/great-dolphins-tan.md
new file mode 100644
index 00000000..597c3362
--- /dev/null
+++ b/.changeset/great-dolphins-tan.md
@@ -0,0 +1,5 @@
+---
+'microbundle': minor
+---
+
+Add --visualize flag to generate build output stats
diff --git a/.gitignore b/.gitignore
index 7a343b9d..30731f52 100644
--- a/.gitignore
+++ b/.gitignore
@@ -12,3 +12,4 @@ yarn.lock
.idea
.rts2*
sizes.csv
+test/fixtures/visualizer/stats.html
diff --git a/README.md b/README.md
index bb68aead..869ccbe2 100644
--- a/README.md
+++ b/README.md
@@ -278,6 +278,10 @@ microbundle --workers
For more information see
[@surma/rollup-plugin-off-main-thread](https://github.com/surma/rollup-plugin-off-main-thread#config).
+### Visualize Bundle Makeup
+
+Use the `--visualize` flag to generate a `stats.html` file at build time, showing the makeup of your bundle. Uses [rollup-plugin-visualizer](https://www.npmjs.com/package/rollup-plugin-visualizer).
+
### Mangling Properties
To achieve the smallest possible bundle size, libraries often wish to rename internal object properties or class members to smaller names - transforming `this._internalIdValue` to `this._i`. Microbundle doesn't do this by default, however it can be enabled by creating a `mangle.json` file (or a `"mangle"` property in your package.json). Within that file, you can specify a regular expression pattern to control which properties should be mangled. For example: to mangle all property names beginning an underscore:
@@ -342,6 +346,7 @@ Options
--css Where to output CSS: "inline" or "external" (default "external")
--css-modules Configures .css to be treated as modules (default null)
--workers Bundle module workers - see https://git.io/J3oSF (default false)
+ --visualize Generate bundle makeup visualization (stats.html)
-h, --help Displays this message
Examples
diff --git a/package-lock.json b/package-lock.json
index b9ec265b..41b4d9f9 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,11 +1,12 @@
{
"name": "microbundle",
- "version": "0.13.3",
+ "version": "0.14.2",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
- "version": "0.13.3",
+ "name": "microbundle",
+ "version": "0.14.2",
"license": "MIT",
"dependencies": {
"@babel/core": "^7.12.10",
@@ -44,6 +45,7 @@
"rollup-plugin-postcss": "^4.0.0",
"rollup-plugin-terser": "^7.0.2",
"rollup-plugin-typescript2": "^0.29.0",
+ "rollup-plugin-visualizer": "^5.6.0",
"sade": "^1.7.4",
"terser": "^5.7.0",
"tiny-glob": "^0.2.8",
@@ -368,14 +370,6 @@
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.628.tgz",
"integrity": "sha512-fmhO4YGo/kapy+xL9Eq/cZwDASaTHZu3psIFYo4yc+RY1LzbZr84xjKlDImDrlrmWhOxsrDi98nX097U/xK/cQ=="
},
- "node_modules/@babel/helper-compilation-targets/node_modules/escalade": {
- "version": "3.1.1",
- "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz",
- "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==",
- "engines": {
- "node": ">=6"
- }
- },
"node_modules/@babel/helper-compilation-targets/node_modules/node-releases": {
"version": "1.1.67",
"resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.67.tgz",
@@ -3850,14 +3844,6 @@
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.628.tgz",
"integrity": "sha512-fmhO4YGo/kapy+xL9Eq/cZwDASaTHZu3psIFYo4yc+RY1LzbZr84xjKlDImDrlrmWhOxsrDi98nX097U/xK/cQ=="
},
- "node_modules/autoprefixer/node_modules/escalade": {
- "version": "3.1.1",
- "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz",
- "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==",
- "engines": {
- "node": ">=6"
- }
- },
"node_modules/autoprefixer/node_modules/node-releases": {
"version": "1.1.67",
"resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.67.tgz",
@@ -5049,14 +5035,6 @@
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.628.tgz",
"integrity": "sha512-fmhO4YGo/kapy+xL9Eq/cZwDASaTHZu3psIFYo4yc+RY1LzbZr84xjKlDImDrlrmWhOxsrDi98nX097U/xK/cQ=="
},
- "node_modules/core-js-compat/node_modules/escalade": {
- "version": "3.1.1",
- "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz",
- "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==",
- "engines": {
- "node": ">=6"
- }
- },
"node_modules/core-js-compat/node_modules/node-releases": {
"version": "1.1.67",
"resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.67.tgz",
@@ -5725,6 +5703,14 @@
"clone": "^1.0.2"
}
},
+ "node_modules/define-lazy-prop": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz",
+ "integrity": "sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og==",
+ "engines": {
+ "node": ">=8"
+ }
+ },
"node_modules/define-properties": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz",
@@ -5971,8 +5957,7 @@
"node_modules/emoji-regex": {
"version": "8.0.0",
"resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
- "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==",
- "dev": true
+ "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A=="
},
"node_modules/emojis-list": {
"version": "3.0.0",
@@ -6051,9 +6036,9 @@
}
},
"node_modules/escalade": {
- "version": "3.0.2",
- "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.0.2.tgz",
- "integrity": "sha512-gPYAU37hYCUhW5euPeR+Y74F7BL+IBsV93j5cvGriSaD1aG6MGsqsV1yamRdrWrb2j3aiZvb0X+UBOWpx3JWtQ==",
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz",
+ "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==",
"engines": {
"node": ">=6"
}
@@ -7447,7 +7432,6 @@
"version": "2.0.5",
"resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz",
"integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==",
- "dev": true,
"engines": {
"node": "6.* || 8.* || >= 10.*"
}
@@ -8212,8 +8196,6 @@
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.1.1.tgz",
"integrity": "sha512-ZOoqiXfEwtGknTiuDEy8pN2CfE3TxMHprvNer1mXiqwkOT77Rw3YVrUQ52EqAOU3QAWDQ+bQdx7HJzrv7LS2Hw==",
- "dev": true,
- "optional": true,
"bin": {
"is-docker": "cli.js"
},
@@ -8445,8 +8427,6 @@
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz",
"integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==",
- "dev": true,
- "optional": true,
"dependencies": {
"is-docker": "^2.0.0"
},
@@ -11718,9 +11698,9 @@
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
},
"node_modules/nanoid": {
- "version": "3.1.20",
- "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.1.20.tgz",
- "integrity": "sha512-a1cQNyczgKbLX9jwbS/+d7W8fX/RfgYR7lVWwWOGIPNgK2m0MWvrGF6/m4kk6U3QcFMnZf3RIhL0v2Jgh/0Uxw==",
+ "version": "3.3.3",
+ "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.3.tgz",
+ "integrity": "sha512-p1sjXuopFs0xg+fPASzQ28agW1oHD7xDsd9Xkf3T15H3c/cifrFHVwrh74PdoklAPi+i7MdRsE47vm2r6JoB+w==",
"bin": {
"nanoid": "bin/nanoid.cjs"
},
@@ -12684,6 +12664,22 @@
"node": ">=6"
}
},
+ "node_modules/open": {
+ "version": "8.4.0",
+ "resolved": "https://registry.npmjs.org/open/-/open-8.4.0.tgz",
+ "integrity": "sha512-XgFPPM+B28FtCCgSb9I+s9szOC1vZRSwgWsRUA5ylIxRTgKozqjOCrVOqGsYABPYK5qnfqClxZTFBa8PKt2v6Q==",
+ "dependencies": {
+ "define-lazy-prop": "^2.0.0",
+ "is-docker": "^2.1.1",
+ "is-wsl": "^2.2.0"
+ },
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
"node_modules/opencollective-postinstall": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/opencollective-postinstall/-/opencollective-postinstall-2.0.3.tgz",
@@ -15049,7 +15045,6 @@
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz",
"integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=",
- "dev": true,
"engines": {
"node": ">=0.10.0"
}
@@ -15361,6 +15356,144 @@
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.0.1.tgz",
"integrity": "sha512-SgIkNheinmEBgx1IUNirK0TUD4X9yjjBRTqqjggWCU3pUEqIk3/Uwl3yRixYKT6WjQuGiwDv4NomL3wqRCj+CQ=="
},
+ "node_modules/rollup-plugin-visualizer": {
+ "version": "5.6.0",
+ "resolved": "https://registry.npmjs.org/rollup-plugin-visualizer/-/rollup-plugin-visualizer-5.6.0.tgz",
+ "integrity": "sha512-CKcc8GTUZjC+LsMytU8ocRr/cGZIfMR7+mdy4YnlyetlmIl/dM8BMnOEpD4JPIGt+ZVW7Db9ZtSsbgyeBH3uTA==",
+ "dependencies": {
+ "nanoid": "^3.1.32",
+ "open": "^8.4.0",
+ "source-map": "^0.7.3",
+ "yargs": "^17.3.1"
+ },
+ "bin": {
+ "rollup-plugin-visualizer": "dist/bin/cli.js"
+ },
+ "engines": {
+ "node": ">=12"
+ },
+ "peerDependencies": {
+ "rollup": "^2.0.0"
+ }
+ },
+ "node_modules/rollup-plugin-visualizer/node_modules/ansi-styles": {
+ "version": "4.3.0",
+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
+ "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
+ "dependencies": {
+ "color-convert": "^2.0.1"
+ },
+ "engines": {
+ "node": ">=8"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/ansi-styles?sponsor=1"
+ }
+ },
+ "node_modules/rollup-plugin-visualizer/node_modules/cliui": {
+ "version": "7.0.4",
+ "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz",
+ "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==",
+ "dependencies": {
+ "string-width": "^4.2.0",
+ "strip-ansi": "^6.0.0",
+ "wrap-ansi": "^7.0.0"
+ }
+ },
+ "node_modules/rollup-plugin-visualizer/node_modules/color-convert": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
+ "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
+ "dependencies": {
+ "color-name": "~1.1.4"
+ },
+ "engines": {
+ "node": ">=7.0.0"
+ }
+ },
+ "node_modules/rollup-plugin-visualizer/node_modules/color-name": {
+ "version": "1.1.4",
+ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
+ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="
+ },
+ "node_modules/rollup-plugin-visualizer/node_modules/is-fullwidth-code-point": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
+ "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==",
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/rollup-plugin-visualizer/node_modules/source-map": {
+ "version": "0.7.3",
+ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz",
+ "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==",
+ "engines": {
+ "node": ">= 8"
+ }
+ },
+ "node_modules/rollup-plugin-visualizer/node_modules/string-width": {
+ "version": "4.2.3",
+ "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",
+ "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
+ "dependencies": {
+ "emoji-regex": "^8.0.0",
+ "is-fullwidth-code-point": "^3.0.0",
+ "strip-ansi": "^6.0.1"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/rollup-plugin-visualizer/node_modules/wrap-ansi": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz",
+ "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==",
+ "dependencies": {
+ "ansi-styles": "^4.0.0",
+ "string-width": "^4.1.0",
+ "strip-ansi": "^6.0.0"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/wrap-ansi?sponsor=1"
+ }
+ },
+ "node_modules/rollup-plugin-visualizer/node_modules/y18n": {
+ "version": "5.0.8",
+ "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz",
+ "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==",
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/rollup-plugin-visualizer/node_modules/yargs": {
+ "version": "17.4.1",
+ "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.4.1.tgz",
+ "integrity": "sha512-WSZD9jgobAg3ZKuCQZSa3g9QOJeCCqLoLAykiWgmXnDo9EPnn4RPf5qVTtzgOx66o6/oqhcA5tHtJXpG8pMt3g==",
+ "dependencies": {
+ "cliui": "^7.0.2",
+ "escalade": "^3.1.1",
+ "get-caller-file": "^2.0.5",
+ "require-directory": "^2.1.1",
+ "string-width": "^4.2.3",
+ "y18n": "^5.0.5",
+ "yargs-parser": "^21.0.0"
+ },
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/rollup-plugin-visualizer/node_modules/yargs-parser": {
+ "version": "21.0.1",
+ "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.0.1.tgz",
+ "integrity": "sha512-9BK1jFpLzJROCI5TzwZL/TU4gqjK5xiHV/RfWLOahrjAko/e4DJkRDZQXfvqAsiZzzYhgAzbgz6lg48jcm4GLg==",
+ "engines": {
+ "node": ">=12"
+ }
+ },
"node_modules/rollup-pluginutils": {
"version": "2.8.2",
"resolved": "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-2.8.2.tgz",
@@ -16182,22 +16315,20 @@
}
},
"node_modules/strip-ansi": {
- "version": "6.0.0",
- "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz",
- "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==",
- "dev": true,
+ "version": "6.0.1",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
+ "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
"dependencies": {
- "ansi-regex": "^5.0.0"
+ "ansi-regex": "^5.0.1"
},
"engines": {
"node": ">=8"
}
},
"node_modules/strip-ansi/node_modules/ansi-regex": {
- "version": "5.0.0",
- "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz",
- "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==",
- "dev": true,
+ "version": "5.0.1",
+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
+ "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
"engines": {
"node": ">=8"
}
@@ -17744,11 +17875,6 @@
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.628.tgz",
"integrity": "sha512-fmhO4YGo/kapy+xL9Eq/cZwDASaTHZu3psIFYo4yc+RY1LzbZr84xjKlDImDrlrmWhOxsrDi98nX097U/xK/cQ=="
},
- "escalade": {
- "version": "3.1.1",
- "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz",
- "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw=="
- },
"node-releases": {
"version": "1.1.67",
"resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.67.tgz",
@@ -20880,11 +21006,6 @@
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.628.tgz",
"integrity": "sha512-fmhO4YGo/kapy+xL9Eq/cZwDASaTHZu3psIFYo4yc+RY1LzbZr84xjKlDImDrlrmWhOxsrDi98nX097U/xK/cQ=="
},
- "escalade": {
- "version": "3.1.1",
- "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz",
- "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw=="
- },
"node-releases": {
"version": "1.1.67",
"resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.67.tgz",
@@ -21880,11 +22001,6 @@
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.628.tgz",
"integrity": "sha512-fmhO4YGo/kapy+xL9Eq/cZwDASaTHZu3psIFYo4yc+RY1LzbZr84xjKlDImDrlrmWhOxsrDi98nX097U/xK/cQ=="
},
- "escalade": {
- "version": "3.1.1",
- "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz",
- "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw=="
- },
"node-releases": {
"version": "1.1.67",
"resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.67.tgz",
@@ -22417,6 +22533,11 @@
"clone": "^1.0.2"
}
},
+ "define-lazy-prop": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz",
+ "integrity": "sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og=="
+ },
"define-properties": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz",
@@ -22612,8 +22733,7 @@
"emoji-regex": {
"version": "8.0.0",
"resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
- "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==",
- "dev": true
+ "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A=="
},
"emojis-list": {
"version": "3.0.0",
@@ -22680,9 +22800,9 @@
}
},
"escalade": {
- "version": "3.0.2",
- "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.0.2.tgz",
- "integrity": "sha512-gPYAU37hYCUhW5euPeR+Y74F7BL+IBsV93j5cvGriSaD1aG6MGsqsV1yamRdrWrb2j3aiZvb0X+UBOWpx3JWtQ=="
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz",
+ "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw=="
},
"escape-string-regexp": {
"version": "4.0.0",
@@ -23789,8 +23909,7 @@
"get-caller-file": {
"version": "2.0.5",
"resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz",
- "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==",
- "dev": true
+ "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg=="
},
"get-intrinsic": {
"version": "1.0.1",
@@ -24403,9 +24522,7 @@
"is-docker": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.1.1.tgz",
- "integrity": "sha512-ZOoqiXfEwtGknTiuDEy8pN2CfE3TxMHprvNer1mXiqwkOT77Rw3YVrUQ52EqAOU3QAWDQ+bQdx7HJzrv7LS2Hw==",
- "dev": true,
- "optional": true
+ "integrity": "sha512-ZOoqiXfEwtGknTiuDEy8pN2CfE3TxMHprvNer1mXiqwkOT77Rw3YVrUQ52EqAOU3QAWDQ+bQdx7HJzrv7LS2Hw=="
},
"is-extendable": {
"version": "0.1.1",
@@ -24576,8 +24693,6 @@
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz",
"integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==",
- "dev": true,
- "optional": true,
"requires": {
"is-docker": "^2.0.0"
}
@@ -27170,9 +27285,9 @@
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
},
"nanoid": {
- "version": "3.1.20",
- "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.1.20.tgz",
- "integrity": "sha512-a1cQNyczgKbLX9jwbS/+d7W8fX/RfgYR7lVWwWOGIPNgK2m0MWvrGF6/m4kk6U3QcFMnZf3RIhL0v2Jgh/0Uxw=="
+ "version": "3.3.3",
+ "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.3.tgz",
+ "integrity": "sha512-p1sjXuopFs0xg+fPASzQ28agW1oHD7xDsd9Xkf3T15H3c/cifrFHVwrh74PdoklAPi+i7MdRsE47vm2r6JoB+w=="
},
"nanomatch": {
"version": "1.2.13",
@@ -27938,6 +28053,16 @@
"mimic-fn": "^2.1.0"
}
},
+ "open": {
+ "version": "8.4.0",
+ "resolved": "https://registry.npmjs.org/open/-/open-8.4.0.tgz",
+ "integrity": "sha512-XgFPPM+B28FtCCgSb9I+s9szOC1vZRSwgWsRUA5ylIxRTgKozqjOCrVOqGsYABPYK5qnfqClxZTFBa8PKt2v6Q==",
+ "requires": {
+ "define-lazy-prop": "^2.0.0",
+ "is-docker": "^2.1.1",
+ "is-wsl": "^2.2.0"
+ }
+ },
"opencollective-postinstall": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/opencollective-postinstall/-/opencollective-postinstall-2.0.3.tgz",
@@ -29814,8 +29939,7 @@
"require-directory": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz",
- "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=",
- "dev": true
+ "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I="
},
"require-main-filename": {
"version": "2.0.0",
@@ -30076,6 +30200,104 @@
}
}
},
+ "rollup-plugin-visualizer": {
+ "version": "5.6.0",
+ "resolved": "https://registry.npmjs.org/rollup-plugin-visualizer/-/rollup-plugin-visualizer-5.6.0.tgz",
+ "integrity": "sha512-CKcc8GTUZjC+LsMytU8ocRr/cGZIfMR7+mdy4YnlyetlmIl/dM8BMnOEpD4JPIGt+ZVW7Db9ZtSsbgyeBH3uTA==",
+ "requires": {
+ "nanoid": "^3.1.32",
+ "open": "^8.4.0",
+ "source-map": "^0.7.3",
+ "yargs": "^17.3.1"
+ },
+ "dependencies": {
+ "ansi-styles": {
+ "version": "4.3.0",
+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
+ "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
+ "requires": {
+ "color-convert": "^2.0.1"
+ }
+ },
+ "cliui": {
+ "version": "7.0.4",
+ "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz",
+ "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==",
+ "requires": {
+ "string-width": "^4.2.0",
+ "strip-ansi": "^6.0.0",
+ "wrap-ansi": "^7.0.0"
+ }
+ },
+ "color-convert": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
+ "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
+ "requires": {
+ "color-name": "~1.1.4"
+ }
+ },
+ "color-name": {
+ "version": "1.1.4",
+ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
+ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="
+ },
+ "is-fullwidth-code-point": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
+ "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg=="
+ },
+ "source-map": {
+ "version": "0.7.3",
+ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz",
+ "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ=="
+ },
+ "string-width": {
+ "version": "4.2.3",
+ "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",
+ "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
+ "requires": {
+ "emoji-regex": "^8.0.0",
+ "is-fullwidth-code-point": "^3.0.0",
+ "strip-ansi": "^6.0.1"
+ }
+ },
+ "wrap-ansi": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz",
+ "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==",
+ "requires": {
+ "ansi-styles": "^4.0.0",
+ "string-width": "^4.1.0",
+ "strip-ansi": "^6.0.0"
+ }
+ },
+ "y18n": {
+ "version": "5.0.8",
+ "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz",
+ "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA=="
+ },
+ "yargs": {
+ "version": "17.4.1",
+ "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.4.1.tgz",
+ "integrity": "sha512-WSZD9jgobAg3ZKuCQZSa3g9QOJeCCqLoLAykiWgmXnDo9EPnn4RPf5qVTtzgOx66o6/oqhcA5tHtJXpG8pMt3g==",
+ "requires": {
+ "cliui": "^7.0.2",
+ "escalade": "^3.1.1",
+ "get-caller-file": "^2.0.5",
+ "require-directory": "^2.1.1",
+ "string-width": "^4.2.3",
+ "y18n": "^5.0.5",
+ "yargs-parser": "^21.0.0"
+ }
+ },
+ "yargs-parser": {
+ "version": "21.0.1",
+ "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.0.1.tgz",
+ "integrity": "sha512-9BK1jFpLzJROCI5TzwZL/TU4gqjK5xiHV/RfWLOahrjAko/e4DJkRDZQXfvqAsiZzzYhgAzbgz6lg48jcm4GLg=="
+ }
+ }
+ },
"rollup-pluginutils": {
"version": "2.8.2",
"resolved": "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-2.8.2.tgz",
@@ -30779,19 +31001,17 @@
}
},
"strip-ansi": {
- "version": "6.0.0",
- "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz",
- "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==",
- "dev": true,
+ "version": "6.0.1",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
+ "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
"requires": {
- "ansi-regex": "^5.0.0"
+ "ansi-regex": "^5.0.1"
},
"dependencies": {
"ansi-regex": {
- "version": "5.0.0",
- "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz",
- "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==",
- "dev": true
+ "version": "5.0.1",
+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
+ "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ=="
}
}
},
diff --git a/package.json b/package.json
index e2896487..2205277a 100644
--- a/package.json
+++ b/package.json
@@ -109,6 +109,7 @@
"rollup-plugin-postcss": "^4.0.0",
"rollup-plugin-terser": "^7.0.2",
"rollup-plugin-typescript2": "^0.29.0",
+ "rollup-plugin-visualizer": "^5.6.0",
"sade": "^1.7.4",
"terser": "^5.7.0",
"tiny-glob": "^0.2.8",
diff --git a/src/index.js b/src/index.js
index c483152c..cff11d6f 100644
--- a/src/index.js
+++ b/src/index.js
@@ -14,6 +14,7 @@ import babel from '@rollup/plugin-babel';
import customBabel from './lib/babel-custom';
import nodeResolve from '@rollup/plugin-node-resolve';
import { terser } from 'rollup-plugin-terser';
+import { visualizer } from 'rollup-plugin-visualizer';
import alias from '@rollup/plugin-alias';
import postcss from 'rollup-plugin-postcss';
import typescript from 'rollup-plugin-typescript2';
@@ -628,6 +629,7 @@ function createConfig(options, entry, format, writeMeta) {
},
},
],
+ options.visualize && visualizer(),
// NOTE: OMT only works with amd and esm
// Source: https://github.com/surma/rollup-plugin-off-main-thread#config
useWorkerLoader && (format === 'es' || modern) && OMT(),
diff --git a/src/prog.js b/src/prog.js
index bbaf7444..55adee0e 100644
--- a/src/prog.js
+++ b/src/prog.js
@@ -88,6 +88,11 @@ export default handler => {
'--workers',
'Bundle module workers - see https://git.io/J3oSF',
false,
+ )
+ .option(
+ '--visualize',
+ 'Generate bundle makeup visualization (stats.html)',
+ false,
);
prog
diff --git a/test/__snapshots__/index.test.js.snap b/test/__snapshots__/index.test.js.snap
index 566631f0..19d63406 100644
--- a/test/__snapshots__/index.test.js.snap
+++ b/test/__snapshots__/index.test.js.snap
@@ -3020,6 +3020,55 @@ exports[`fixtures build ts-module with microbundle 7`] = `
"
`;
+exports[`fixtures build visualizer with microbundle 1`] = `
+"Used script: microbundle --visualize
+
+Directory tree:
+
+visualizer
+ dist
+ visualizer.esm.js
+ visualizer.esm.js.map
+ visualizer.js
+ visualizer.js.map
+ visualizer.umd.js
+ visualizer.umd.js.map
+ package.json
+ src
+ index.js
+ stats.html
+
+
+Build \\"visualizer\\" to dist:
+148 B: visualizer.js.gz
+107 B: visualizer.js.br
+79 B: visualizer.esm.js.gz
+64 B: visualizer.esm.js.br
+231 B: visualizer.umd.js.gz
+195 B: visualizer.umd.js.br"
+`;
+
+exports[`fixtures build visualizer with microbundle 2`] = `6`;
+
+exports[`fixtures build visualizer with microbundle 3`] = `
+"import a from\\"camelcase\\";var o=a(\\"foo-bar\\");export default o;
+//# sourceMappingURL=visualizer.esm.js.map
+"
+`;
+
+exports[`fixtures build visualizer with microbundle 4`] = `
+"function e(e){return e&&\\"object\\"==typeof e&&\\"default\\"in e?e:{default:e}}var t=/*#__PURE__*/e(require(\\"camelcase\\")).default(\\"foo-bar\\");module.exports=t;
+//# sourceMappingURL=visualizer.js.map
+"
+`;
+
+exports[`fixtures build visualizer with microbundle 5`] = `
+"!function(e,f){\\"object\\"==typeof exports&&\\"undefined\\"!=typeof module?module.exports=f(require(\\"camelcase\\")):\\"function\\"==typeof define&&define.amd?define([\\"camelcase\\"],f):(e||self).visualizer=f(e.camelcase)}(this,function(e){function f(e){return e&&\\"object\\"==typeof e&&\\"default\\"in e?e:{default:e}}/*#__PURE__*/
+return f(e).default(\\"foo-bar\\")});
+//# sourceMappingURL=visualizer.umd.js.map
+"
+`;
+
exports[`fixtures build worker-loader with microbundle 1`] = `
"Used script: microbundle -f modern,es --workers
diff --git a/test/fixtures/visualizer/package.json b/test/fixtures/visualizer/package.json
new file mode 100644
index 00000000..0f2b26f6
--- /dev/null
+++ b/test/fixtures/visualizer/package.json
@@ -0,0 +1,10 @@
+{
+ "name": "visualizer",
+ "scripts": {
+ "prebuild": "rimraf ./stats.html",
+ "build": "microbundle --visualize"
+ },
+ "peerDependencies": {
+ "camelcase": "*"
+ }
+}
diff --git a/test/fixtures/visualizer/src/index.js b/test/fixtures/visualizer/src/index.js
new file mode 100644
index 00000000..287e3532
--- /dev/null
+++ b/test/fixtures/visualizer/src/index.js
@@ -0,0 +1,3 @@
+import camelcase from 'camelcase';
+
+export default camelcase('foo-bar');
From 6f6e080f3b9ec9a223d79d24eb6e6c8dd5d72cf7 Mon Sep 17 00:00:00 2001
From: Ryan Christian <33403762+rschristian@users.noreply.github.com>
Date: Mon, 25 Apr 2022 14:17:55 -0500
Subject: [PATCH 24/50] refactor: Output ESM files w/ `.mjs` when appropriate
(#950)
* fix: Output ESM w/ .mjs ext when pkg type is cjs
* docs: Adding changeset
* Update README.md
* Update README.md
Co-authored-by: Jason Miller
* chore: Add warning for new ESM output extension behavior
* Update src/index.js
Co-authored-by: Jason Miller
Co-authored-by: Jason Miller
---
.changeset/clean-ducks-push.md | 5 +
README.md | 24 +-
src/index.js | 25 +-
test/__snapshots__/index.test.js.snap | 560 +++++++++++++-------------
4 files changed, 317 insertions(+), 297 deletions(-)
create mode 100644 .changeset/clean-ducks-push.md
diff --git a/.changeset/clean-ducks-push.md b/.changeset/clean-ducks-push.md
new file mode 100644
index 00000000..733121ea
--- /dev/null
+++ b/.changeset/clean-ducks-push.md
@@ -0,0 +1,5 @@
+---
+'microbundle': minor
+---
+
+Microbundle will now output ESM using `.mjs` as the file extension when the package type is CJS
diff --git a/README.md b/README.md
index 869ccbe2..5c6d672c 100644
--- a/README.md
+++ b/README.md
@@ -120,8 +120,8 @@ export default function (e, t, r) {
```jsonc
{
"main": "./dist/foo.umd.js", // legacy UMD output (for Node & CDN use)
- "module": "./dist/foo.module.js", // legacy ES Modules output (for bundlers)
- "exports": "./dist/foo.modern.js", // modern ES2017 output
+ "module": "./dist/foo.module.mjs", // legacy ES Modules output (for bundlers)
+ "exports": "./dist/foo.modern.mjs", // modern ES2017 output
"scripts": {
"build": "microbundle src/foo.js"
}
@@ -134,9 +134,9 @@ The `"exports"` field can also be an object for packages with multiple entry mod
{
"name": "foo",
"exports": {
- ".": "./dist/foo.modern.js", // import "foo" (the default)
- "./lite": "./dist/lite.modern.js", // import "foo/lite"
- "./full": "./dist/full.modern.js" // import "foo/full"
+ ".": "./dist/foo.modern.mjs", // import "foo" (the default)
+ "./lite": "./dist/lite.modern.mjs", // import "foo/lite"
+ "./full": "./dist/full.modern.mjs" // import "foo/full"
},
"scripts": {
"build": "microbundle src/*.js" // build foo.js, lite.js and full.js
@@ -163,15 +163,15 @@ The filenames and paths for generated bundles in each format are defined by the
```jsonc
{
- "source": "src/index.js", // input
- "main": "dist/foo.js", // CommonJS output bundle
- "umd:main": "dist/foo.umd.js", // UMD output bundle
- "module": "dist/foo.m.js", // ES Modules output bundle
+ "source": "src/index.js", // input
+ "main": "dist/foo.js", // CommonJS output bundle
+ "umd:main": "dist/foo.umd.js", // UMD output bundle
+ "module": "dist/foo.mjs", // ES Modules output bundle
"exports": {
- "require": "./dist/foo.js", // CommonJS output bundle
- "default": "./dist/foo.modern.js", // Modern ES Modules output bundle
+ "require": "./dist/foo.js", // CommonJS output bundle
+ "default": "./dist/foo.modern.mjs", // Modern ES Modules output bundle
},
- "types": "dist/foo.d.ts" // TypeScript typings directory
+ "types": "dist/foo.d.ts" // TypeScript typings directory
}
```
diff --git a/src/index.js b/src/index.js
index cff11d6f..de04f040 100644
--- a/src/index.js
+++ b/src/index.js
@@ -2,7 +2,7 @@ import fs from 'fs';
import { resolve, relative, dirname, basename, extname } from 'path';
import camelCase from 'camelcase';
import escapeStringRegexp from 'escape-string-regexp';
-import { blue, red } from 'kleur';
+import { blue, yellow, red } from 'kleur';
import { map, series } from 'asyncro';
import glob from 'tiny-glob/sync';
import autoprefixer from 'autoprefixer';
@@ -282,6 +282,7 @@ function walk(exports, includeDefault) {
function getMain({ options, entry, format }) {
const { pkg } = options;
const pkgMain = options['pkg-main'];
+ const pkgTypeModule = pkg.type === 'module';
if (!pkgMain) {
return options.output;
@@ -301,18 +302,23 @@ function getMain({ options, entry, format }) {
mainsByFormat.es = replaceName(
pkg.module && !pkg.module.match(/src\//)
? pkg.module
- : pkg['jsnext:main'] || 'x.esm.js',
+ : pkg['jsnext:main'] || pkgTypeModule
+ ? 'x.esm.js'
+ : 'x.esm.mjs',
mainNoExtension,
);
+
mainsByFormat.modern = replaceName(
- (pkg.exports && walk(pkg.exports, pkg.type === 'module')) ||
+ (pkg.exports && walk(pkg.exports, pkgTypeModule)) ||
(pkg.syntax && pkg.syntax.esmodules) ||
pkg.esmodule ||
- 'x.modern.js',
+ pkgTypeModule
+ ? 'x.modern.js'
+ : 'x.modern.mjs',
mainNoExtension,
);
mainsByFormat.cjs = replaceName(
- pkg['cjs:main'] || (pkg.type && pkg.type === 'module' ? 'x.cjs' : 'x.js'),
+ pkg['cjs:main'] || (pkgTypeModule ? 'x.cjs' : 'x.js'),
mainNoExtension,
);
mainsByFormat.umd = replaceName(
@@ -440,6 +446,15 @@ function createConfig(options, entry, format, writeMeta) {
const outputDir = dirname(absMain);
const outputEntryFileName = basename(absMain);
+ // Warn about the (somewhat) breaking change in #950
+ if (format === 'es' && !pkg.module && outputEntryFileName.endsWith('.mjs')) {
+ stdout(
+ yellow(
+ 'Warning: your package.json does not specify {"type":"module"}. Microbundle assumes this is a CommonJS package and is generating ES Modules with the ".mjs" file extension.',
+ ),
+ );
+ }
+
let config = {
/** @type {import('rollup').InputOptions} */
inputOptions: {
diff --git a/test/__snapshots__/index.test.js.snap b/test/__snapshots__/index.test.js.snap
index 19d63406..9d159bfa 100644
--- a/test/__snapshots__/index.test.js.snap
+++ b/test/__snapshots__/index.test.js.snap
@@ -7,7 +7,7 @@ Directory tree:
alias
dist
- alias-mapping.esm.js
+ alias-mapping.esm.mjs
alias-mapping.js
alias-mapping.umd.js
package.json
@@ -20,8 +20,8 @@ alias
Build \\"alias-mapping\\" to dist:
62 B: alias-mapping.js.gz
46 B: alias-mapping.js.br
-62 B: alias-mapping.esm.js.gz
-46 B: alias-mapping.esm.js.br
+62 B: alias-mapping.esm.mjs.gz
+46 B: alias-mapping.esm.mjs.br
118 B: alias-mapping.umd.js.gz
83 B: alias-mapping.umd.js.br"
`;
@@ -50,8 +50,8 @@ Directory tree:
alias-external
dist
- alias-external.esm.js
- alias-external.esm.js.map
+ alias-external.esm.mjs
+ alias-external.esm.mjs.map
alias-external.js
alias-external.js.map
alias-external.umd.js
@@ -65,8 +65,8 @@ alias-external
Build \\"alias-external\\" to dist:
37 B: alias-external.js.gz
21 B: alias-external.js.br
-37 B: alias-external.esm.js.gz
-21 B: alias-external.esm.js.br
+37 B: alias-external.esm.mjs.gz
+21 B: alias-external.esm.mjs.br
93 B: alias-external.umd.js.gz
89 B: alias-external.umd.js.br"
`;
@@ -75,7 +75,7 @@ exports[`fixtures build alias-external with microbundle 2`] = `6`;
exports[`fixtures build alias-external with microbundle 3`] = `
"console.log(42);
-//# sourceMappingURL=alias-external.esm.js.map
+//# sourceMappingURL=alias-external.esm.mjs.map
"
`;
@@ -98,8 +98,8 @@ Directory tree:
async-iife-ts
dist
- async-iife-ts.esm.js
- async-iife-ts.esm.js.map
+ async-iife-ts.esm.mjs
+ async-iife-ts.esm.mjs.map
async-iife-ts.js
async-iife-ts.js.map
async-iife-ts.umd.js
@@ -115,8 +115,8 @@ async-iife-ts
Build \\"async-iife-ts\\" to dist:
70 B: async-iife-ts.js.gz
55 B: async-iife-ts.js.br
-70 B: async-iife-ts.esm.js.gz
-55 B: async-iife-ts.esm.js.br
+70 B: async-iife-ts.esm.mjs.gz
+55 B: async-iife-ts.esm.mjs.br
125 B: async-iife-ts.umd.js.gz
95 B: async-iife-ts.umd.js.br"
`;
@@ -125,7 +125,7 @@ exports[`fixtures build async-iife-ts with microbundle 2`] = `7`;
exports[`fixtures build async-iife-ts with microbundle 3`] = `
"try{console.log(\\"foo\\")}catch(o){Promise.reject(o)}
-//# sourceMappingURL=async-iife-ts.esm.js.map
+//# sourceMappingURL=async-iife-ts.esm.mjs.map
"
`;
@@ -150,8 +150,8 @@ Directory tree:
async-ts
dist
- async-ts.esm.js
- async-ts.esm.js.map
+ async-ts.esm.mjs
+ async-ts.esm.mjs.map
async-ts.js
async-ts.js.map
async-ts.umd.js
@@ -167,8 +167,8 @@ async-ts
Build \\"async-ts\\" to dist:
117 B: async-ts.js.gz
91 B: async-ts.js.br
-128 B: async-ts.esm.js.gz
-108 B: async-ts.esm.js.br
+128 B: async-ts.esm.mjs.gz
+108 B: async-ts.esm.mjs.br
217 B: async-ts.umd.js.gz
164 B: async-ts.umd.js.br"
`;
@@ -177,7 +177,7 @@ exports[`fixtures build async-ts with microbundle 2`] = `7`;
exports[`fixtures build async-ts with microbundle 3`] = `
"var o=/*#__PURE__*/function(){function o(){}return o.prototype.foo=function(){return Promise.resolve()},o}();export{o as MyClass};
-//# sourceMappingURL=async-ts.esm.js.map
+//# sourceMappingURL=async-ts.esm.mjs.map
"
`;
@@ -207,8 +207,8 @@ Directory tree:
basic
dist
- basic-lib.esm.js
- basic-lib.esm.js.map
+ basic-lib.esm.mjs
+ basic-lib.esm.mjs.map
basic-lib.js
basic-lib.js.map
basic-lib.umd.js
@@ -222,8 +222,8 @@ basic
Build \\"basic-lib\\" to dist:
187 B: basic-lib.js.gz
138 B: basic-lib.js.br
-188 B: basic-lib.esm.js.gz
-139 B: basic-lib.esm.js.br
+188 B: basic-lib.esm.mjs.gz
+139 B: basic-lib.esm.mjs.br
273 B: basic-lib.umd.js.gz
211 B: basic-lib.umd.js.br"
`;
@@ -232,7 +232,7 @@ exports[`fixtures build basic with microbundle 2`] = `6`;
exports[`fixtures build basic with microbundle 3`] = `
"var r=function(){try{var r=arguments;return Promise.resolve([].slice.call(r).reduce(function(r,e){return r+e},0))}catch(r){return Promise.reject(r)}};export default function(){try{var e=arguments,t=[].slice.call(e);return Promise.resolve(r.apply(void 0,t)).then(function(e){return Promise.resolve(r.apply(void 0,t)).then(function(r){return[e,r]})})}catch(r){return Promise.reject(r)}}
-//# sourceMappingURL=basic-lib.esm.js.map
+//# sourceMappingURL=basic-lib.esm.mjs.map
"
`;
@@ -255,8 +255,8 @@ Directory tree:
basic-babelrc
dist
- basic-babelrc.esm.js
- basic-babelrc.esm.js.map
+ basic-babelrc.esm.mjs
+ basic-babelrc.esm.mjs.map
basic-babelrc.js
basic-babelrc.js.map
basic-babelrc.umd.js
@@ -269,8 +269,8 @@ basic-babelrc
Build \\"basic-babelrc\\" to dist:
122 B: basic-babelrc.js.gz
91 B: basic-babelrc.js.br
-122 B: basic-babelrc.esm.js.gz
-91 B: basic-babelrc.esm.js.br
+122 B: basic-babelrc.esm.mjs.gz
+91 B: basic-babelrc.esm.mjs.br
158 B: basic-babelrc.umd.js.gz
121 B: basic-babelrc.umd.js.br"
`;
@@ -279,7 +279,7 @@ exports[`fixtures build basic-babelrc with microbundle 2`] = `6`;
exports[`fixtures build basic-babelrc with microbundle 3`] = `
"function r(r){return void 0===r&&(r=function(r){throw new Error(\\"required!\\")}()),!0===r||function(r){throw new Error(\\"Falsey!\\")}()}r(!0),r(!1);
-//# sourceMappingURL=basic-babelrc.esm.js.map
+//# sourceMappingURL=basic-babelrc.esm.mjs.map
"
`;
@@ -302,8 +302,8 @@ Directory tree:
basic-compress-false
dist
- basic-compress-false.esm.js
- basic-compress-false.esm.js.map
+ basic-compress-false.esm.mjs
+ basic-compress-false.esm.mjs.map
basic-compress-false.js
basic-compress-false.js.map
basic-compress-false.umd.js
@@ -317,8 +317,8 @@ basic-compress-false
Build \\"basic-compress-false\\" to dist:
260 B: basic-compress-false.js.gz
206 B: basic-compress-false.js.br
-258 B: basic-compress-false.esm.js.gz
-209 B: basic-compress-false.esm.js.br
+258 B: basic-compress-false.esm.mjs.gz
+209 B: basic-compress-false.esm.mjs.br
383 B: basic-compress-false.umd.js.gz
305 B: basic-compress-false.umd.js.br"
`;
@@ -352,7 +352,7 @@ var index = (function () {
});
export default index;
-//# sourceMappingURL=basic-compress-false.esm.js.map
+//# sourceMappingURL=basic-compress-false.esm.mjs.map
"
`;
@@ -434,8 +434,8 @@ basic-css
dist
basic-css.css
basic-css.css.map
- basic-css.esm.js
- basic-css.esm.js.map
+ basic-css.esm.mjs
+ basic-css.esm.mjs.map
basic-css.js
basic-css.js.map
basic-css.umd.js
@@ -449,8 +449,8 @@ basic-css
Build \\"basic-css\\" to dist:
107 B: basic-css.js.gz
60 B: basic-css.js.br
-109 B: basic-css.esm.js.gz
-67 B: basic-css.esm.js.br
+109 B: basic-css.esm.mjs.gz
+67 B: basic-css.esm.mjs.br
195 B: basic-css.umd.js.gz
138 B: basic-css.umd.js.br"
`;
@@ -464,7 +464,7 @@ exports[`fixtures build basic-css with microbundle 3`] = `
exports[`fixtures build basic-css with microbundle 4`] = `
"function e(){var e=document.createElement(\\"div\\");return e.className=\\"testing\\",e}export default e;
-//# sourceMappingURL=basic-css.esm.js.map
+//# sourceMappingURL=basic-css.esm.mjs.map
"
`;
@@ -487,8 +487,8 @@ Directory tree:
basic-dashed-external
dist
- basic-dashed-external.esm.js
- basic-dashed-external.esm.js.map
+ basic-dashed-external.esm.mjs
+ basic-dashed-external.esm.mjs.map
basic-dashed-external.js
basic-dashed-external.js.map
basic-dashed-external.umd.js
@@ -502,8 +502,8 @@ basic-dashed-external
Build \\"basic-dashed-external\\" to dist:
276 B: basic-dashed-external.js.gz
212 B: basic-dashed-external.js.br
-214 B: basic-dashed-external.esm.js.gz
-164 B: basic-dashed-external.esm.js.br
+214 B: basic-dashed-external.esm.mjs.gz
+164 B: basic-dashed-external.esm.mjs.br
357 B: basic-dashed-external.umd.js.gz
285 B: basic-dashed-external.umd.js.br"
`;
@@ -512,7 +512,7 @@ exports[`fixtures build basic-dashed-external with microbundle 2`] = `6`;
exports[`fixtures build basic-dashed-external with microbundle 3`] = `
"import r from\\"tiny-glob\\";var e=function(){try{var r=arguments;return Promise.resolve([].slice.call(r).reduce(function(r,e){return r+e},0))}catch(r){return Promise.reject(r)}};console.log(r);export default function(){try{var r=arguments,t=[].slice.call(r);return Promise.resolve(e.apply(void 0,t)).then(function(r){return Promise.resolve(e.apply(void 0,t)).then(function(e){return[r,e]})})}catch(r){return Promise.reject(r)}}
-//# sourceMappingURL=basic-dashed-external.esm.js.map
+//# sourceMappingURL=basic-dashed-external.esm.mjs.map
"
`;
@@ -535,8 +535,8 @@ Directory tree:
basic-flow
dist
- basic-lib-flow.esm.js
- basic-lib-flow.esm.js.map
+ basic-lib-flow.esm.mjs
+ basic-lib-flow.esm.mjs.map
basic-lib-flow.js
basic-lib-flow.js.map
basic-lib-flow.umd.js
@@ -550,8 +550,8 @@ basic-flow
Build \\"basic-lib-flow\\" to dist:
57 B: basic-lib-flow.js.gz
43 B: basic-lib-flow.js.br
-56 B: basic-lib-flow.esm.js.gz
-42 B: basic-lib-flow.esm.js.br
+56 B: basic-lib-flow.esm.mjs.gz
+42 B: basic-lib-flow.esm.mjs.br
171 B: basic-lib-flow.umd.js.gz
132 B: basic-lib-flow.umd.js.br"
`;
@@ -560,7 +560,7 @@ exports[`fixtures build basic-flow with microbundle 2`] = `6`;
exports[`fixtures build basic-flow with microbundle 3`] = `
"export default[\\"banana\\",\\"raspberry\\"];
-//# sourceMappingURL=basic-lib-flow.esm.js.map
+//# sourceMappingURL=basic-lib-flow.esm.mjs.map
"
`;
@@ -583,8 +583,8 @@ Directory tree:
basic-json
dist
- basic-json.esm.js
- basic-json.esm.js.map
+ basic-json.esm.mjs
+ basic-json.esm.mjs.map
basic-json.js
basic-json.js.map
basic-json.umd.js
@@ -598,8 +598,8 @@ basic-json
Build \\"basic-json\\" to dist:
93 B: basic-json.js.gz
65 B: basic-json.js.br
-92 B: basic-json.esm.js.gz
-64 B: basic-json.esm.js.br
+92 B: basic-json.esm.mjs.gz
+64 B: basic-json.esm.mjs.br
180 B: basic-json.umd.js.gz
129 B: basic-json.umd.js.br"
`;
@@ -608,7 +608,7 @@ exports[`fixtures build basic-json with microbundle 2`] = `6`;
exports[`fixtures build basic-json with microbundle 3`] = `
"var e={test:\\"true\\"};export default function(){return Promise.resolve(e)}
-//# sourceMappingURL=basic-json.esm.js.map
+//# sourceMappingURL=basic-json.esm.mjs.map
"
`;
@@ -633,14 +633,14 @@ basic-multi-source
a.js
b.js
dist
- a.esm.js
- a.esm.js.map
+ a.esm.mjs
+ a.esm.mjs.map
a.js
a.js.map
a.umd.js
a.umd.js.map
- b.esm.js
- b.esm.js.map
+ b.esm.mjs
+ b.esm.mjs.map
b.js
b.js.map
b.umd.js
@@ -651,14 +651,14 @@ basic-multi-source
Build \\"basic-multi-source\\" to dist:
43 B: a.js.gz
27 B: a.js.br
-43 B: a.esm.js.gz
-27 B: a.esm.js.br
+43 B: a.esm.mjs.gz
+27 B: a.esm.mjs.br
99 B: a.umd.js.gz
84 B: a.umd.js.br
43 B: b.js.gz
27 B: b.js.br
-43 B: b.esm.js.gz
-27 B: b.esm.js.br
+43 B: b.esm.mjs.gz
+27 B: b.esm.mjs.br
99 B: b.umd.js.gz
79 B: b.umd.js.br"
`;
@@ -667,7 +667,7 @@ exports[`fixtures build basic-multi-source with microbundle 2`] = `12`;
exports[`fixtures build basic-multi-source with microbundle 3`] = `
"console.log(\\"i am a\\");
-//# sourceMappingURL=a.esm.js.map
+//# sourceMappingURL=a.esm.mjs.map
"
`;
@@ -685,7 +685,7 @@ exports[`fixtures build basic-multi-source with microbundle 5`] = `
exports[`fixtures build basic-multi-source with microbundle 6`] = `
"console.log(\\"i am b\\");
-//# sourceMappingURL=b.esm.js.map
+//# sourceMappingURL=b.esm.mjs.map
"
`;
@@ -708,8 +708,8 @@ Directory tree:
basic-no-compress
dist
- basic-no-compress.esm.js
- basic-no-compress.esm.js.map
+ basic-no-compress.esm.mjs
+ basic-no-compress.esm.mjs.map
basic-no-compress.js
basic-no-compress.js.map
basic-no-compress.umd.js
@@ -723,8 +723,8 @@ basic-no-compress
Build \\"basic-no-compress\\" to dist:
260 B: basic-no-compress.js.gz
206 B: basic-no-compress.js.br
-258 B: basic-no-compress.esm.js.gz
-209 B: basic-no-compress.esm.js.br
+258 B: basic-no-compress.esm.mjs.gz
+209 B: basic-no-compress.esm.mjs.br
381 B: basic-no-compress.umd.js.gz
310 B: basic-no-compress.umd.js.br"
`;
@@ -758,7 +758,7 @@ var index = (function () {
});
export default index;
-//# sourceMappingURL=basic-no-compress.esm.js.map
+//# sourceMappingURL=basic-no-compress.esm.mjs.map
"
`;
@@ -911,8 +911,8 @@ Directory tree:
basic-ts
dist
- basic-lib-ts.esm.js
- basic-lib-ts.esm.js.map
+ basic-lib-ts.esm.mjs
+ basic-lib-ts.esm.mjs.map
basic-lib-ts.js
basic-lib-ts.js.map
basic-lib-ts.umd.js
@@ -930,8 +930,8 @@ basic-ts
Build \\"basic-lib-ts\\" to dist:
118 B: basic-lib-ts.js.gz
94 B: basic-lib-ts.js.br
-118 B: basic-lib-ts.esm.js.gz
-97 B: basic-lib-ts.esm.js.br
+118 B: basic-lib-ts.esm.mjs.gz
+97 B: basic-lib-ts.esm.mjs.br
201 B: basic-lib-ts.umd.js.gz
150 B: basic-lib-ts.umd.js.br"
`;
@@ -940,7 +940,7 @@ exports[`fixtures build basic-ts with microbundle 2`] = `8`;
exports[`fixtures build basic-ts with microbundle 3`] = `
"var n=new(/*#__PURE__*/function(){function n(){}return n.prototype.drive=function(n){return!0},n}());export default n;
-//# sourceMappingURL=basic-lib-ts.esm.js.map
+//# sourceMappingURL=basic-lib-ts.esm.mjs.map
"
`;
@@ -980,8 +980,8 @@ Directory tree:
basic-tsx
dist
- basic-lib-tsx.esm.js
- basic-lib-tsx.esm.js.map
+ basic-lib-tsx.esm.mjs
+ basic-lib-tsx.esm.mjs.map
basic-lib-tsx.js
basic-lib-tsx.js.map
basic-lib-tsx.umd.js
@@ -997,8 +997,8 @@ basic-tsx
Build \\"basic-lib-tsx\\" to dist:
213 B: basic-lib-tsx.js.gz
164 B: basic-lib-tsx.js.br
-218 B: basic-lib-tsx.esm.js.gz
-172 B: basic-lib-tsx.esm.js.br
+218 B: basic-lib-tsx.esm.mjs.gz
+172 B: basic-lib-tsx.esm.mjs.br
298 B: basic-lib-tsx.umd.js.gz
232 B: basic-lib-tsx.umd.js.br"
`;
@@ -1007,7 +1007,7 @@ exports[`fixtures build basic-tsx with microbundle 2`] = `7`;
exports[`fixtures build basic-tsx with microbundle 3`] = `
"var n=function(n,r){return{tag:n,props:r,children:[].slice.call(arguments,2)}},r=/*#__PURE__*/function(){function r(){}return r.prototype.render=function(){return n(\\"div\\",{id:\\"app\\"},n(\\"h1\\",null,\\"Hello, World!\\"),n(\\"p\\",null,\\"A JSX demo.\\"))},r}();export default r;
-//# sourceMappingURL=basic-lib-tsx.esm.js.map
+//# sourceMappingURL=basic-lib-tsx.esm.mjs.map
"
`;
@@ -1038,8 +1038,8 @@ Directory tree:
basic
dist
- basic.esm.js
- basic.esm.js.map
+ basic.esm.mjs
+ basic.esm.mjs.map
basic.js
basic.js.map
basic.umd.js
@@ -1053,8 +1053,8 @@ basic
Build \\"basic\\" to dist:
187 B: basic.js.gz
138 B: basic.js.br
-188 B: basic.esm.js.gz
-139 B: basic.esm.js.br
+188 B: basic.esm.mjs.gz
+139 B: basic.esm.mjs.br
269 B: basic.umd.js.gz
198 B: basic.umd.js.br"
`;
@@ -1063,7 +1063,7 @@ exports[`fixtures build basic-with-cwd with microbundle 2`] = `6`;
exports[`fixtures build basic-with-cwd with microbundle 3`] = `
"var r=function(){try{var r=arguments;return Promise.resolve([].slice.call(r).reduce(function(r,e){return r+e},0))}catch(r){return Promise.reject(r)}};export default function(){try{var e=arguments,t=[].slice.call(e);return Promise.resolve(r.apply(void 0,t)).then(function(e){return Promise.resolve(r.apply(void 0,t)).then(function(r){return[e,r]})})}catch(r){return Promise.reject(r)}}
-//# sourceMappingURL=basic.esm.js.map
+//# sourceMappingURL=basic.esm.mjs.map
"
`;
@@ -1086,8 +1086,8 @@ Directory tree:
class-decorators-ts
dist
- class-decorators-ts.esm.js
- class-decorators-ts.esm.js.map
+ class-decorators-ts.esm.mjs
+ class-decorators-ts.esm.mjs.map
class-decorators-ts.js
class-decorators-ts.js.map
class-decorators-ts.umd.js
@@ -1103,8 +1103,8 @@ class-decorators-ts
Build \\"class-decorators-ts\\" to dist:
348 B: class-decorators-ts.js.gz
288 B: class-decorators-ts.js.br
-348 B: class-decorators-ts.esm.js.gz
-288 B: class-decorators-ts.esm.js.br
+348 B: class-decorators-ts.esm.mjs.gz
+288 B: class-decorators-ts.esm.mjs.br
415 B: class-decorators-ts.umd.js.gz
353 B: class-decorators-ts.umd.js.br"
`;
@@ -1113,7 +1113,7 @@ exports[`fixtures build class-decorators-ts with microbundle 2`] = `7`;
exports[`fixtures build class-decorators-ts with microbundle 3`] = `
"var e=/*#__PURE__*/function(){function e(e){this.greeting=e}return e.prototype.greet=function(){return\\"Hello, \\"+this.greeting},e}(),t=new(e=function(e,t,r,n){var o,c=arguments.length,l=c<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if(\\"object\\"==typeof Reflect&&\\"function\\"==typeof Reflect.decorate)l=Reflect.decorate(e,t,r,n);else for(var f=e.length-1;f>=0;f--)(o=e[f])&&(l=(c<3?o(l):c>3?o(t,r,l):o(t,r))||l);return c>3&&l&&Object.defineProperty(t,r,l),l}([function(e){Object.seal(e),Object.seal(e.prototype)}],e))(\\"Hello World\\");export default t;
-//# sourceMappingURL=class-decorators-ts.esm.js.map
+//# sourceMappingURL=class-decorators-ts.esm.mjs.map
"
`;
@@ -1147,8 +1147,8 @@ Directory tree:
class-properties
dist
- class-properties.esm.js
- class-properties.esm.js.map
+ class-properties.esm.mjs
+ class-properties.esm.mjs.map
class-properties.js
class-properties.js.map
class-properties.umd.js
@@ -1161,8 +1161,8 @@ class-properties
Build \\"class-properties\\" to dist:
93 B: class-properties.js.gz
79 B: class-properties.js.br
-96 B: class-properties.esm.js.gz
-85 B: class-properties.esm.js.br
+96 B: class-properties.esm.mjs.gz
+85 B: class-properties.esm.mjs.br
197 B: class-properties.umd.js.gz
150 B: class-properties.umd.js.br"
`;
@@ -1171,7 +1171,7 @@ exports[`fixtures build class-properties with microbundle 2`] = `6`;
exports[`fixtures build class-properties with microbundle 3`] = `
"var a=function(){this.baz=3};a.bar=2;var r=new a;export default r;export{a as Foo};
-//# sourceMappingURL=class-properties.esm.js.map
+//# sourceMappingURL=class-properties.esm.mjs.map
"
`;
@@ -1195,7 +1195,7 @@ Directory tree:
css-modules--false
dist
css-modules--false.css
- css-modules--false.esm.js
+ css-modules--false.esm.mjs
css-modules--false.js
css-modules--false.umd.js
package.json
@@ -1208,8 +1208,8 @@ css-modules--false
Build \\"css-modules--false\\" to dist:
49 B: css-modules--false.js.gz
23 B: css-modules--false.js.br
-52 B: css-modules--false.esm.js.gz
-36 B: css-modules--false.esm.js.br
+52 B: css-modules--false.esm.mjs.gz
+36 B: css-modules--false.esm.mjs.br
156 B: css-modules--false.umd.js.gz
109 B: css-modules--false.umd.js.br"
`;
@@ -1241,7 +1241,7 @@ Directory tree:
css-modules--null
dist
css-modules--null.css
- css-modules--null.esm.js
+ css-modules--null.esm.mjs
css-modules--null.js
css-modules--null.umd.js
package.json
@@ -1254,8 +1254,8 @@ css-modules--null
Build \\"css-modules--null\\" to dist:
110 B: css-modules--null.js.gz
72 B: css-modules--null.js.br
-112 B: css-modules--null.esm.js.gz
-77 B: css-modules--null.esm.js.br
+112 B: css-modules--null.esm.mjs.gz
+77 B: css-modules--null.esm.mjs.br
200 B: css-modules--null.umd.js.gz
140 B: css-modules--null.umd.js.br"
`;
@@ -1287,7 +1287,7 @@ Directory tree:
css-modules--string
dist
css-modules--string.css
- css-modules--string.esm.js
+ css-modules--string.esm.mjs
css-modules--string.js
css-modules--string.umd.js
package.json
@@ -1300,8 +1300,8 @@ css-modules--string
Build \\"css-modules--string\\" to dist:
166 B: css-modules--string.js.gz
118 B: css-modules--string.js.br
-168 B: css-modules--string.esm.js.gz
-122 B: css-modules--string.esm.js.br
+168 B: css-modules--string.esm.mjs.gz
+122 B: css-modules--string.esm.mjs.br
263 B: css-modules--string.umd.js.gz
192 B: css-modules--string.umd.js.br"
`;
@@ -1333,7 +1333,7 @@ Directory tree:
css-modules--true
dist
css-modules--true.css
- css-modules--true.esm.js
+ css-modules--true.esm.mjs
css-modules--true.js
css-modules--true.umd.js
package.json
@@ -1346,8 +1346,8 @@ css-modules--true
Build \\"css-modules--true\\" to dist:
139 B: css-modules--true.js.gz
94 B: css-modules--true.js.br
-141 B: css-modules--true.esm.js.gz
-108 B: css-modules--true.esm.js.br
+141 B: css-modules--true.esm.mjs.gz
+108 B: css-modules--true.esm.mjs.br
230 B: css-modules--true.umd.js.gz
165 B: css-modules--true.umd.js.br"
`;
@@ -1378,8 +1378,8 @@ Directory tree:
custom-babelrc
dist
- custom-babelrc.esm.js
- custom-babelrc.esm.js.map
+ custom-babelrc.esm.mjs
+ custom-babelrc.esm.mjs.map
custom-babelrc.js
custom-babelrc.js.map
custom-babelrc.umd.js
@@ -1392,8 +1392,8 @@ custom-babelrc
Build \\"custom-babelrc\\" to dist:
218 B: custom-babelrc.js.gz
193 B: custom-babelrc.js.br
-222 B: custom-babelrc.esm.js.gz
-185 B: custom-babelrc.esm.js.br
+222 B: custom-babelrc.esm.mjs.gz
+185 B: custom-babelrc.esm.mjs.br
309 B: custom-babelrc.umd.js.gz
260 B: custom-babelrc.umd.js.br"
`;
@@ -1402,7 +1402,7 @@ exports[`fixtures build custom-babelrc with microbundle 2`] = `6`;
exports[`fixtures build custom-babelrc with microbundle 3`] = `
"class e{constructor(){var e,r;r=[\\"foo\\",\\"bar\\"],(e=\\"myFields\\")in this?Object.defineProperty(this,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):this[e]=r}foo(){try{return Promise.resolve(this.myFields.find(e=>\\"bar\\"===e))}catch(e){return Promise.reject(e)}}}export{e as MyClass};
-//# sourceMappingURL=custom-babelrc.esm.js.map
+//# sourceMappingURL=custom-babelrc.esm.mjs.map
"
`;
@@ -1425,8 +1425,8 @@ Directory tree:
custom-source
dist
- custom-source.esm.js
- custom-source.esm.js.map
+ custom-source.esm.mjs
+ custom-source.esm.mjs.map
custom-source.js
custom-source.js.map
custom-source.umd.js
@@ -1440,8 +1440,8 @@ custom-source
Build \\"custom-source\\" to dist:
187 B: custom-source.js.gz
138 B: custom-source.js.br
-188 B: custom-source.esm.js.gz
-139 B: custom-source.esm.js.br
+188 B: custom-source.esm.mjs.gz
+139 B: custom-source.esm.mjs.br
275 B: custom-source.umd.js.gz
203 B: custom-source.umd.js.br"
`;
@@ -1450,7 +1450,7 @@ exports[`fixtures build custom-source with microbundle 2`] = `6`;
exports[`fixtures build custom-source with microbundle 3`] = `
"var r=function(){try{var r=arguments;return Promise.resolve([].slice.call(r).reduce(function(r,e){return r+e},0))}catch(r){return Promise.reject(r)}};export default function(){try{var e=arguments,t=[].slice.call(e);return Promise.resolve(r.apply(void 0,t)).then(function(e){return Promise.resolve(r.apply(void 0,t)).then(function(r){return[e,r]})})}catch(r){return Promise.reject(r)}}
-//# sourceMappingURL=custom-source.esm.js.map
+//# sourceMappingURL=custom-source.esm.mjs.map
"
`;
@@ -1473,8 +1473,8 @@ Directory tree:
custom-source
dist
- custom-src.esm.js
- custom-src.esm.js.map
+ custom-src.esm.mjs
+ custom-src.esm.mjs.map
custom-src.js
custom-src.js.map
custom-src.umd.js
@@ -1488,8 +1488,8 @@ custom-source
Build \\"custom-src\\" to dist:
187 B: custom-src.js.gz
138 B: custom-src.js.br
-188 B: custom-src.esm.js.gz
-139 B: custom-src.esm.js.br
+188 B: custom-src.esm.mjs.gz
+139 B: custom-src.esm.mjs.br
273 B: custom-src.umd.js.gz
203 B: custom-src.umd.js.br"
`;
@@ -1498,7 +1498,7 @@ exports[`fixtures build custom-source-with-cwd with microbundle 2`] = `6`;
exports[`fixtures build custom-source-with-cwd with microbundle 3`] = `
"var r=function(){try{var r=arguments;return Promise.resolve([].slice.call(r).reduce(function(r,e){return r+e},0))}catch(r){return Promise.reject(r)}};export default function(){try{var e=arguments,t=[].slice.call(e);return Promise.resolve(r.apply(void 0,t)).then(function(e){return Promise.resolve(r.apply(void 0,t)).then(function(r){return[e,r]})})}catch(r){return Promise.reject(r)}}
-//# sourceMappingURL=custom-src.esm.js.map
+//# sourceMappingURL=custom-src.esm.mjs.map
"
`;
@@ -1521,8 +1521,8 @@ Directory tree:
default-named
dist
- default-named.esm.js
- default-named.esm.js.map
+ default-named.esm.mjs
+ default-named.esm.mjs.map
default-named.js
default-named.js.map
default-named.umd.js
@@ -1535,8 +1535,8 @@ default-named
Build \\"default-named\\" to dist:
60 B: default-named.js.gz
46 B: default-named.js.br
-74 B: default-named.esm.js.gz
-62 B: default-named.esm.js.br
+74 B: default-named.esm.mjs.gz
+62 B: default-named.esm.mjs.br
169 B: default-named.umd.js.gz
122 B: default-named.umd.js.br"
`;
@@ -1545,7 +1545,7 @@ exports[`fixtures build default-named with microbundle 2`] = `6`;
exports[`fixtures build default-named with microbundle 3`] = `
"var t=42;function e(){}export default e;export{t as foo};
-//# sourceMappingURL=default-named.esm.js.map
+//# sourceMappingURL=default-named.esm.mjs.map
"
`;
@@ -1568,7 +1568,7 @@ Directory tree:
define
dist
- define.esm.js
+ define.esm.mjs
define.js
define.umd.js
index.js
@@ -1578,8 +1578,8 @@ define
Build \\"define\\" to dist:
55 B: define.js.gz
37 B: define.js.br
-55 B: define.esm.js.gz
-37 B: define.esm.js.br
+55 B: define.esm.mjs.gz
+37 B: define.esm.mjs.br
108 B: define.umd.js.gz
78 B: define.umd.js.br"
`;
@@ -1608,14 +1608,14 @@ Directory tree:
define-expression
dist
- define-expression.esm.js
+ define-expression.esm.mjs
index.js
package.json
Build \\"define-expression\\" to dist:
-56 B: define-expression.esm.js.gz
-40 B: define-expression.esm.js.br"
+56 B: define-expression.esm.mjs.gz
+40 B: define-expression.esm.mjs.br"
`;
exports[`fixtures build define-expression with microbundle 2`] = `1`;
@@ -1632,8 +1632,8 @@ Directory tree:
esnext-ts
dist
- esnext-ts.esm.js
- esnext-ts.esm.js.map
+ esnext-ts.esm.mjs
+ esnext-ts.esm.mjs.map
esnext-ts.js
esnext-ts.js.map
esnext-ts.umd.js
@@ -1649,8 +1649,8 @@ esnext-ts
Build \\"esnext-ts\\" to dist:
1007 B: esnext-ts.js.gz
898 B: esnext-ts.js.br
-1008 B: esnext-ts.esm.js.gz
-898 B: esnext-ts.esm.js.br
+1008 B: esnext-ts.esm.mjs.gz
+898 B: esnext-ts.esm.mjs.br
1068 B: esnext-ts.umd.js.gz
950 B: esnext-ts.umd.js.br"
`;
@@ -1659,7 +1659,7 @@ exports[`fixtures build esnext-ts with microbundle 2`] = `7`;
exports[`fixtures build esnext-ts with microbundle 3`] = `
"function n(t,e,i){if(!t.s){if(i instanceof r){if(!i.s)return void(i.o=n.bind(null,t,e));1&e&&(e=i.s),i=i.v}if(i&&i.then)return void i.then(n.bind(null,t,e),n.bind(null,t,2));t.s=e,t.v=i;var o=t.o;o&&o(t)}}var t=function(){try{var t,o,u,f,h=[],c=!0,v=!1,a=i(function(){return function(i,f){try{var v=function(){t=function(n){var t;if(\\"undefined\\"!=typeof Symbol){if(Symbol.asyncIterator&&null!=(t=n[Symbol.asyncIterator]))return t.call(n);if(Symbol.iterator&&null!=(t=n[Symbol.iterator]))return t.call(n)}throw new TypeError(\\"Object is not async iterable\\")}([1,2]);var i=function(t,i,o){for(var u;;){var f=t();if(e(f)&&(f=f.v),!f)return h;if(f.then){u=0;break}var h=o();if(h&&h.then){if(!e(h)){u=1;break}h=h.s}if(i){var c=i();if(c&&c.then&&!e(c)){u=2;break}}}var v=new r,a=n.bind(null,v,2);return(0===u?f.then(s):1===u?h.then(l):c.then(d)).then(void 0,a),v;function l(r){h=r;do{if(i&&(c=i())&&c.then&&!e(c))return void c.then(d).then(void 0,a);if(!(f=t())||e(f)&&!f.v)return void n(v,1,h);if(f.then)return void f.then(s).then(void 0,a);e(h=o())&&(h=h.v)}while(!h||!h.then);h.then(l).then(void 0,a)}function s(t){t?(h=o())&&h.then?h.then(l).then(void 0,a):l(h):n(v,1,h)}function d(){(f=t())?f.then?f.then(s).then(void 0,a):s(f):n(v,1,h)}}(function(){return!!Promise.resolve(t.next()).then(function(n){return c=o.done,o=n,Promise.resolve(o.value).then(function(n){return u=n,!c})})},function(){return!!(c=!0)},function(){h.push(u)});if(i&&i.then)return i.then(function(){})}()}catch(n){return f(n)}return v&&v.then?v.then(void 0,f):v}(0,function(n){v=!0,f=n})},function(n,r){function e(t){if(n)throw r;return r}var o=i(function(){var n=function(){if(!c&&null!=t.return)return Promise.resolve(t.return()).then(function(){})}();if(n&&n.then)return n.then(function(){})},function(n,t){if(v)throw f;if(n)throw t;return t});return o&&o.then?o.then(e):e()});return Promise.resolve(a&&a.then?a.then(function(n){return h}):h)}catch(n){return Promise.reject(n)}},r=/*#__PURE__*/function(){function t(){}return t.prototype.then=function(r,e){var i=new t,o=this.s;if(o){var u=1&o?r:e;if(u){try{n(i,1,u(this.v))}catch(t){n(i,2,t)}return i}return this}return this.o=function(t){try{var o=t.v;1&t.s?n(i,1,r?r(o):o):e?n(i,1,e(o)):n(i,2,o)}catch(t){n(i,2,t)}},i},t}();function e(n){return n instanceof r&&1&n.s}function i(n,t){try{var r=n()}catch(n){return t(!0,n)}return r&&r.then?r.then(t.bind(null,!1),t.bind(null,!0)):t(!1,r)}t().then(console.log);export default t;
-//# sourceMappingURL=esnext-ts.esm.js.map
+//# sourceMappingURL=esnext-ts.esm.mjs.map
"
`;
@@ -1687,7 +1687,7 @@ Directory tree:
inline-source-map
dist
- inline-source-map.esm.js
+ inline-source-map.esm.mjs
inline-source-map.js
inline-source-map.umd.js
package.json
@@ -1699,8 +1699,8 @@ inline-source-map
Build \\"inline-source-map\\" to dist:
187 B: inline-source-map.js.gz
138 B: inline-source-map.js.br
-188 B: inline-source-map.esm.js.gz
-139 B: inline-source-map.esm.js.br
+188 B: inline-source-map.esm.mjs.gz
+139 B: inline-source-map.esm.mjs.br
278 B: inline-source-map.umd.js.gz
217 B: inline-source-map.umd.js.br"
`;
@@ -1709,7 +1709,7 @@ exports[`fixtures build inline-source-map with microbundle 2`] = `3`;
exports[`fixtures build inline-source-map with microbundle 3`] = `
"var r=function(){try{var r=arguments;return Promise.resolve([].slice.call(r).reduce(function(r,e){return r+e},0))}catch(r){return Promise.reject(r)}};export default function(){try{var e=arguments,t=[].slice.call(e);return Promise.resolve(r.apply(void 0,t)).then(function(e){return Promise.resolve(r.apply(void 0,t)).then(function(r){return[e,r]})})}catch(r){return Promise.reject(r)}}
-//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5saW5lLXNvdXJjZS1tYXAuZXNtLmpzIiwic291cmNlcyI6WyIuLi9zcmMvdHdvLmpzIiwiLi4vc3JjL2luZGV4LmpzIl0sInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCBhc3luYyBmdW5jdGlvbiB0d28oLi4uYXJncykge1xuXHRyZXR1cm4gYXJncy5yZWR1Y2UoKHRvdGFsLCB2YWx1ZSkgPT4gdG90YWwgKyB2YWx1ZSwgMCk7XG59XG4iLCJpbXBvcnQgeyB0d28gfSBmcm9tICcuL3R3byc7XG5cbmV4cG9ydCBkZWZhdWx0IGFzeW5jIGZ1bmN0aW9uKC4uLmFyZ3MpIHtcblx0cmV0dXJuIFthd2FpdCB0d28oLi4uYXJncyksIGF3YWl0IHR3byguLi5hcmdzKV07XG59XG4iXSwibmFtZXMiOlsidHdvIiwicmVkdWNlIiwidG90YWwiLCJ2YWx1ZSIsImFyZ3MiXSwibWFwcGluZ3MiOiJJQUFzQkEsaUNBQ3JCLHVCQUFPLGlCQUFLQyxPQUFPLFNBQUNDLEVBQU9DLFVBQVVELEVBQVFDLEdBQU8sSUFEckQsa0ZDRWlDQywwQ0FDbEJKLGVBQU9JLDRDQUFhSixlQUFPSSxxQkFBekMsTUFBTyxVQURSIn0=
+//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5saW5lLXNvdXJjZS1tYXAuZXNtLm1qcyIsInNvdXJjZXMiOlsiLi4vc3JjL3R3by5qcyIsIi4uL3NyYy9pbmRleC5qcyJdLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgYXN5bmMgZnVuY3Rpb24gdHdvKC4uLmFyZ3MpIHtcblx0cmV0dXJuIGFyZ3MucmVkdWNlKCh0b3RhbCwgdmFsdWUpID0+IHRvdGFsICsgdmFsdWUsIDApO1xufVxuIiwiaW1wb3J0IHsgdHdvIH0gZnJvbSAnLi90d28nO1xuXG5leHBvcnQgZGVmYXVsdCBhc3luYyBmdW5jdGlvbiguLi5hcmdzKSB7XG5cdHJldHVybiBbYXdhaXQgdHdvKC4uLmFyZ3MpLCBhd2FpdCB0d28oLi4uYXJncyldO1xufVxuIl0sIm5hbWVzIjpbInR3byIsInJlZHVjZSIsInRvdGFsIiwidmFsdWUiLCJhcmdzIl0sIm1hcHBpbmdzIjoiSUFBc0JBLGlDQUNyQix1QkFBTyxpQkFBS0MsT0FBTyxTQUFDQyxFQUFPQyxVQUFVRCxFQUFRQyxHQUFPLElBRHJELGtGQ0VpQ0MsMENBQ2xCSixlQUFPSSw0Q0FBYUosZUFBT0kscUJBQXpDLE1BQU8sVUFEUiJ9
"
`;
@@ -1732,8 +1732,8 @@ Directory tree:
jsx
dist
- jsx.esm.js
- jsx.esm.js.map
+ jsx.esm.mjs
+ jsx.esm.mjs.map
jsx.js
jsx.js.map
jsx.umd.js
@@ -1745,8 +1745,8 @@ jsx
Build \\"jsx\\" to dist:
239 B: jsx.js.gz
195 B: jsx.js.br
-237 B: jsx.esm.js.gz
-201 B: jsx.esm.js.br
+237 B: jsx.esm.mjs.gz
+201 B: jsx.esm.mjs.br
313 B: jsx.umd.js.gz
248 B: jsx.umd.js.br"
`;
@@ -1755,7 +1755,7 @@ exports[`fixtures build jsx with microbundle 2`] = `6`;
exports[`fixtures build jsx with microbundle 3`] = `
"var n=function(n,r){return{tag:n,props:r,children:[].slice.call(arguments,2)}},r=function(n){return n.children},l=/*#__PURE__*/function(){function l(){}return l.prototype.render=function(){return n(\\"div\\",{id:\\"app\\"},n(\\"h1\\",null,\\"Hello, World!\\"),n(\\"p\\",null,\\"A JSX demo.\\"),n(r,null,n(\\"p\\",null,\\"Test fragment\\")))},l}();export default l;
-//# sourceMappingURL=jsx.esm.js.map
+//# sourceMappingURL=jsx.esm.mjs.map
"
`;
@@ -1779,8 +1779,8 @@ Directory tree:
macro
dist
- macro-lib.esm.js
- macro-lib.esm.js.map
+ macro-lib.esm.mjs
+ macro-lib.esm.mjs.map
macro-lib.js
macro-lib.js.map
macro-lib.umd.js
@@ -1794,8 +1794,8 @@ macro
Build \\"macro-lib\\" to dist:
49 B: macro-lib.js.gz
33 B: macro-lib.js.br
-48 B: macro-lib.esm.js.gz
-32 B: macro-lib.esm.js.br
+48 B: macro-lib.esm.mjs.gz
+32 B: macro-lib.esm.mjs.br
156 B: macro-lib.umd.js.gz
126 B: macro-lib.umd.js.br"
`;
@@ -1804,7 +1804,7 @@ exports[`fixtures build macro with microbundle 2`] = `6`;
exports[`fixtures build macro with microbundle 3`] = `
"export default\\"name-macro\\";
-//# sourceMappingURL=macro-lib.esm.js.map
+//# sourceMappingURL=macro-lib.esm.mjs.map
"
`;
@@ -1827,8 +1827,8 @@ Directory tree:
mangle-json-file
dist
- mangle-json-file.esm.js
- mangle-json-file.esm.js.map
+ mangle-json-file.esm.mjs
+ mangle-json-file.esm.mjs.map
mangle-json-file.js
mangle-json-file.js.map
mangle-json-file.umd.js
@@ -1843,8 +1843,8 @@ mangle-json-file
Build \\"mangle-json-file\\" to dist:
103 B: mangle-json-file.js.gz
89 B: mangle-json-file.js.br
-105 B: mangle-json-file.esm.js.gz
-91 B: mangle-json-file.esm.js.br
+105 B: mangle-json-file.esm.mjs.gz
+91 B: mangle-json-file.esm.mjs.br
196 B: mangle-json-file.umd.js.gz
171 B: mangle-json-file.umd.js.br"
`;
@@ -1853,7 +1853,7 @@ exports[`fixtures build mangle-json-file with microbundle 2`] = `6`;
exports[`fixtures build mangle-json-file with microbundle 3`] = `
"var o={prop1:1,__p2:2};function r(){return console.log(o.prop1),console.log(o.__p2),o}export default r;
-//# sourceMappingURL=mangle-json-file.esm.js.map
+//# sourceMappingURL=mangle-json-file.esm.mjs.map
"
`;
@@ -1876,8 +1876,8 @@ Directory tree:
minify-config
dist
- minify-config.esm.js
- minify-config.esm.js.map
+ minify-config.esm.mjs
+ minify-config.esm.mjs.map
minify-config.js
minify-config.js.map
minify-config.umd.js
@@ -1891,8 +1891,8 @@ minify-config
Build \\"minify-config\\" to dist:
99 B: minify-config.js.gz
85 B: minify-config.js.br
-101 B: minify-config.esm.js.gz
-87 B: minify-config.esm.js.br
+101 B: minify-config.esm.mjs.gz
+87 B: minify-config.esm.mjs.br
189 B: minify-config.umd.js.gz
140 B: minify-config.umd.js.br"
`;
@@ -1901,7 +1901,7 @@ exports[`fixtures build minify-config with microbundle 2`] = `6`;
exports[`fixtures build minify-config with microbundle 3`] = `
"var o={prop1:1,o:2};function r(){return console.log(o.prop1),console.log(o.o),o}export default r;
-//# sourceMappingURL=minify-config.esm.js.map
+//# sourceMappingURL=minify-config.esm.mjs.map
"
`;
@@ -1924,8 +1924,8 @@ Directory tree:
minify-config-boolean
dist
- minify-config-boolean.esm.js
- minify-config-boolean.esm.js.map
+ minify-config-boolean.esm.mjs
+ minify-config-boolean.esm.mjs.map
minify-config-boolean.js
minify-config-boolean.js.map
minify-config-boolean.umd.js
@@ -1939,8 +1939,8 @@ minify-config-boolean
Build \\"minify-config-boolean\\" to dist:
107 B: minify-config-boolean.js.gz
84 B: minify-config-boolean.js.br
-114 B: minify-config-boolean.esm.js.gz
-90 B: minify-config-boolean.esm.js.br
+114 B: minify-config-boolean.esm.mjs.gz
+90 B: minify-config-boolean.esm.mjs.br
216 B: minify-config-boolean.umd.js.gz
159 B: minify-config-boolean.umd.js.br"
`;
@@ -1949,7 +1949,7 @@ exports[`fixtures build minify-config-boolean with microbundle 2`] = `6`;
exports[`fixtures build minify-config-boolean with microbundle 3`] = `
"var two={prop1:1,_prop2:2};function index(){return console.log(two.prop1),console.log(two._prop2),two}export default index;
-//# sourceMappingURL=minify-config-boolean.esm.js.map
+//# sourceMappingURL=minify-config-boolean.esm.mjs.map
"
`;
@@ -1972,8 +1972,8 @@ Directory tree:
minify-path-config
dist
- minify-path-config.esm.js
- minify-path-config.esm.js.map
+ minify-path-config.esm.mjs
+ minify-path-config.esm.mjs.map
minify-path-config.js
minify-path-config.js.map
minify-path-config.umd.js
@@ -1988,8 +1988,8 @@ minify-path-config
Build \\"minify-path-config\\" to dist:
103 B: minify-path-config.js.gz
89 B: minify-path-config.js.br
-105 B: minify-path-config.esm.js.gz
-91 B: minify-path-config.esm.js.br
+105 B: minify-path-config.esm.mjs.gz
+91 B: minify-path-config.esm.mjs.br
198 B: minify-path-config.umd.js.gz
152 B: minify-path-config.umd.js.br"
`;
@@ -1998,7 +1998,7 @@ exports[`fixtures build minify-path-config with microbundle 2`] = `6`;
exports[`fixtures build minify-path-config with microbundle 3`] = `
"var o={prop1:1,__p2:2};function r(){return console.log(o.prop1),console.log(o.__p2),o}export default r;
-//# sourceMappingURL=minify-path-config.esm.js.map
+//# sourceMappingURL=minify-path-config.esm.mjs.map
"
`;
@@ -2021,8 +2021,8 @@ Directory tree:
minify-path-parent-dir
dist
- minify-path-parent-dir.esm.js
- minify-path-parent-dir.esm.js.map
+ minify-path-parent-dir.esm.mjs
+ minify-path-parent-dir.esm.mjs.map
minify-path-parent-dir.js
minify-path-parent-dir.js.map
minify-path-parent-dir.umd.js
@@ -2035,8 +2035,8 @@ minify-path-parent-dir
Build \\"minify-path-parent-dir\\" to dist:
103 B: minify-path-parent-dir.js.gz
89 B: minify-path-parent-dir.js.br
-105 B: minify-path-parent-dir.esm.js.gz
-91 B: minify-path-parent-dir.esm.js.br
+105 B: minify-path-parent-dir.esm.mjs.gz
+91 B: minify-path-parent-dir.esm.mjs.br
200 B: minify-path-parent-dir.umd.js.gz
161 B: minify-path-parent-dir.umd.js.br"
`;
@@ -2045,7 +2045,7 @@ exports[`fixtures build minify-path-parent-dir-with-cwd with microbundle 2`] = `
exports[`fixtures build minify-path-parent-dir-with-cwd with microbundle 3`] = `
"var o={prop1:1,__p2:2};function r(){return console.log(o.prop1),console.log(o.__p2),o}export default r;
-//# sourceMappingURL=minify-path-parent-dir.esm.js.map
+//# sourceMappingURL=minify-path-parent-dir.esm.mjs.map
"
`;
@@ -2068,8 +2068,8 @@ Directory tree:
modern
dist
- modern-lib.modern.js
- modern-lib.modern.js.map
+ modern-lib.modern.mjs
+ modern-lib.modern.mjs.map
package.json
src
index.js
@@ -2077,15 +2077,15 @@ modern
Build \\"modern-lib\\" to dist:
-113 B: modern-lib.modern.js.gz
-92 B: modern-lib.modern.js.br"
+113 B: modern-lib.modern.mjs.gz
+92 B: modern-lib.modern.mjs.br"
`;
exports[`fixtures build modern with microbundle 2`] = `2`;
exports[`fixtures build modern with microbundle 3`] = `
"async function n(...n){return n.reduce((n,t)=>n+t,0)}async function t(...t){return[await n(...t),await n(...t)]}export default t;
-//# sourceMappingURL=modern-lib.modern.js.map
+//# sourceMappingURL=modern-lib.modern.mjs.map
"
`;
@@ -2096,12 +2096,12 @@ Directory tree:
modern-generators
dist
- modern-generators.esm.js
- modern-generators.esm.js.map
+ modern-generators.esm.mjs
+ modern-generators.esm.mjs.map
modern-generators.js
modern-generators.js.map
- modern-generators.modern.js
- modern-generators.modern.js.map
+ modern-generators.modern.mjs
+ modern-generators.modern.mjs.map
modern-generators.umd.js
modern-generators.umd.js.map
package.json
@@ -2113,10 +2113,10 @@ modern-generators
Build \\"modern-generators\\" to dist:
248 B: modern-generators.js.gz
201 B: modern-generators.js.br
-118 B: modern-generators.modern.js.gz
-99 B: modern-generators.modern.js.br
-247 B: modern-generators.esm.js.gz
-218 B: modern-generators.esm.js.br
+118 B: modern-generators.modern.mjs.gz
+99 B: modern-generators.modern.mjs.br
+247 B: modern-generators.esm.mjs.gz
+218 B: modern-generators.esm.mjs.br
326 B: modern-generators.umd.js.gz
267 B: modern-generators.umd.js.br"
`;
@@ -2125,7 +2125,7 @@ exports[`fixtures build modern-generators with microbundle 2`] = `8`;
exports[`fixtures build modern-generators with microbundle 3`] = `
"var e=/*#__PURE__*/regeneratorRuntime.mark(r);function r(){var r;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:r=0;case 1:return e.next=4,r++;case 4:e.next=1;break;case 6:case\\"end\\":return e.stop()}},e)}export default function(){try{var e=r();return Promise.resolve([e.next().value,e.next().value])}catch(e){return Promise.reject(e)}}
-//# sourceMappingURL=modern-generators.esm.js.map
+//# sourceMappingURL=modern-generators.esm.mjs.map
"
`;
@@ -2137,7 +2137,7 @@ exports[`fixtures build modern-generators with microbundle 4`] = `
exports[`fixtures build modern-generators with microbundle 5`] = `
"async function e(){const e=function*(){let e=0;for(;;)yield e++}();return[e.next().value,e.next().value]}export default e;
-//# sourceMappingURL=modern-generators.modern.js.map
+//# sourceMappingURL=modern-generators.modern.mjs.map
"
`;
@@ -2154,8 +2154,8 @@ Directory tree:
name-custom-amd
dist
- name-custom-amd.esm.js
- name-custom-amd.esm.js.map
+ name-custom-amd.esm.mjs
+ name-custom-amd.esm.mjs.map
name-custom-amd.js
name-custom-amd.js.map
name-custom-amd.umd.js
@@ -2169,8 +2169,8 @@ name-custom-amd
Build \\"name-custom-amd\\" to dist:
187 B: name-custom-amd.js.gz
138 B: name-custom-amd.js.br
-188 B: name-custom-amd.esm.js.gz
-139 B: name-custom-amd.esm.js.br
+188 B: name-custom-amd.esm.mjs.gz
+139 B: name-custom-amd.esm.mjs.br
277 B: name-custom-amd.umd.js.gz
208 B: name-custom-amd.umd.js.br"
`;
@@ -2179,7 +2179,7 @@ exports[`fixtures build name-custom-amd with microbundle 2`] = `6`;
exports[`fixtures build name-custom-amd with microbundle 3`] = `
"var r=function(){try{var r=arguments;return Promise.resolve([].slice.call(r).reduce(function(r,e){return r+e},0))}catch(r){return Promise.reject(r)}};export default function(){try{var e=arguments,t=[].slice.call(e);return Promise.resolve(r.apply(void 0,t)).then(function(e){return Promise.resolve(r.apply(void 0,t)).then(function(r){return[e,r]})})}catch(r){return Promise.reject(r)}}
-//# sourceMappingURL=name-custom-amd.esm.js.map
+//# sourceMappingURL=name-custom-amd.esm.mjs.map
"
`;
@@ -2202,8 +2202,8 @@ Directory tree:
name-custom-cli
dist
- name-custom.esm.js
- name-custom.esm.js.map
+ name-custom.esm.mjs
+ name-custom.esm.mjs.map
name-custom.js
name-custom.js.map
name-custom.umd.js
@@ -2217,8 +2217,8 @@ name-custom-cli
Build \\"name-custom\\" to dist:
187 B: name-custom.js.gz
138 B: name-custom.js.br
-188 B: name-custom.esm.js.gz
-139 B: name-custom.esm.js.br
+188 B: name-custom.esm.mjs.gz
+139 B: name-custom.esm.mjs.br
276 B: name-custom.umd.js.gz
215 B: name-custom.umd.js.br"
`;
@@ -2227,7 +2227,7 @@ exports[`fixtures build name-custom-cli with microbundle 2`] = `6`;
exports[`fixtures build name-custom-cli with microbundle 3`] = `
"var r=function(){try{var r=arguments;return Promise.resolve([].slice.call(r).reduce(function(r,e){return r+e},0))}catch(r){return Promise.reject(r)}};export default function(){try{var e=arguments,t=[].slice.call(e);return Promise.resolve(r.apply(void 0,t)).then(function(e){return Promise.resolve(r.apply(void 0,t)).then(function(r){return[e,r]})})}catch(r){return Promise.reject(r)}}
-//# sourceMappingURL=name-custom.esm.js.map
+//# sourceMappingURL=name-custom.esm.mjs.map
"
`;
@@ -2250,8 +2250,8 @@ Directory tree:
no-pkg
dist
- no-pkg.esm.js
- no-pkg.esm.js.map
+ no-pkg.esm.mjs
+ no-pkg.esm.mjs.map
no-pkg.js
no-pkg.js.map
no-pkg.umd.js
@@ -2264,8 +2264,8 @@ no-pkg
Build \\"no-pkg\\" to dist:
187 B: no-pkg.js.gz
138 B: no-pkg.js.br
-188 B: no-pkg.esm.js.gz
-139 B: no-pkg.esm.js.br
+188 B: no-pkg.esm.mjs.gz
+139 B: no-pkg.esm.mjs.br
270 B: no-pkg.umd.js.gz
216 B: no-pkg.umd.js.br"
`;
@@ -2274,7 +2274,7 @@ exports[`fixtures build no-pkg with microbundle 2`] = `6`;
exports[`fixtures build no-pkg with microbundle 3`] = `
"var r=function(){try{var r=arguments;return Promise.resolve([].slice.call(r).reduce(function(r,e){return r+e},0))}catch(r){return Promise.reject(r)}};export default function(){try{var e=arguments,t=[].slice.call(e);return Promise.resolve(r.apply(void 0,t)).then(function(e){return Promise.resolve(r.apply(void 0,t)).then(function(r){return[e,r]})})}catch(r){return Promise.reject(r)}}
-//# sourceMappingURL=no-pkg.esm.js.map
+//# sourceMappingURL=no-pkg.esm.mjs.map
"
`;
@@ -2297,8 +2297,8 @@ Directory tree:
no-pkg-name
dist
- no-pkg-name.esm.js
- no-pkg-name.esm.js.map
+ no-pkg-name.esm.mjs
+ no-pkg-name.esm.mjs.map
no-pkg-name.js
no-pkg-name.js.map
no-pkg-name.umd.js
@@ -2312,8 +2312,8 @@ no-pkg-name
Build \\"no-pkg-name\\" to dist:
187 B: no-pkg-name.js.gz
138 B: no-pkg-name.js.br
-188 B: no-pkg-name.esm.js.gz
-139 B: no-pkg-name.esm.js.br
+188 B: no-pkg-name.esm.mjs.gz
+139 B: no-pkg-name.esm.mjs.br
274 B: no-pkg-name.umd.js.gz
219 B: no-pkg-name.umd.js.br"
`;
@@ -2322,7 +2322,7 @@ exports[`fixtures build no-pkg-name with microbundle 2`] = `6`;
exports[`fixtures build no-pkg-name with microbundle 3`] = `
"var r=function(){try{var r=arguments;return Promise.resolve([].slice.call(r).reduce(function(r,e){return r+e},0))}catch(r){return Promise.reject(r)}};export default function(){try{var e=arguments,t=[].slice.call(e);return Promise.resolve(r.apply(void 0,t)).then(function(e){return Promise.resolve(r.apply(void 0,t)).then(function(r){return[e,r]})})}catch(r){return Promise.reject(r)}}
-//# sourceMappingURL=no-pkg-name.esm.js.map
+//# sourceMappingURL=no-pkg-name.esm.mjs.map
"
`;
@@ -2346,8 +2346,8 @@ Directory tree:
optional-chaining-ts
dist
index.d.ts
- optional-chaining-ts.esm.js
- optional-chaining-ts.esm.js.map
+ optional-chaining-ts.esm.mjs
+ optional-chaining-ts.esm.mjs.map
optional-chaining-ts.js
optional-chaining-ts.js.map
optional-chaining-ts.umd.js
@@ -2362,8 +2362,8 @@ optional-chaining-ts
Build \\"optional-chaining-ts\\" to dist:
109 B: optional-chaining-ts.js.gz
88 B: optional-chaining-ts.js.br
-111 B: optional-chaining-ts.esm.js.gz
-97 B: optional-chaining-ts.esm.js.br
+111 B: optional-chaining-ts.esm.mjs.gz
+97 B: optional-chaining-ts.esm.mjs.br
210 B: optional-chaining-ts.umd.js.gz
169 B: optional-chaining-ts.umd.js.br"
`;
@@ -2381,7 +2381,7 @@ exports[`fixtures build optional-chaining-ts with microbundle 3`] = `
exports[`fixtures build optional-chaining-ts with microbundle 4`] = `
"function n(n){var r,i;return null!=(r=null==(i=n.maybeVar)?void 0:i.thing)?r:void 0}export{n as chain};
-//# sourceMappingURL=optional-chaining-ts.esm.js.map
+//# sourceMappingURL=optional-chaining-ts.esm.mjs.map
"
`;
@@ -2404,8 +2404,8 @@ Directory tree:
parameters-rest-closure
dist
- parameters-rest-closure.esm.js
- parameters-rest-closure.esm.js.map
+ parameters-rest-closure.esm.mjs
+ parameters-rest-closure.esm.mjs.map
parameters-rest-closure.js
parameters-rest-closure.js.map
parameters-rest-closure.umd.js
@@ -2418,8 +2418,8 @@ parameters-rest-closure
Build \\"parameters-rest-closure\\" to dist:
157 B: parameters-rest-closure.js.gz
115 B: parameters-rest-closure.js.br
-165 B: parameters-rest-closure.esm.js.gz
-124 B: parameters-rest-closure.esm.js.br
+165 B: parameters-rest-closure.esm.mjs.gz
+124 B: parameters-rest-closure.esm.mjs.br
247 B: parameters-rest-closure.umd.js.gz
189 B: parameters-rest-closure.umd.js.br"
`;
@@ -2428,7 +2428,7 @@ exports[`fixtures build parameters-rest-closure with microbundle 2`] = `6`;
exports[`fixtures build parameters-rest-closure with microbundle 3`] = `
"function n(n){var c=[].slice.call(arguments,1);return function(){n.apply(void 0,c)}}function c(n){var c=arguments;return function(){n.apply(void 0,[].slice.call(c,1))}}export{n as parametersRestWithClosure,c as parametersRestWithInnerArrowFunction};
-//# sourceMappingURL=parameters-rest-closure.esm.js.map
+//# sourceMappingURL=parameters-rest-closure.esm.mjs.map
"
`;
@@ -2451,8 +2451,8 @@ Directory tree:
pretty
dist
- pretty.esm.js
- pretty.esm.js.map
+ pretty.esm.mjs
+ pretty.esm.mjs.map
pretty.js
pretty.js.map
pretty.umd.js
@@ -2465,8 +2465,8 @@ pretty
Build \\"pretty\\" to dist:
6.33 kB: pretty.js.gz
5.19 kB: pretty.js.br
-6.34 kB: pretty.esm.js.gz
-5.21 kB: pretty.esm.js.br
+6.34 kB: pretty.esm.mjs.gz
+5.21 kB: pretty.esm.mjs.br
6.46 kB: pretty.umd.js.gz
5.31 kB: pretty.umd.js.br"
`;
@@ -2475,7 +2475,7 @@ exports[`fixtures build pretty with microbundle 2`] = `6`;
exports[`fixtures build pretty with microbundle 3`] = `
"var n=\\"\\\\n\\\\nThere is immense joy in just watching - watching all the little creatures in nature. I'll go over the colors one more\\\\ntime that we use: Titanium white, Thalo green, Prussian blue, Van Dyke brown, Alizarin crimson, Sap green, Cad yellow,\\\\nand Permanent red. If you don't like it - change it. It's your world. Be brave. Sometimes you learn more from your\\\\nmistakes than you do from your masterpieces.\\\\n\\\\nTrees grow in all kinds of ways. They're not all perfectly straight. Not every limb is perfect. Now let's put some happy\\\\nlittle clouds in here. We have no limits to our world. We're only limited by our imagination. The first step to doing\\\\nanything is to believe you can do it. See it finished in your mind before you ever start. Even trees need a friend. We\\\\nall need friends. And that's when it becomes fun - you don't have to spend your time thinking about what's happening -\\\\nyou just let it happen.\\\\n\\\\nरिती संपादक बेंगलूर अन्तरराष्ट्रीयकरन शीघ्र भाषा चिदंश उद्योग विस्तरणक्षमता चिदंश एकएस तरहथा। प्रोत्साहित उपेक्ष बिन्दुओ\\\\nध्येय देने गुजरना ऎसाजीस निर्माण नवंबर लिए। एसेएवं उपलब्धता मुश्किले डाले। बहतर सहायता माध्यम भाषाओ समूह\\\\n\\\\n井待品亡写回横提和指生志考結。重特天県偏切運録広詳三人転者数代歳。秀天戦機広八型希金生作事国第。年米教止証車断級弘報安楽\\\\n銀必約現獲料切。点額講問課覧傷邸出送跡出懲。編米人験由社迷入解公著片法記択昇必崎掲清。摩出元自越食多県実間旅売主注理併間\\\\n話策。小政退時年福米越給新家入解美露方堀港朝。俊間髪物縦該高報見甲購形州日事。\\\\n\\\\n🌸🍂🌃🐧🍘🏧🍮 🌶👢🔗🐥🔼🎮 🐤🍲📆👧🎼🐒 💑🍖📴🐠🍼 🎱🔮🍦💳👹 💫🏮📅🍑📭🎎 🏭💿🏫🔢👚💩 👇🌄🌗🔵💦 🔺🔡🌍🐗🏀📫\\\\n📻🍵🐰🔜🕧 🌴🌞🕙🎨🎾🔊🏰 🎑🌆🔁🌂 🕐📣📉🌴🕠📢 🎀📖🎋🔱📒💰 🍅🐻🌃🌖. 🎁🕔👎🎷📀📞 🍁🔫🍀🌃📹 💈📂💶👕 🍡📰👛🐻\\\\n🍖🐽💫📼 🍆🎀💛👫🔹 🎷🕙🌱👸🕁🔝 🍸🔅👿🐡. 🐟🔐🏡🔅👾 🐱💱👺🍶 🎠🔆🎤🏥🌻🗾 👽🎯💈🏣🔊📴💆🏫 🔉🌉🍃🌻 🎅🔌🔻💣 🌸🍎🐀🌇\\\\n🗻👔📤💤🔶. 🍆👣🕕👦📦👑 🐍🐉🔶🕕 🍲👩🍍🌕📻👒📵 🔣🌋🌟👼 🔏📀🐆🍖🍮 🐁🌘🐻🏥🐡🔶🔘🏭 👡🔫🔗📊📻 🍂💧🌿📥🔚 📹💻🔌💠🌚\\\\n🐦💴🌎🌞🏤.\\\\n\\\\nThere is immense joy in just watching - watching all the little creatures in nature. I'll go over the colors one more\\\\ntime that we use: Titanium white, Thalo green, Prussian blue, Van Dyke brown, Alizarin crimson, Sap green, Cad yellow,\\\\nand Permanent red. If you don't like it - change it. It's your world. Be brave. Sometimes you learn more from your\\\\nmistakes than you do from your masterpieces. That's why I paint - because I can create the kind of world I want - and I\\\\ncan make this world as happy as I want it. I was blessed with a very steady hand; and it comes in very handy when you're\\\\ndoing these little delicate things. We'll paint one happy little tree right here. These things happen automatically. All\\\\nyou have to do is just let them happen.\\\\n\\\\n🐻🍘💀🐪 🕧🎂🕃🍵🏠 💎🌄🐐📘🐄 🍂🏤👊🍖 👆🍂📫👪🐈🕢👓 👯🕞🏉🍚🎆🔠🌵 🎭🎎💵📮📭 🔪💨📢📕 🐔📬👪🏄🐙🗽📤.\\\\n💛👴💧🎁👗💟👡💎 🎷🕡👮🗾🍷 🎪🍇🍩💰 📫🐗🎄🍍🎃 🎯🌴🐍🔉📰 👼👧🐢🕔🔷📞🍩 🔘👑🌆🌒🔣 🔆👺📴👾 🔝💑💸💒🏡🔸 🔟👞📷🔱👠\\\\n📵🏠📕🕝🐂👪 💐🎾🕁🗾👊📪. 🍉🏁👰🏡🕔💒🐯 🐟🍡📴🌿👱👢 📵💄🌊🌵🐫🍏 🎎🕠🍍💭💀👖 🎵💘🔗🍖 📧🌘🍅🕚📘🔮 👤🌾👿🐍🎽🌹\\\\n🎲🎎💅📪🐐🍢📈 🏣🐑👇👼🐄🍔 🍠📧🌊🕁🔛🐩. 🌺📊🍼🐁💼 🔈💬🌱🎑🔊🐙💲👩 🍇👞📎👻🌔 💑🕁🎲💤 🎮📃🕖📖 📻💬🔢💔🐇👬 🔨🌃📈🔞\\\\n🌒🎈👙🔥🐊 📭👍📢👊📟.\\\\n\\\\n出死問民同歴術荘面族上自。窃指写氷名続球投込光試事樹増。作合副者扶実権守安展感意環待質出。告供体企紙勢構込君奪属仕子業戦\\\\n浮私。長論攻士踊再連公雪地約政近第公。界地島命党浮国沼出問気混心未独院。朝原妙画岡性制領子金次問無浦妥混口時研。道記険健\\\\n集立根聖間前設集族山要本覧。変注再悩式付療場図験問県家界月止収文。\\\\n\\\\nलेकिन उसके संपादक उपलब्ध दिनांक प्रति सम्पर्क प्राधिकरन नाकर मुक्त कलइस वेबजाल वर्तमान समस्याओ देखने भोगोलिक केन्द्रिय\\\\nकिया खयालात विज्ञान ध्येय गटको साधन चिदंश पासपाई व्याख्या मार्गदर्शन संदेश जिवन प्रतिबध वार्तालाप किके विश्व खरिदने\\\\nहुआआदी तकनीकी संदेश सारांश असरकारक वार्तालाप चाहे पहोच। अतित पुर्णता केन्द्रिय\\\\n\\\\n👅💾🐂🔙 🐂🎠👶🐮🐛 👛💗💶🌿💒 🐐🌱🐶🌴🏤🐒 🔪🍡🎸🐛🍖 📗🎓🏊🕀🎿 🔅📋📥👳🔝 🐗👝🏄🐲 📂🎷🐎🏯💎🐹 📲🍍🏥🔂🕚🐉🎤\\\\n🌕🐴📐🎪💋. 💔👂🐗📷🎐 🌹📔💒📝👎📭 🔖🍶💺🕘 🔡💘🎪🔚🔯👉 💯🎉👠🎁🐌💵 👌🔉🎹🕒💕🍁 🏡🍢🔹🔷👀💦🏉👀 👑🐺🐁🏤\\\\n🎺🍁🐙🐮🌃🕢🐟 🍶🎃🕕🔦 🐧🔝💔💚🔫👍 🌉🔁🌄📺 👓🎳📧🌆💖🍋🕔. 🍥🔘🗼📟 🍹🔸🔰🕣🌍 🏡💽🍬👗👧 📩👬🌻🐐🌞🌎🐵🔛 🏆🌹🍰🔬📕\\\\n👋🎩🍓🌏👙 🎁🏃🎌🍳🔋👎📔 🐈🌽🔘💮 🏬🐷💿🕕. 📕👖📦📡 🎅🎺🏭🍗💜💷🐦 💻💚🐪🕠🔀 💰🍹💶🍶🎥📄 🌛👕🐲🐣🍷🎬 🐥🎯🔵🎹\\\\n🌿👌🐚🍛🏪 🌵📞💃📗👱👩 📟🐸🌺🐅👮 💚🐦💉💞🌛 🔼🔤👓🏡💩.\\\\n\\\\n\\\\nयधपि बाजार तकरीबन आंतरजाल प्राधिकरन लगती संदेश एसलिये बिन्दुओ प्रोत्साहित जानकारी ढांचामात्रुभाषा बाजार बदले प्रमान\\\\nअनुवाद विकेन्द्रित पसंद ढांचा हमारि जोवे उद्योग संस्थान और्४५० विकसित उदेश लेकिन सकती वार्तालाप लाभान्वित संदेश उदेश\\\\nपहोच। लचकनहि अनुवाद सुविधा एकत्रित कीने सक्षम भीयह अत्यंत लचकनहि निरपेक्ष कराना हमारि प्राप्त पुर्णता प्रतिबध्दता होगा\\\\nउन्हे जाएन खयालात पहोचाना\\\\n\\\\n散待望会窮縮囲前賀理格顔欧製暮景初子加。首稿覧析回未帯則号医間本取退埋帯品。右歳約幻病護指極講賞京応。野受移供頑特公却報\\\\n法利務水提士政駐物際。角媛分地昧況面日残金真福方雨入顔作化。最刊情感売校見強移本説注辞。経必好以小球生音明優去験見政感治\\\\n報付。講刊切記勝帯載豪著転読金止。金子森午模移言兆埠関価亡出目載。\\\\n\\\\nWork on one thing at a time. Don't get carried away - we have plenty of time. Everything is happy if you choose to make\\\\nit that way. Happy painting, God bless. You can create anything that makes you happy. Just make a decision and let it\\\\ngo. Nice little clouds playing around in the sky.You can do anything here - the only pre-requisite is that it makes you\\\\nhappy. I'm going to mix up a little color. We’ll use Van Dyke Brown, Permanent Red, and a little bit of Prussian Blue.\\\\nLet's make some happy little clouds in our world.\\\\n\\\\nपहेला गएआप स्वतंत्र प्राधिकरन सेऔर अनुकूल ब्रौशर बिन्दुओमे सदस्य गुजरना तकनिकल वैश्विक सकते बनाति चिदंश चाहे कुशलता\\\\nवर्तमान प्रोत्साहित देने विवरन पहोचाना विकेन्द्रियकरण अनुकूल विभाजनक्षमता औषधिक अन्य खरिदे दिये आवश्यक समस्याए कम्प्युटर\\\\nविनिमय अविरोधता लाभान्वित लाभो ढांचा\\\\n\\\\n抄聞調時得直決移警撃覧進聞滑公政央。日探劇票選伊追短青功書更将奈府成多。味治理育月漬安意散護良読京。芳豚大度面傾府山応著\\\\n器地捜志。止高棋戻管明証経処流自勝動続。装載聞視属王減通橋説主費事業情芸。追若得本臭稿事馬予治川劇覧記今竹犯破育食。参兆\\\\n徹括単写東家素講舞校食医咋存務代連子。球設国事検問周東集題聞供奈。\\\\n\\\\n🍊🌆📛🍛🌊🍡🍒 🔦🐟🐵🍚🌐🍛🐏 🔆💍📟🎧 🔐📤💺🐒 🔥🔬🐣💹🌻👚 🎰👯🎡🗻💯🐉🌗 🍐👣🐯🔖📚 💡📟👨🍮🍼💛📞 🕕🐁🌾🏧💻📷\\\\n💗🐢🏥🎵🐰🍉 🏥🔎💛💘🔧🍛🎿 🍟🌰🐴🏫🎀 🎷🌿🌴🏤🍢📳🍺 🐗👷🌳👦📩🌁 🐂🔜🔙📕. 🌎🍠📓📠🕡 🎽🔺🔱🌔📗🎤 🎫🍃👚🍤🐽🌰\\\\n🕠🌉📪🍒🐃💲 🎢🔯👶🔙🔚🕝 🍮📒🏉🏨🐝🌿 👔💫🏁🎺 🐸💞🌈🐸 📣🔯📅🐍🐴 🌑🌍🌛👀 🕂👟🐕📃🎇🔞 🍮🔏🍥👨 🐪📲🐐🎁 🍥🔁📑💮🌘.\\\\n🌏🎎🍛👯 🔈🎸💨🏧📚 🏪💼🎣🔚 🐤💳💁👓 👃🍆🕘🐋👬🐣 🕚🏃🌄🔷🌈🔖 💥💧🔴🌛🍁👦 💣🐐🕓🎠🕚🕞🏭 💨👓🏢🌓🔄. 📪🔜💹👤👂🐭\\\\n🕚🔎🐂🏂👍📻 👾💠🌕📻🎍 🐟🔬🏢💍 👓👠👤🎐💸👝 🔟💕🕛💊 🍩🌙👬🐘 🍪🔙📉💔🐝🕝 📭🕡🎼💈📇🔡 👓🍁🎾👯👨 🏇🍱🐢🌛\\\\n🎇🐩📴🎋🕁📎🎈 🐌👱📎🍹👆 👐🍐📗👽🐹💜 📭🌔🌅🍯👀.\\\\n\\\\n🔜🐰🏊🍃🐮 🔪🔐📇🐩 🐬👔🍙🍩💉 🏉👩👔🍞🍟🌂 🍺🕔🌖🔪🔩🍥 🎓🍒🌅🐘💛 🐔🐊📶🐊 👂📌👂🍺 💗🐳🎠📧🏭💧 🐝📅🍆🔞🏆\\\\n👇🔂🐺🔬🎯🔳🎐🎍 💖💅🐲🔭📔🏊🔋 🐨📫🕢🎁. 🐯💁🔘📰🐪 💥👭🍘🎴📣💂💄 🐏🔊🐚👔🎿🐙 🔕🐞💹📁 🔊👴👬👪 👠📱👃📍 🏢🐃🍯🍹🗻\\\\n🐩💮👲👠 🍏🎽📄🐋 🔣💉🔉📒💸🎭👎 💁🗾🔵🐪🍣 🍃🔝💥🔒👴. 📦🔟🔶💷🍥 🍚🕤👦🍻🔥🍹 👄🌜🐑🌀🐃🔪🕦 🌟🐶🍞🕥🌛 👮🐄🏬🎴👂💼📵\\\\n🌋📐🐲👥 🔒🏭🔭💿🎫🎄 💓🐓🎐🎁👔📟 💌🍇🎶👷🎬 🌌💀🎸💡 📔🐢💁🔊👘🐳🌞 🎩📝💟🍼💦🔄 🕒🍼🏧🎄🔃💐. 🎆🌜👗👿 🐁🌑💮👙🎌👞\\\\n🏫📙🌌🕙🐥 👓🌑💎💸📹📒 👋🐎🍡🎾👸🗽 📢📓🌍🏮📳🔈 👶🐷🐭🎿🔴🗾🏬 🌆🔈🍡💞💭🎨. \\";export{n as allTheIpsum};
-//# sourceMappingURL=pretty.esm.js.map
+//# sourceMappingURL=pretty.esm.mjs.map
"
`;
@@ -2532,8 +2532,8 @@ Directory tree:
pure
dist
- pure.esm.js
- pure.esm.js.map
+ pure.esm.mjs
+ pure.esm.mjs.map
pure.js
pure.js.map
pure.umd.js
@@ -2546,8 +2546,8 @@ pure
Build \\"pure\\" to dist:
65 B: pure.js.gz
44 B: pure.js.br
-71 B: pure.esm.js.gz
-49 B: pure.esm.js.br
+71 B: pure.esm.mjs.gz
+49 B: pure.esm.mjs.br
167 B: pure.umd.js.gz
125 B: pure.umd.js.br"
`;
@@ -2556,7 +2556,7 @@ exports[`fixtures build pure with microbundle 2`] = `6`;
exports[`fixtures build pure with microbundle 3`] = `
"function o(){return\\"hello world\\"}export{o as foo};
-//# sourceMappingURL=pure.esm.js.map
+//# sourceMappingURL=pure.esm.mjs.map
"
`;
@@ -2579,8 +2579,8 @@ Directory tree:
raw
dist
- raw.esm.js
- raw.esm.js.map
+ raw.esm.mjs
+ raw.esm.mjs.map
raw.js
raw.js.map
raw.umd.js
@@ -2593,8 +2593,8 @@ raw
Build \\"raw\\" to dist:
1389 B: raw.js.gz
1160 B: raw.js.br
-1398 B: raw.esm.js.gz
-1169 B: raw.esm.js.br
+1398 B: raw.esm.mjs.gz
+1169 B: raw.esm.mjs.br
1500 B: raw.umd.js.gz
1248 B: raw.umd.js.br"
`;
@@ -2603,7 +2603,7 @@ exports[`fixtures build raw with microbundle 2`] = `6`;
exports[`fixtures build raw with microbundle 3`] = `
"var e=\\"\\\\n\\\\tWe might as well make some Almighty mountains today as well, what the heck.\\\\n\\\\tIn your imagination you can go anywhere you want. Nice little fluffy clouds\\\\n\\\\tlaying around in the sky being lazy. You have to make those little noises or\\\\n\\\\tit won't work. Clouds are free they come and go as they please.\\\\n\\\\n\\\\tTrees grow in all kinds of ways. They're not all perfectly straight. Not\\\\n\\\\tevery limb is perfect. Now let's put some happy little clouds in here. We\\\\n\\\\thave no limits to our world. We're only limited by our imagination. The\\\\n\\\\tfirst step to doing anything is to believe you can do it. See it finished\\\\n\\\\tin your mind before you ever start. Even trees need a friend. We all need\\\\n\\\\tfriends. And that's when it becomes fun - you don't have to spend your\\\\n\\\\ttime thinking about what's happening - you just let it happen.\\\\n\\\\n\\\\tI thought today we would do a happy little picture. We don't have to be\\\\n\\\\tconcerned about it. We just have to let it fall where it will. I'm gonna\\\\n\\\\tstart with a little Alizarin crimson and a touch of Prussian blue Be so\\\\n\\\\tvery light. Be a gentle whisper. The only prerequisite is that it makes\\\\n\\\\tyou happy. If it makes you happy then it's good. This is truly an almighty\\\\n\\\\tmountain.\\\\n\\\\n\\\\tThat's why I paint - because I can create the kind of world I want - and I\\\\n\\\\tcan make this world as happy as I want it. I was blessed with a very steady\\\\n\\\\thand; and it comes in very handy when you're doing these little delicate\\\\n\\\\tthings. We'll paint one happy little tree right here. These things happen\\\\n\\\\tautomatically. All you have to do is just let them happen.\\\\n\\\\n\\\\tYou can do anything here - the only pre-requisite is that it makes you\\\\n\\\\thappy. I'm going to mix up a little color. We’ll use Van Dyke Brown,\\\\n\\\\tPermanent Red, and a little bit of Prussian Blue. Let's make some happy\\\\n\\\\tlittle clouds in our world.\\\\n\\\\n\\\\tWork on one thing at a time. Don't get carried away - we have plenty of\\\\n\\\\ttime. Everything is happy if you choose to make it that way. Happy\\\\n\\\\tpainting, God bless. You can create anything that makes you happy. Just\\\\n\\\\tmake a decision and let it go. Nice little clouds playing around in the\\\\n\\\\tsky.\\\\n\\\\n\\\\tAnytime you learn something your time and energy are not wasted. Van Dyke\\\\n\\\\tBrown is a very nice brown, it's almost like a chocolate brown. It's\\\\n\\\\timportant to me that you're happy. In nature, dead trees are just as normal\\\\n\\\\tas live trees. Painting should do one thing. It should put happiness in\\\\n\\\\tyour heart.\\\\n\\\\n\\\\tThere is immense joy in just watching - watching all the little creatures\\\\n\\\\tin nature. I'll go over the colors one more time that we use: Titanium\\\\n\\\\twhite, Thalo green, Prussian blue, Van Dyke brown, Alizarin crimson, Sap\\\\n\\\\tgreen, Cad yellow, and Permanent red. If you don't like it - change it.\\\\n\\\\tIt's your world. Be brave. Sometimes you learn more from your mistakes than\\\\n\\\\tyou do from your masterpieces.\\";export{e as OneKilobyteOfBobRoss};
-//# sourceMappingURL=raw.esm.js.map
+//# sourceMappingURL=raw.esm.mjs.map
"
`;
@@ -2626,8 +2626,8 @@ Directory tree:
shebang
dist
- shebang.esm.js
- shebang.esm.js.map
+ shebang.esm.mjs
+ shebang.esm.mjs.map
shebang.js
shebang.js.map
shebang.umd.js
@@ -2640,8 +2640,8 @@ shebang
Build \\"shebang\\" to dist:
85 B: shebang.js.gz
62 B: shebang.js.br
-89 B: shebang.esm.js.gz
-70 B: shebang.esm.js.br
+89 B: shebang.esm.mjs.gz
+70 B: shebang.esm.mjs.br
183 B: shebang.umd.js.gz
145 B: shebang.umd.js.br"
`;
@@ -2651,7 +2651,7 @@ exports[`fixtures build shebang with microbundle 2`] = `6`;
exports[`fixtures build shebang with microbundle 3`] = `
"#!/usr/bin/env node
function o(){return\\"hello world\\"}export{o as foo};
-//# sourceMappingURL=shebang.esm.js.map
+//# sourceMappingURL=shebang.esm.mjs.map
"
`;
@@ -2676,8 +2676,8 @@ Directory tree:
terser-annotations
dist
- terser-annotations.esm.js
- terser-annotations.esm.js.map
+ terser-annotations.esm.mjs
+ terser-annotations.esm.mjs.map
terser-annotations.js
terser-annotations.js.map
terser-annotations.umd.js
@@ -2691,8 +2691,8 @@ terser-annotations
Build \\"terser-annotations\\" to dist:
133 B: terser-annotations.js.gz
104 B: terser-annotations.js.br
-138 B: terser-annotations.esm.js.gz
-97 B: terser-annotations.esm.js.br
+138 B: terser-annotations.esm.mjs.gz
+97 B: terser-annotations.esm.mjs.br
224 B: terser-annotations.umd.js.gz
169 B: terser-annotations.umd.js.br"
`;
@@ -2701,7 +2701,7 @@ exports[`fixtures build terser-annotations with microbundle 2`] = `6`;
exports[`fixtures build terser-annotations with microbundle 3`] = `
"function shouldBePreserved(e,n){return e-n}function main(e,n){return{inlined:/*@__INLINE__*/function(e,n){return e+n}(e,n),preserved:/*@__NOINLINE__*/shouldBePreserved(e,n)}}export default main;
-//# sourceMappingURL=terser-annotations.esm.js.map
+//# sourceMappingURL=terser-annotations.esm.mjs.map
"
`;
@@ -2724,8 +2724,8 @@ Directory tree:
ts-custom-declaration
dist
- index.esm.js
- index.esm.js.map
+ index.esm.mjs
+ index.esm.mjs.map
index.js
index.js.map
index.umd.js
@@ -2742,8 +2742,8 @@ ts-custom-declaration
Build \\"ts-custom-declarations\\" to dist:
55 B: index.js.gz
33 B: index.js.br
-61 B: index.esm.js.gz
-45 B: index.esm.js.br
+61 B: index.esm.mjs.gz
+45 B: index.esm.mjs.br
175 B: index.umd.js.gz
125 B: index.umd.js.br"
`;
@@ -2752,7 +2752,7 @@ exports[`fixtures build ts-custom-declaration with microbundle 2`] = `6`;
exports[`fixtures build ts-custom-declaration with microbundle 3`] = `
"function n(){return 42}export{n as foo};
-//# sourceMappingURL=index.esm.js.map
+//# sourceMappingURL=index.esm.mjs.map
"
`;
@@ -2782,8 +2782,8 @@ Directory tree:
ts-declaration
dist
- index.esm.js
- index.esm.js.map
+ index.esm.mjs
+ index.esm.mjs.map
index.js
index.js.map
index.umd.js
@@ -2800,8 +2800,8 @@ ts-declaration
Build \\"ts-declarations\\" to dist:
55 B: index.js.gz
33 B: index.js.br
-61 B: index.esm.js.gz
-45 B: index.esm.js.br
+61 B: index.esm.mjs.gz
+45 B: index.esm.mjs.br
171 B: index.umd.js.gz
124 B: index.umd.js.br"
`;
@@ -2810,7 +2810,7 @@ exports[`fixtures build ts-declaration with microbundle 2`] = `6`;
exports[`fixtures build ts-declaration with microbundle 3`] = `
"function n(){return 42}export{n as foo};
-//# sourceMappingURL=index.esm.js.map
+//# sourceMappingURL=index.esm.mjs.map
"
`;
@@ -2841,8 +2841,8 @@ Directory tree:
ts-jsx
dist
index.d.ts
- ts-jsx.esm.js
- ts-jsx.esm.js.map
+ ts-jsx.esm.mjs
+ ts-jsx.esm.mjs.map
ts-jsx.js
ts-jsx.js.map
ts-jsx.umd.js
@@ -2857,8 +2857,8 @@ ts-jsx
Build \\"ts-jsx\\" to dist:
130 B: ts-jsx.js.gz
94 B: ts-jsx.js.br
-131 B: ts-jsx.esm.js.gz
-111 B: ts-jsx.esm.js.br
+131 B: ts-jsx.esm.mjs.gz
+111 B: ts-jsx.esm.mjs.br
219 B: ts-jsx.umd.js.gz
176 B: ts-jsx.umd.js.br"
`;
@@ -2872,7 +2872,7 @@ exports[`fixtures build ts-jsx with microbundle 3`] = `
exports[`fixtures build ts-jsx with microbundle 4`] = `
"var n=function(n,r){return{tag:n,props:r,children:[].slice.call(arguments,2)}}(function(n){return n.children},null,\\"foo\\");export{n as foo};
-//# sourceMappingURL=ts-jsx.esm.js.map
+//# sourceMappingURL=ts-jsx.esm.mjs.map
"
`;
@@ -2897,8 +2897,8 @@ ts-mixed-exports
dist
car.d.ts
index.d.ts
- ts-mixed-exports.esm.js
- ts-mixed-exports.esm.js.map
+ ts-mixed-exports.esm.mjs
+ ts-mixed-exports.esm.mjs.map
ts-mixed-exports.js
ts-mixed-exports.js.map
ts-mixed-exports.umd.js
@@ -2914,8 +2914,8 @@ ts-mixed-exports
Build \\"ts-mixed-exports\\" to dist:
130 B: ts-mixed-exports.js.gz
104 B: ts-mixed-exports.js.br
-134 B: ts-mixed-exports.esm.js.gz
-118 B: ts-mixed-exports.esm.js.br
+134 B: ts-mixed-exports.esm.mjs.gz
+118 B: ts-mixed-exports.esm.mjs.br
228 B: ts-mixed-exports.umd.js.gz
185 B: ts-mixed-exports.umd.js.br"
`;
@@ -2942,7 +2942,7 @@ export default Ferrari;
exports[`fixtures build ts-mixed-exports with microbundle 5`] = `
"var t=/*#__PURE__*/function(){function t(){}return t.prototype.drive=function(t){return!0},t}(),n=new t;export default n;export{t as Car};
-//# sourceMappingURL=ts-mixed-exports.esm.js.map
+//# sourceMappingURL=ts-mixed-exports.esm.mjs.map
"
`;
@@ -2967,8 +2967,8 @@ ts-module
dist
foo.d.ts
index.d.ts
- ts-module.esm.js
- ts-module.esm.js.map
+ ts-module.esm.mjs
+ ts-module.esm.mjs.map
ts-module.js
ts-module.js.map
ts-module.umd.js
@@ -2984,8 +2984,8 @@ ts-module
Build \\"ts-module\\" to dist:
59 B: ts-module.js.gz
42 B: ts-module.js.br
-65 B: ts-module.esm.js.gz
-49 B: ts-module.esm.js.br
+65 B: ts-module.esm.mjs.gz
+49 B: ts-module.esm.mjs.br
167 B: ts-module.umd.js.gz
127 B: ts-module.umd.js.br"
`;
@@ -3004,7 +3004,7 @@ exports[`fixtures build ts-module with microbundle 4`] = `
exports[`fixtures build ts-module with microbundle 5`] = `
"function o(){return\\"foobar\\"}export{o as foobar};
-//# sourceMappingURL=ts-module.esm.js.map
+//# sourceMappingURL=ts-module.esm.mjs.map
"
`;
@@ -3080,10 +3080,10 @@ worker-loader
worker-35b22e56.js.map
worker-7e1b9921.js
worker-7e1b9921.js.map
- worker-loader.esm.js
- worker-loader.esm.js.map
- worker-loader.modern.js
- worker-loader.modern.js.map
+ worker-loader.esm.mjs
+ worker-loader.esm.mjs.map
+ worker-loader.modern.mjs
+ worker-loader.modern.mjs.map
package-lock.json
package.json
src
@@ -3093,12 +3093,12 @@ worker-loader
Build \\"worker-loader\\" to dist:
-140 B: worker-loader.modern.js.gz
-112 B: worker-loader.modern.js.br
+140 B: worker-loader.modern.mjs.gz
+112 B: worker-loader.modern.mjs.br
63 B: worker-7e1b9921.js.gz
54 B: worker-7e1b9921.js.br
-150 B: worker-loader.esm.js.gz
-123 B: worker-loader.esm.js.br
+150 B: worker-loader.esm.mjs.gz
+123 B: worker-loader.esm.mjs.br
81 B: worker-35b22e56.js.gz
66 B: worker-35b22e56.js.br"
`;
@@ -3119,12 +3119,12 @@ exports[`fixtures build worker-loader with microbundle 4`] = `
exports[`fixtures build worker-loader with microbundle 5`] = `
"var e=new Worker(new URL(\\"worker-35b22e56.js\\",import.meta.url),{type:\\"module\\"});e.onmessage=function(e){return\\"foobar\\"===e.data},e.postMessage(\\"foo\\");
-//# sourceMappingURL=worker-loader.esm.js.map
+//# sourceMappingURL=worker-loader.esm.mjs.map
"
`;
exports[`fixtures build worker-loader with microbundle 6`] = `
"const e=new Worker(new URL(\\"worker-7e1b9921.js\\",import.meta.url),{type:\\"module\\"});e.onmessage=e=>\\"foobar\\"===e.data,e.postMessage(\\"foo\\");
-//# sourceMappingURL=worker-loader.modern.js.map
+//# sourceMappingURL=worker-loader.modern.mjs.map
"
`;
From 8e2de0719f94a3a03d0cd67df0516cdea6fdf447 Mon Sep 17 00:00:00 2001
From: Ryan Christian <33403762+rschristian@users.noreply.github.com>
Date: Mon, 25 Apr 2022 14:33:25 -0500
Subject: [PATCH 25/50] fix: Test failures following merge (#951)
---
test/__snapshots__/index.test.js.snap | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/test/__snapshots__/index.test.js.snap b/test/__snapshots__/index.test.js.snap
index 9d159bfa..0e44f6ea 100644
--- a/test/__snapshots__/index.test.js.snap
+++ b/test/__snapshots__/index.test.js.snap
@@ -3027,8 +3027,8 @@ Directory tree:
visualizer
dist
- visualizer.esm.js
- visualizer.esm.js.map
+ visualizer.esm.mjs
+ visualizer.esm.mjs.map
visualizer.js
visualizer.js.map
visualizer.umd.js
@@ -3042,8 +3042,8 @@ visualizer
Build \\"visualizer\\" to dist:
148 B: visualizer.js.gz
107 B: visualizer.js.br
-79 B: visualizer.esm.js.gz
-64 B: visualizer.esm.js.br
+79 B: visualizer.esm.mjs.gz
+64 B: visualizer.esm.mjs.br
231 B: visualizer.umd.js.gz
195 B: visualizer.umd.js.br"
`;
@@ -3052,7 +3052,7 @@ exports[`fixtures build visualizer with microbundle 2`] = `6`;
exports[`fixtures build visualizer with microbundle 3`] = `
"import a from\\"camelcase\\";var o=a(\\"foo-bar\\");export default o;
-//# sourceMappingURL=visualizer.esm.js.map
+//# sourceMappingURL=visualizer.esm.mjs.map
"
`;
From 84c0a89dd5005af0b707ebb4fd3474746366852c Mon Sep 17 00:00:00 2001
From: Preact Bot <71229973+preact-bot@users.noreply.github.com>
Date: Tue, 26 Apr 2022 16:24:41 -0400
Subject: [PATCH 26/50] Version Packages (#927)
Co-authored-by: github-actions[bot]
---
.changeset/big-cameras-attend.md | 5 -----
.changeset/clean-ducks-push.md | 5 -----
.changeset/clean-shoes-applaud.md | 5 -----
.changeset/clever-chicken-end.md | 5 -----
.changeset/gorgeous-singers-invite.md | 5 -----
.changeset/great-dolphins-tan.md | 5 -----
.changeset/hip-olives-allow.md | 5 -----
.changeset/light-trainers-obey.md | 5 -----
.changeset/odd-mayflies-clap.md | 5 -----
.changeset/smart-plants-appear.md | 5 -----
CHANGELOG.md | 26 ++++++++++++++++++++++++++
package.json | 2 +-
12 files changed, 27 insertions(+), 51 deletions(-)
delete mode 100644 .changeset/big-cameras-attend.md
delete mode 100644 .changeset/clean-ducks-push.md
delete mode 100644 .changeset/clean-shoes-applaud.md
delete mode 100644 .changeset/clever-chicken-end.md
delete mode 100644 .changeset/gorgeous-singers-invite.md
delete mode 100644 .changeset/great-dolphins-tan.md
delete mode 100644 .changeset/hip-olives-allow.md
delete mode 100644 .changeset/light-trainers-obey.md
delete mode 100644 .changeset/odd-mayflies-clap.md
delete mode 100644 .changeset/smart-plants-appear.md
diff --git a/.changeset/big-cameras-attend.md b/.changeset/big-cameras-attend.md
deleted file mode 100644
index ddfcd845..00000000
--- a/.changeset/big-cameras-attend.md
+++ /dev/null
@@ -1,5 +0,0 @@
----
-'microbundle': patch
----
-
-Adds information about `--compress` flag's default value w/ different targets
diff --git a/.changeset/clean-ducks-push.md b/.changeset/clean-ducks-push.md
deleted file mode 100644
index 733121ea..00000000
--- a/.changeset/clean-ducks-push.md
+++ /dev/null
@@ -1,5 +0,0 @@
----
-'microbundle': minor
----
-
-Microbundle will now output ESM using `.mjs` as the file extension when the package type is CJS
diff --git a/.changeset/clean-shoes-applaud.md b/.changeset/clean-shoes-applaud.md
deleted file mode 100644
index 019f24a9..00000000
--- a/.changeset/clean-shoes-applaud.md
+++ /dev/null
@@ -1,5 +0,0 @@
----
-'microbundle': patch
----
-
-Don't attempt to write build stats in watch mode when there has been a build error/sizeInfo is `undefined`
diff --git a/.changeset/clever-chicken-end.md b/.changeset/clever-chicken-end.md
deleted file mode 100644
index 5c95c307..00000000
--- a/.changeset/clever-chicken-end.md
+++ /dev/null
@@ -1,5 +0,0 @@
----
-'microbundle': patch
----
-
-Ensures TS plugin will begin its search for a 'tsconfig.json' in the set cwd
diff --git a/.changeset/gorgeous-singers-invite.md b/.changeset/gorgeous-singers-invite.md
deleted file mode 100644
index 1abd012c..00000000
--- a/.changeset/gorgeous-singers-invite.md
+++ /dev/null
@@ -1,5 +0,0 @@
----
-"microbundle": patch
----
-
-Fix mangle.json being overwritten with `[object Object]`
diff --git a/.changeset/great-dolphins-tan.md b/.changeset/great-dolphins-tan.md
deleted file mode 100644
index 597c3362..00000000
--- a/.changeset/great-dolphins-tan.md
+++ /dev/null
@@ -1,5 +0,0 @@
----
-'microbundle': minor
----
-
-Add --visualize flag to generate build output stats
diff --git a/.changeset/hip-olives-allow.md b/.changeset/hip-olives-allow.md
deleted file mode 100644
index fd808e26..00000000
--- a/.changeset/hip-olives-allow.md
+++ /dev/null
@@ -1,5 +0,0 @@
----
-'microbundle': patch
----
-
-Ensures hoisted node_modules are excluded from babel
diff --git a/.changeset/light-trainers-obey.md b/.changeset/light-trainers-obey.md
deleted file mode 100644
index 1ad70f93..00000000
--- a/.changeset/light-trainers-obey.md
+++ /dev/null
@@ -1,5 +0,0 @@
----
-'microbundle': patch
----
-
-Fixes CSS output from being overwritten when also generating .cjs
diff --git a/.changeset/odd-mayflies-clap.md b/.changeset/odd-mayflies-clap.md
deleted file mode 100644
index 75984f15..00000000
--- a/.changeset/odd-mayflies-clap.md
+++ /dev/null
@@ -1,5 +0,0 @@
----
-'microbundle': patch
----
-
-Documenting --jsxFragment flag
diff --git a/.changeset/smart-plants-appear.md b/.changeset/smart-plants-appear.md
deleted file mode 100644
index 6767d470..00000000
--- a/.changeset/smart-plants-appear.md
+++ /dev/null
@@ -1,5 +0,0 @@
----
-'microbundle': patch
----
-
-Corrects formatting in build completion message w/ dynamic import is used
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 9b6d8660..da946e0c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,31 @@
# microbundle
+## 0.15.0
+
+### Minor Changes
+
+- [`6f6e080`](https://github.com/developit/microbundle/commit/6f6e080f3b9ec9a223d79d24eb6e6c8dd5d72cf7) [#950](https://github.com/developit/microbundle/pull/950) Thanks [@rschristian](https://github.com/rschristian)! - Microbundle will now output ESM using `.mjs` as the file extension when the package type is CJS
+
+* [`242754f`](https://github.com/developit/microbundle/commit/242754f43cce1c25a6c475be64bbd2a525eb7cf0) [#949](https://github.com/developit/microbundle/pull/949) Thanks [@rschristian](https://github.com/rschristian)! - Add --visualize flag to generate build output stats
+
+### Patch Changes
+
+- [`c4532cc`](https://github.com/developit/microbundle/commit/c4532cc9ccd846e6bc8176414ddf2c0fc22af1f1) [#940](https://github.com/developit/microbundle/pull/940) Thanks [@rschristian](https://github.com/rschristian)! - Adds information about `--compress` flag's default value w/ different targets
+
+* [`b51b855`](https://github.com/developit/microbundle/commit/b51b855794866f3e6a0ef7dfc5672d5c1c717831) [#935](https://github.com/developit/microbundle/pull/935) Thanks [@mycoin](https://github.com/mycoin)! - Don't attempt to write build stats in watch mode when there has been a build error/sizeInfo is `undefined`
+
+- [`1d0e305`](https://github.com/developit/microbundle/commit/1d0e305d89ad010793c57fc451991a79907e1f3f) [#941](https://github.com/developit/microbundle/pull/941) Thanks [@rschristian](https://github.com/rschristian)! - Ensures TS plugin will begin its search for a 'tsconfig.json' in the set cwd
+
+* [`f04c85a`](https://github.com/developit/microbundle/commit/f04c85a1885a28a16c767665a1d5f17b13834406) [#926](https://github.com/developit/microbundle/pull/926) Thanks [@developit](https://github.com/developit)! - Fix mangle.json being overwritten with `[object Object]`
+
+- [`ecb0b02`](https://github.com/developit/microbundle/commit/ecb0b022912397bcf98550c1a783e9e0534f33e5) [#947](https://github.com/developit/microbundle/pull/947) Thanks [@rschristian](https://github.com/rschristian)! - Ensures hoisted node_modules are excluded from babel
+
+* [`392d63e`](https://github.com/developit/microbundle/commit/392d63ef437f25403c03826f77790722d0234b58) [#919](https://github.com/developit/microbundle/pull/919) Thanks [@rschristian](https://github.com/rschristian)! - Fixes CSS output from being overwritten when also generating .cjs
+
+- [`fb0a437`](https://github.com/developit/microbundle/commit/fb0a43780a7462f4876955c3412638e51a7adb97) [#930](https://github.com/developit/microbundle/pull/930) Thanks [@rschristian](https://github.com/rschristian)! - Documenting --jsxFragment flag
+
+* [`8223eba`](https://github.com/developit/microbundle/commit/8223ebaee8d750e9757b9ddbfef6384fa00f22ac) [#948](https://github.com/developit/microbundle/pull/948) Thanks [@rschristian](https://github.com/rschristian)! - Corrects formatting in build completion message w/ dynamic import is used
+
## 0.14.2
### Patch Changes
diff --git a/package.json b/package.json
index 2205277a..f58cefb7 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "microbundle",
- "version": "0.14.2",
+ "version": "0.15.0",
"description": "Zero-configuration bundler for tiny JS libs, powered by Rollup.",
"main": "dist/microbundle.js",
"source": "src/index.js",
From 6c59174aadefb5ac5cf5e7670a750c4175b1c0d5 Mon Sep 17 00:00:00 2001
From: Mohammed Anas
Date: Thu, 28 Apr 2022 17:48:21 +0000
Subject: [PATCH 27/50] Remove git.io usages (#952)
See https://github.blog/changelog/2022-04-25-git-io-deprecation/.
---
README.md | 2 +-
src/prog.js | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index 5c6d672c..bfe2eb96 100644
--- a/README.md
+++ b/README.md
@@ -345,7 +345,7 @@ Options
--generateTypes Whether or not to generate types, if `types` or `typings` is set in `package.json` then it will default to be `true`
--css Where to output CSS: "inline" or "external" (default "external")
--css-modules Configures .css to be treated as modules (default null)
- --workers Bundle module workers - see https://git.io/J3oSF (default false)
+ --workers Bundle module workers - see https://github.com/surma/rollup-plugin-off-main-thread#auto-bundling (default false)
--visualize Generate bundle makeup visualization (stats.html)
-h, --help Displays this message
diff --git a/src/prog.js b/src/prog.js
index 55adee0e..7cd4aa3e 100644
--- a/src/prog.js
+++ b/src/prog.js
@@ -86,7 +86,7 @@ export default handler => {
)
.option(
'--workers',
- 'Bundle module workers - see https://git.io/J3oSF',
+ 'Bundle module workers - see https://github.com/surma/rollup-plugin-off-main-thread#auto-bundling',
false,
)
.option(
From d16a322db712b7eb3e615d4d97828bfb74c51e4b Mon Sep 17 00:00:00 2001
From: DaviDevMod <98312056+DaviDevMod@users.noreply.github.com>
Date: Thu, 5 May 2022 00:40:15 +0100
Subject: [PATCH 28/50] Fix typo in readme (#957)
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index bfe2eb96..6bd57c6e 100644
--- a/README.md
+++ b/README.md
@@ -179,7 +179,7 @@ When deciding which bundle to use, Node.js 12+ and webpack 5+ will prefer the `e
For more information about the meaning of the different properties, refer to the [Node.js documentation](https://nodejs.org/api/packages.html#packages_package_entry_points).
For UMD builds, microbundle will use a camelCase version of the `name` field in your `package.json` as export name.
-Alternatively, this can be explicitly by adding an `"amdName"` key in your `package.json`, or passing the `--name` command line argument.
+Alternatively, this can be explicitly set by adding an `"amdName"` key in your `package.json`, or passing the `--name` command line argument.
### Usage with `{"type":"module"}` in `package.json`
From 6018e586b91125233026ca977a97b72bb6082ec6 Mon Sep 17 00:00:00 2001
From: Ryan Christian <33403762+rschristian@users.noreply.github.com>
Date: Wed, 4 May 2022 18:40:41 -0500
Subject: [PATCH 29/50] chore: Silence warnings when using 'node:' protocol
(#956)
* chore: Silence warnings when using builtins w/ 'node:' protocol
* docs: Adding changeset
---
.changeset/hot-dryers-train.md | 5 +++++
src/index.js | 2 +-
2 files changed, 6 insertions(+), 1 deletion(-)
create mode 100644 .changeset/hot-dryers-train.md
diff --git a/.changeset/hot-dryers-train.md b/.changeset/hot-dryers-train.md
new file mode 100644
index 00000000..d12b08cd
--- /dev/null
+++ b/.changeset/hot-dryers-train.md
@@ -0,0 +1,5 @@
+---
+'microbundle': patch
+---
+
+Silences warnings when using Node builtins with the 'node:...' protocol on imports. Warnings related to bare usage of these builtins were already silenced.
diff --git a/src/index.js b/src/index.js
index de04f040..950d0897 100644
--- a/src/index.js
+++ b/src/index.js
@@ -347,7 +347,7 @@ function createConfig(options, entry, format, writeMeta) {
// We want to silence rollup warnings for node builtins as we rollup-node-resolve threats them as externals anyway
// @see https://github.com/rollup/plugins/tree/master/packages/node-resolve/#resolving-built-ins-like-fs
if (options.target === 'node') {
- external = external.concat(builtinModules);
+ external = [/node:.*/].concat(builtinModules);
}
const peerDeps = Object.keys(pkg.peerDependencies || {});
From 9a4e2b2096d3824661738edb142b4658cf3d9d0b Mon Sep 17 00:00:00 2001
From: Ryan Christian <33403762+rschristian@users.noreply.github.com>
Date: Wed, 4 May 2022 18:41:08 -0500
Subject: [PATCH 30/50] chore: Bump Node target version to v12 (#954)
* chore: Bumps Node target to v12
* docs: Adding changeset
---
.changeset/breezy-cheetahs-kick.md | 5 +++++
src/index.js | 2 +-
2 files changed, 6 insertions(+), 1 deletion(-)
create mode 100644 .changeset/breezy-cheetahs-kick.md
diff --git a/.changeset/breezy-cheetahs-kick.md b/.changeset/breezy-cheetahs-kick.md
new file mode 100644
index 00000000..50f627ad
--- /dev/null
+++ b/.changeset/breezy-cheetahs-kick.md
@@ -0,0 +1,5 @@
+---
+'microbundle': patch
+---
+
+Bumps Node target to v12
diff --git a/src/index.js b/src/index.js
index 950d0897..a913c3b0 100644
--- a/src/index.js
+++ b/src/index.js
@@ -593,7 +593,7 @@ function createConfig(options, entry, format, writeMeta) {
defines,
modern,
compress: options.compress !== false,
- targets: options.target === 'node' ? { node: '8' } : undefined,
+ targets: options.target === 'node' ? { node: '12' } : undefined,
pragma: options.jsx,
pragmaFrag: options.jsxFragment,
typescript: !!useTypescript,
From 555088d17c97860a51ce43808853f4d4f0146a4c Mon Sep 17 00:00:00 2001
From: Nick Babcock
Date: Wed, 18 May 2022 19:22:34 -0500
Subject: [PATCH 31/50] Remove mention of UMD support for web workers (#962)
* Remove mention of UMD support for web workers
OMT only supports amd or esm as output, so the readme should not
mention umd as supported.
When executing microbundle with umd format and `--workers`, the web
worker will fail to be detected or bundled.
* Update README.md
Co-authored-by: Ryan Christian <33403762+rschristian@users.noreply.github.com>
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 6bd57c6e..0135a1bb 100644
--- a/README.md
+++ b/README.md
@@ -261,7 +261,7 @@ This can be customized by passing the command line argument `--css-modules "[nam
### Building Module Workers
Microbundle is able to detect and bundle Module Workers when generating bundles in the
-`es`, `umd` and `modern` formats. To use this feature, instantiate your Web Worker as follows:
+`esm` and `modern` formats. To use this feature, instantiate your Web Worker as follows:
```js
worker = new Worker(new URL('./worker.js', import.meta.url), { type: 'module' });
From 4ad4b768f0ef6f434b753c4a42cdcfe85d01c404 Mon Sep 17 00:00:00 2001
From: Anton Gilgur
Date: Thu, 2 Jun 2022 17:09:18 -0400
Subject: [PATCH 32/50] deps: upgrade rpt2 to latest v0.32.0 to fix monorepos
(#967)
* deps: upgrade rpt2 to latest v0.32.0 to fix monorepos
- rpt2 v0.30.0 supports compiling files outside of the project directory
with no additional configuration (e.g. of `rootDir`) as it upgraded
its dep of `@rollup/pluginutils` to v4, which has a breaking change
affecting `createFilter`
- essentially, the change to `@rollup/pluginutils` allows transforming
files outside of the project dir
- rpt2 v0.32.0 supports symlinks, such as with monorepos built w/ pnpm
- previously, microbundle was using rpt2 v0.29.0, which is about ~1.5
years out-of-date
* add changeset
---
.changeset/green-foxes-poke.md | 5 +
package-lock.json | 314 +++++++++++++++++----------------
package.json | 2 +-
3 files changed, 171 insertions(+), 150 deletions(-)
create mode 100644 .changeset/green-foxes-poke.md
diff --git a/.changeset/green-foxes-poke.md b/.changeset/green-foxes-poke.md
new file mode 100644
index 00000000..511e824a
--- /dev/null
+++ b/.changeset/green-foxes-poke.md
@@ -0,0 +1,5 @@
+---
+'microbundle': patch
+---
+
+deps: upgrade rpt2 to latest v0.32.0 to fix monorepos
diff --git a/package-lock.json b/package-lock.json
index 41b4d9f9..5e266a48 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "microbundle",
- "version": "0.14.2",
+ "version": "0.15.0",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "microbundle",
- "version": "0.14.2",
+ "version": "0.15.0",
"license": "MIT",
"dependencies": {
"@babel/core": "^7.12.10",
@@ -44,7 +44,7 @@
"rollup-plugin-bundle-size": "^1.0.3",
"rollup-plugin-postcss": "^4.0.0",
"rollup-plugin-terser": "^7.0.2",
- "rollup-plugin-typescript2": "^0.29.0",
+ "rollup-plugin-typescript2": "^0.32.0",
"rollup-plugin-visualizer": "^5.6.0",
"sade": "^1.7.4",
"terser": "^5.7.0",
@@ -3220,15 +3220,6 @@
"node": ">= 10.0.0"
}
},
- "node_modules/@rollup/plugin-node-resolve/node_modules/resolve": {
- "version": "1.19.0",
- "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.19.0.tgz",
- "integrity": "sha512-rArEXAgsBG4UgRGcynxWIWKFvh/XZCcS8UJdHhwy91zwAvCZIbcs+vAbflgBnNjYMs/i/i+/Ux6IZhML1yPvxg==",
- "dependencies": {
- "is-core-module": "^2.1.0",
- "path-parse": "^1.0.6"
- }
- },
"node_modules/@rollup/pluginutils": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-3.1.0.tgz",
@@ -4017,15 +4008,6 @@
"npm": ">=6"
}
},
- "node_modules/babel-plugin-macros/node_modules/resolve": {
- "version": "1.19.0",
- "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.19.0.tgz",
- "integrity": "sha512-rArEXAgsBG4UgRGcynxWIWKFvh/XZCcS8UJdHhwy91zwAvCZIbcs+vAbflgBnNjYMs/i/i+/Ux6IZhML1yPvxg==",
- "dependencies": {
- "is-core-module": "^2.1.0",
- "path-parse": "^1.0.6"
- }
- },
"node_modules/babel-plugin-transform-async-to-promises": {
"version": "0.8.15",
"resolved": "https://registry.npmjs.org/babel-plugin-transform-async-to-promises/-/babel-plugin-transform-async-to-promises-0.8.15.tgz",
@@ -7162,9 +7144,9 @@
}
},
"node_modules/find-cache-dir": {
- "version": "3.3.1",
- "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.1.tgz",
- "integrity": "sha512-t2GDMt3oGC/v+BMwzmllWDuJF/xcDtE5j/fCGbqDD7OLuJkj0cfh1YSA5VKPvwMeLFLNDBkwOKZ2X85jGLVftQ==",
+ "version": "3.3.2",
+ "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.2.tgz",
+ "integrity": "sha512-wXZV5emFEjrridIgED11OoUKLxiYjAcqot/NJdAkOhlJ+vGzwhOAfcG5OX1jP+S0PcjEn8bdMJv+g2jwQ3Onig==",
"dependencies": {
"commondir": "^1.0.1",
"make-dir": "^3.0.2",
@@ -7172,6 +7154,9 @@
},
"engines": {
"node": ">=8"
+ },
+ "funding": {
+ "url": "https://github.com/avajs/find-cache-dir?sponsor=1"
}
},
"node_modules/find-root": {
@@ -8122,11 +8107,14 @@
}
},
"node_modules/is-core-module": {
- "version": "2.2.0",
- "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.2.0.tgz",
- "integrity": "sha512-XRAfAdyyY5F5cOXn7hYQDqh2Xmii+DEfIcQGxK/uNwMHhIkPWO0g8msXcbzLe+MpGoR951MlqM/2iIlU4vKDdQ==",
+ "version": "2.9.0",
+ "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.9.0.tgz",
+ "integrity": "sha512-+5FPy5PnwmO3lvfMb0AsoPaBG+5KHUI0wYFXOtYPnVVVspTFUuMZNfNaNVRt3FZadstu2c8x23vykRW/NBoU6A==",
"dependencies": {
"has": "^1.0.3"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/is-data-descriptor": {
@@ -9667,16 +9655,6 @@
"node": ">=8"
}
},
- "node_modules/jest-resolve/node_modules/resolve": {
- "version": "1.19.0",
- "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.19.0.tgz",
- "integrity": "sha512-rArEXAgsBG4UgRGcynxWIWKFvh/XZCcS8UJdHhwy91zwAvCZIbcs+vAbflgBnNjYMs/i/i+/Ux6IZhML1yPvxg==",
- "dev": true,
- "dependencies": {
- "is-core-module": "^2.1.0",
- "path-parse": "^1.0.6"
- }
- },
"node_modules/jest-resolve/node_modules/supports-color": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
@@ -10597,6 +10575,7 @@
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz",
"integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=",
+ "dev": true,
"dependencies": {
"graceful-fs": "^4.1.6"
}
@@ -12894,9 +12873,9 @@
}
},
"node_modules/path-parse": {
- "version": "1.0.6",
- "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz",
- "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw=="
+ "version": "1.0.7",
+ "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz",
+ "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw=="
},
"node_modules/path-type": {
"version": "4.0.0",
@@ -15056,11 +15035,19 @@
"dev": true
},
"node_modules/resolve": {
- "version": "1.17.0",
- "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz",
- "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==",
+ "version": "1.22.0",
+ "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.0.tgz",
+ "integrity": "sha512-Hhtrw0nLeSrFQ7phPp4OOcVjLPIeMnRlr5mcnVuMe7M/7eBn98A3hmFRLoFo3DLZkivSYwhRUJTyPyWAk56WLw==",
"dependencies": {
- "path-parse": "^1.0.6"
+ "is-core-module": "^2.8.1",
+ "path-parse": "^1.0.7",
+ "supports-preserve-symlinks-flag": "^1.0.0"
+ },
+ "bin": {
+ "resolve": "bin/resolve"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/resolve-cwd": {
@@ -15295,15 +15282,6 @@
"node": ">=8"
}
},
- "node_modules/rollup-plugin-postcss/node_modules/resolve": {
- "version": "1.19.0",
- "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.19.0.tgz",
- "integrity": "sha512-rArEXAgsBG4UgRGcynxWIWKFvh/XZCcS8UJdHhwy91zwAvCZIbcs+vAbflgBnNjYMs/i/i+/Ux6IZhML1yPvxg==",
- "dependencies": {
- "is-core-module": "^2.1.0",
- "path-parse": "^1.0.6"
- }
- },
"node_modules/rollup-plugin-postcss/node_modules/supports-color": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
@@ -15327,34 +15305,69 @@
}
},
"node_modules/rollup-plugin-typescript2": {
- "version": "0.29.0",
- "resolved": "https://registry.npmjs.org/rollup-plugin-typescript2/-/rollup-plugin-typescript2-0.29.0.tgz",
- "integrity": "sha512-YytahBSZCIjn/elFugEGQR5qTsVhxhUwGZIsA9TmrSsC88qroGo65O5HZP/TTArH2dm0vUmYWhKchhwi2wL9bw==",
+ "version": "0.32.0",
+ "resolved": "https://registry.npmjs.org/rollup-plugin-typescript2/-/rollup-plugin-typescript2-0.32.0.tgz",
+ "integrity": "sha512-sIiCObzETQagImlNa/xVZY2aKB/7w77EzKAzpmVkXZbDuso6PrW2hdQv6m4/UuMqnzqTFWGF4FPLbVuQISeYZw==",
"dependencies": {
- "@rollup/pluginutils": "^3.1.0",
- "find-cache-dir": "^3.3.1",
- "fs-extra": "8.1.0",
- "resolve": "1.17.0",
- "tslib": "2.0.1"
+ "@rollup/pluginutils": "^4.1.2",
+ "find-cache-dir": "^3.3.2",
+ "fs-extra": "^10.0.0",
+ "resolve": "^1.20.0",
+ "tslib": "^2.4.0"
+ },
+ "peerDependencies": {
+ "rollup": ">=1.26.3",
+ "typescript": ">=2.4.0"
}
},
+ "node_modules/rollup-plugin-typescript2/node_modules/@rollup/pluginutils": {
+ "version": "4.2.1",
+ "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-4.2.1.tgz",
+ "integrity": "sha512-iKnFXr7NkdZAIHiIWE+BX5ULi/ucVFYWD6TbAV+rZctiRTY2PL6tsIKhoIOaoskiWAkgu+VsbXgUVDNLHf+InQ==",
+ "dependencies": {
+ "estree-walker": "^2.0.1",
+ "picomatch": "^2.2.2"
+ },
+ "engines": {
+ "node": ">= 8.0.0"
+ }
+ },
+ "node_modules/rollup-plugin-typescript2/node_modules/estree-walker": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz",
+ "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w=="
+ },
"node_modules/rollup-plugin-typescript2/node_modules/fs-extra": {
- "version": "8.1.0",
- "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz",
- "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==",
+ "version": "10.1.0",
+ "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz",
+ "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==",
"dependencies": {
"graceful-fs": "^4.2.0",
- "jsonfile": "^4.0.0",
- "universalify": "^0.1.0"
+ "jsonfile": "^6.0.1",
+ "universalify": "^2.0.0"
},
"engines": {
- "node": ">=6 <7 || >=8"
+ "node": ">=12"
}
},
- "node_modules/rollup-plugin-typescript2/node_modules/tslib": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.0.1.tgz",
- "integrity": "sha512-SgIkNheinmEBgx1IUNirK0TUD4X9yjjBRTqqjggWCU3pUEqIk3/Uwl3yRixYKT6WjQuGiwDv4NomL3wqRCj+CQ=="
+ "node_modules/rollup-plugin-typescript2/node_modules/jsonfile": {
+ "version": "6.1.0",
+ "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz",
+ "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==",
+ "dependencies": {
+ "universalify": "^2.0.0"
+ },
+ "optionalDependencies": {
+ "graceful-fs": "^4.1.6"
+ }
+ },
+ "node_modules/rollup-plugin-typescript2/node_modules/universalify": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz",
+ "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==",
+ "engines": {
+ "node": ">= 10.0.0"
+ }
},
"node_modules/rollup-plugin-visualizer": {
"version": "5.6.0",
@@ -16489,6 +16502,17 @@
"node": ">=8"
}
},
+ "node_modules/supports-preserve-symlinks-flag": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz",
+ "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==",
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
"node_modules/svgo": {
"version": "1.3.2",
"resolved": "https://registry.npmjs.org/svgo/-/svgo-1.3.2.tgz",
@@ -16846,9 +16870,9 @@
}
},
"node_modules/tslib": {
- "version": "2.0.3",
- "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.0.3.tgz",
- "integrity": "sha512-uZtkfKblCEQtZKBF6EBXVZeQNl82yqtDQdv+eck8u7tdPxjLu2/lp5/uPW+um2tpuxINHWy3GhiccY7QgEaVHQ=="
+ "version": "2.4.0",
+ "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz",
+ "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ=="
},
"node_modules/tsutils": {
"version": "3.17.1",
@@ -17086,6 +17110,7 @@
"version": "0.1.2",
"resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz",
"integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==",
+ "dev": true,
"engines": {
"node": ">= 4.0.0"
}
@@ -20471,17 +20496,6 @@
"deepmerge": "^4.2.2",
"is-module": "^1.0.0",
"resolve": "^1.19.0"
- },
- "dependencies": {
- "resolve": {
- "version": "1.19.0",
- "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.19.0.tgz",
- "integrity": "sha512-rArEXAgsBG4UgRGcynxWIWKFvh/XZCcS8UJdHhwy91zwAvCZIbcs+vAbflgBnNjYMs/i/i+/Ux6IZhML1yPvxg==",
- "requires": {
- "is-core-module": "^2.1.0",
- "path-parse": "^1.0.6"
- }
- }
}
},
"@rollup/pluginutils": {
@@ -21147,17 +21161,6 @@
"@babel/runtime": "^7.12.5",
"cosmiconfig": "^7.0.0",
"resolve": "^1.19.0"
- },
- "dependencies": {
- "resolve": {
- "version": "1.19.0",
- "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.19.0.tgz",
- "integrity": "sha512-rArEXAgsBG4UgRGcynxWIWKFvh/XZCcS8UJdHhwy91zwAvCZIbcs+vAbflgBnNjYMs/i/i+/Ux6IZhML1yPvxg==",
- "requires": {
- "is-core-module": "^2.1.0",
- "path-parse": "^1.0.6"
- }
- }
}
},
"babel-plugin-transform-async-to-promises": {
@@ -23693,9 +23696,9 @@
}
},
"find-cache-dir": {
- "version": "3.3.1",
- "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.1.tgz",
- "integrity": "sha512-t2GDMt3oGC/v+BMwzmllWDuJF/xcDtE5j/fCGbqDD7OLuJkj0cfh1YSA5VKPvwMeLFLNDBkwOKZ2X85jGLVftQ==",
+ "version": "3.3.2",
+ "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.2.tgz",
+ "integrity": "sha512-wXZV5emFEjrridIgED11OoUKLxiYjAcqot/NJdAkOhlJ+vGzwhOAfcG5OX1jP+S0PcjEn8bdMJv+g2jwQ3Onig==",
"requires": {
"commondir": "^1.0.1",
"make-dir": "^3.0.2",
@@ -24463,9 +24466,9 @@
}
},
"is-core-module": {
- "version": "2.2.0",
- "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.2.0.tgz",
- "integrity": "sha512-XRAfAdyyY5F5cOXn7hYQDqh2Xmii+DEfIcQGxK/uNwMHhIkPWO0g8msXcbzLe+MpGoR951MlqM/2iIlU4vKDdQ==",
+ "version": "2.9.0",
+ "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.9.0.tgz",
+ "integrity": "sha512-+5FPy5PnwmO3lvfMb0AsoPaBG+5KHUI0wYFXOtYPnVVVspTFUuMZNfNaNVRt3FZadstu2c8x23vykRW/NBoU6A==",
"requires": {
"has": "^1.0.3"
}
@@ -25726,16 +25729,6 @@
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
"dev": true
},
- "resolve": {
- "version": "1.19.0",
- "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.19.0.tgz",
- "integrity": "sha512-rArEXAgsBG4UgRGcynxWIWKFvh/XZCcS8UJdHhwy91zwAvCZIbcs+vAbflgBnNjYMs/i/i+/Ux6IZhML1yPvxg==",
- "dev": true,
- "requires": {
- "is-core-module": "^2.1.0",
- "path-parse": "^1.0.6"
- }
- },
"supports-color": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
@@ -26418,6 +26411,7 @@
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz",
"integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=",
+ "dev": true,
"requires": {
"graceful-fs": "^4.1.6"
}
@@ -28220,9 +28214,9 @@
"dev": true
},
"path-parse": {
- "version": "1.0.6",
- "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz",
- "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw=="
+ "version": "1.0.7",
+ "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz",
+ "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw=="
},
"path-type": {
"version": "4.0.0",
@@ -29948,11 +29942,13 @@
"dev": true
},
"resolve": {
- "version": "1.17.0",
- "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz",
- "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==",
+ "version": "1.22.0",
+ "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.0.tgz",
+ "integrity": "sha512-Hhtrw0nLeSrFQ7phPp4OOcVjLPIeMnRlr5mcnVuMe7M/7eBn98A3hmFRLoFo3DLZkivSYwhRUJTyPyWAk56WLw==",
"requires": {
- "path-parse": "^1.0.6"
+ "is-core-module": "^2.8.1",
+ "path-parse": "^1.0.7",
+ "supports-preserve-symlinks-flag": "^1.0.0"
}
},
"resolve-cwd": {
@@ -30141,15 +30137,6 @@
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ=="
},
- "resolve": {
- "version": "1.19.0",
- "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.19.0.tgz",
- "integrity": "sha512-rArEXAgsBG4UgRGcynxWIWKFvh/XZCcS8UJdHhwy91zwAvCZIbcs+vAbflgBnNjYMs/i/i+/Ux6IZhML1yPvxg==",
- "requires": {
- "is-core-module": "^2.1.0",
- "path-parse": "^1.0.6"
- }
- },
"supports-color": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
@@ -30172,31 +30159,54 @@
}
},
"rollup-plugin-typescript2": {
- "version": "0.29.0",
- "resolved": "https://registry.npmjs.org/rollup-plugin-typescript2/-/rollup-plugin-typescript2-0.29.0.tgz",
- "integrity": "sha512-YytahBSZCIjn/elFugEGQR5qTsVhxhUwGZIsA9TmrSsC88qroGo65O5HZP/TTArH2dm0vUmYWhKchhwi2wL9bw==",
+ "version": "0.32.0",
+ "resolved": "https://registry.npmjs.org/rollup-plugin-typescript2/-/rollup-plugin-typescript2-0.32.0.tgz",
+ "integrity": "sha512-sIiCObzETQagImlNa/xVZY2aKB/7w77EzKAzpmVkXZbDuso6PrW2hdQv6m4/UuMqnzqTFWGF4FPLbVuQISeYZw==",
"requires": {
- "@rollup/pluginutils": "^3.1.0",
- "find-cache-dir": "^3.3.1",
- "fs-extra": "8.1.0",
- "resolve": "1.17.0",
- "tslib": "2.0.1"
+ "@rollup/pluginutils": "^4.1.2",
+ "find-cache-dir": "^3.3.2",
+ "fs-extra": "^10.0.0",
+ "resolve": "^1.20.0",
+ "tslib": "^2.4.0"
},
"dependencies": {
+ "@rollup/pluginutils": {
+ "version": "4.2.1",
+ "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-4.2.1.tgz",
+ "integrity": "sha512-iKnFXr7NkdZAIHiIWE+BX5ULi/ucVFYWD6TbAV+rZctiRTY2PL6tsIKhoIOaoskiWAkgu+VsbXgUVDNLHf+InQ==",
+ "requires": {
+ "estree-walker": "^2.0.1",
+ "picomatch": "^2.2.2"
+ }
+ },
+ "estree-walker": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz",
+ "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w=="
+ },
"fs-extra": {
- "version": "8.1.0",
- "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz",
- "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==",
+ "version": "10.1.0",
+ "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz",
+ "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==",
"requires": {
"graceful-fs": "^4.2.0",
- "jsonfile": "^4.0.0",
- "universalify": "^0.1.0"
+ "jsonfile": "^6.0.1",
+ "universalify": "^2.0.0"
}
},
- "tslib": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.0.1.tgz",
- "integrity": "sha512-SgIkNheinmEBgx1IUNirK0TUD4X9yjjBRTqqjggWCU3pUEqIk3/Uwl3yRixYKT6WjQuGiwDv4NomL3wqRCj+CQ=="
+ "jsonfile": {
+ "version": "6.1.0",
+ "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz",
+ "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==",
+ "requires": {
+ "graceful-fs": "^4.1.6",
+ "universalify": "^2.0.0"
+ }
+ },
+ "universalify": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz",
+ "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ=="
}
}
},
@@ -31133,6 +31143,11 @@
}
}
},
+ "supports-preserve-symlinks-flag": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz",
+ "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w=="
+ },
"svgo": {
"version": "1.3.2",
"resolved": "https://registry.npmjs.org/svgo/-/svgo-1.3.2.tgz",
@@ -31416,9 +31431,9 @@
"dev": true
},
"tslib": {
- "version": "2.0.3",
- "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.0.3.tgz",
- "integrity": "sha512-uZtkfKblCEQtZKBF6EBXVZeQNl82yqtDQdv+eck8u7tdPxjLu2/lp5/uPW+um2tpuxINHWy3GhiccY7QgEaVHQ=="
+ "version": "2.4.0",
+ "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz",
+ "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ=="
},
"tsutils": {
"version": "3.17.1",
@@ -31601,7 +31616,8 @@
"universalify": {
"version": "0.1.2",
"resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz",
- "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg=="
+ "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==",
+ "dev": true
},
"unquote": {
"version": "1.1.1",
diff --git a/package.json b/package.json
index f58cefb7..12340793 100644
--- a/package.json
+++ b/package.json
@@ -108,7 +108,7 @@
"rollup-plugin-bundle-size": "^1.0.3",
"rollup-plugin-postcss": "^4.0.0",
"rollup-plugin-terser": "^7.0.2",
- "rollup-plugin-typescript2": "^0.29.0",
+ "rollup-plugin-typescript2": "^0.32.0",
"rollup-plugin-visualizer": "^5.6.0",
"sade": "^1.7.4",
"terser": "^5.7.0",
From cebafa121953a771f010b3cfd250a83bfc754e2c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E8=B5=B5=E4=B8=80=E8=8D=A3?=
<34162942+zyrong@users.noreply.github.com>
Date: Sat, 4 Jun 2022 15:32:49 +0800
Subject: [PATCH 33/50] fix: css compilation problems when multiple entries
(#961)
* fix: css compilation problems when multiple entries
* change minor to patch
* refactor: options.output change to absMain
* Apply suggestions from code review
Co-authored-by: Ryan Christian <33403762+rschristian@users.noreply.github.com>
---
.changeset/angry-worms-smell.md | 5 +
src/index.js | 9 +-
test/__snapshots__/index.test.js.snap | 93 +++++++++++++++++++
test/fixtures/basic-multi-source-css/a.css | 5 +
test/fixtures/basic-multi-source-css/a.js | 7 ++
test/fixtures/basic-multi-source-css/b.css | 5 +
test/fixtures/basic-multi-source-css/b.js | 7 ++
.../basic-multi-source-css/package.json | 7 ++
8 files changed, 131 insertions(+), 7 deletions(-)
create mode 100644 .changeset/angry-worms-smell.md
create mode 100644 test/fixtures/basic-multi-source-css/a.css
create mode 100644 test/fixtures/basic-multi-source-css/a.js
create mode 100644 test/fixtures/basic-multi-source-css/b.css
create mode 100644 test/fixtures/basic-multi-source-css/b.js
create mode 100644 test/fixtures/basic-multi-source-css/package.json
diff --git a/.changeset/angry-worms-smell.md b/.changeset/angry-worms-smell.md
new file mode 100644
index 00000000..7abee405
--- /dev/null
+++ b/.changeset/angry-worms-smell.md
@@ -0,0 +1,5 @@
+---
+'microbundle': patch
+---
+
+Fix for when multiple entries reference different CSS, only the CSS referenced by the first entry will be packaged
diff --git a/src/index.js b/src/index.js
index a913c3b0..709ba2a2 100644
--- a/src/index.js
+++ b/src/index.js
@@ -111,12 +111,7 @@ export default async function microbundle(inputOptions) {
for (let i = 0; i < options.entries.length; i++) {
for (let j = 0; j < formats.length; j++) {
steps.push(
- createConfig(
- options,
- options.entries[i],
- formats[j],
- i === 0 && j === 0,
- ),
+ createConfig(options, options.entries[i], formats[j], j === 0),
);
}
}
@@ -502,7 +497,7 @@ function createConfig(options, entry, format, writeMeta) {
extract:
!!writeMeta &&
options.css !== 'inline' &&
- options.output.replace(EXTENSION, '.css'),
+ absMain.replace(EXTENSION, '.css'),
minimize: options.compress,
sourceMap: options.sourcemap && options.css !== 'inline',
}),
diff --git a/test/__snapshots__/index.test.js.snap b/test/__snapshots__/index.test.js.snap
index 0e44f6ea..6657d699 100644
--- a/test/__snapshots__/index.test.js.snap
+++ b/test/__snapshots__/index.test.js.snap
@@ -701,6 +701,99 @@ exports[`fixtures build basic-multi-source with microbundle 8`] = `
"
`;
+exports[`fixtures build basic-multi-source-css with microbundle 1`] = `
+"Used script: microbundle
+
+Directory tree:
+
+basic-multi-source-css
+ a.css
+ a.js
+ b.css
+ b.js
+ dist
+ a.css
+ a.css.map
+ a.esm.mjs
+ a.esm.mjs.map
+ a.js
+ a.js.map
+ a.umd.js
+ a.umd.js.map
+ b.css
+ b.css.map
+ b.esm.mjs
+ b.esm.mjs.map
+ b.js
+ b.js.map
+ b.umd.js
+ b.umd.js.map
+ package.json
+
+
+Build \\"basic-multi-source-css\\" to dist:
+104 B: a.js.gz
+61 B: a.js.br
+105 B: a.esm.mjs.gz
+67 B: a.esm.mjs.br
+201 B: a.umd.js.gz
+133 B: a.umd.js.br
+104 B: b.js.gz
+61 B: b.js.br
+106 B: b.esm.mjs.gz
+67 B: b.esm.mjs.br
+201 B: b.umd.js.gz
+134 B: b.umd.js.br"
+`;
+
+exports[`fixtures build basic-multi-source-css with microbundle 2`] = `16`;
+
+exports[`fixtures build basic-multi-source-css with microbundle 3`] = `
+".a{display:flex;color:green;background:pink}
+/*# sourceMappingURL=a.css.map */"
+`;
+
+exports[`fixtures build basic-multi-source-css with microbundle 4`] = `
+"function e(){var e=document.createElement(\\"div\\");return e.className=\\"a\\",e}export default e;
+//# sourceMappingURL=a.esm.mjs.map
+"
+`;
+
+exports[`fixtures build basic-multi-source-css with microbundle 5`] = `
+"module.exports=function(){var e=document.createElement(\\"div\\");return e.className=\\"a\\",e};
+//# sourceMappingURL=a.js.map
+"
+`;
+
+exports[`fixtures build basic-multi-source-css with microbundle 6`] = `
+"!function(e,n){\\"object\\"==typeof exports&&\\"undefined\\"!=typeof module?module.exports=n():\\"function\\"==typeof define&&define.amd?define(n):(e||self).basicMultiSourceCss=n()}(this,function(){return function(){var e=document.createElement(\\"div\\");return e.className=\\"a\\",e}});
+//# sourceMappingURL=a.umd.js.map
+"
+`;
+
+exports[`fixtures build basic-multi-source-css with microbundle 7`] = `
+".b{display:flex;color:red;background:#00f}
+/*# sourceMappingURL=b.css.map */"
+`;
+
+exports[`fixtures build basic-multi-source-css with microbundle 8`] = `
+"function e(){var e=document.createElement(\\"div\\");return e.className=\\"b\\",e}export default e;
+//# sourceMappingURL=b.esm.mjs.map
+"
+`;
+
+exports[`fixtures build basic-multi-source-css with microbundle 9`] = `
+"module.exports=function(){var e=document.createElement(\\"div\\");return e.className=\\"b\\",e};
+//# sourceMappingURL=b.js.map
+"
+`;
+
+exports[`fixtures build basic-multi-source-css with microbundle 10`] = `
+"!function(e,n){\\"object\\"==typeof exports&&\\"undefined\\"!=typeof module?module.exports=n():\\"function\\"==typeof define&&define.amd?define(n):(e||self).basicMultiSourceCss=n()}(this,function(){return function(){var e=document.createElement(\\"div\\");return e.className=\\"b\\",e}});
+//# sourceMappingURL=b.umd.js.map
+"
+`;
+
exports[`fixtures build basic-no-compress with microbundle 1`] = `
"Used script: microbundle --no-compress
diff --git a/test/fixtures/basic-multi-source-css/a.css b/test/fixtures/basic-multi-source-css/a.css
new file mode 100644
index 00000000..317852fd
--- /dev/null
+++ b/test/fixtures/basic-multi-source-css/a.css
@@ -0,0 +1,5 @@
+.a {
+ display: flex;
+ color: green;
+ background: pink;
+}
diff --git a/test/fixtures/basic-multi-source-css/a.js b/test/fixtures/basic-multi-source-css/a.js
new file mode 100644
index 00000000..44b08a5e
--- /dev/null
+++ b/test/fixtures/basic-multi-source-css/a.js
@@ -0,0 +1,7 @@
+import './a.css';
+
+export default function () {
+ const el = document.createElement('div');
+ el.className = 'a';
+ return el;
+}
diff --git a/test/fixtures/basic-multi-source-css/b.css b/test/fixtures/basic-multi-source-css/b.css
new file mode 100644
index 00000000..36de7313
--- /dev/null
+++ b/test/fixtures/basic-multi-source-css/b.css
@@ -0,0 +1,5 @@
+.b {
+ display: flex;
+ color: red;
+ background: blue;
+}
diff --git a/test/fixtures/basic-multi-source-css/b.js b/test/fixtures/basic-multi-source-css/b.js
new file mode 100644
index 00000000..2d21df05
--- /dev/null
+++ b/test/fixtures/basic-multi-source-css/b.js
@@ -0,0 +1,7 @@
+import './b.css';
+
+export default function () {
+ const el = document.createElement('div');
+ el.className = 'b';
+ return el;
+}
diff --git a/test/fixtures/basic-multi-source-css/package.json b/test/fixtures/basic-multi-source-css/package.json
new file mode 100644
index 00000000..c0344448
--- /dev/null
+++ b/test/fixtures/basic-multi-source-css/package.json
@@ -0,0 +1,7 @@
+{
+ "name": "basic-multi-source-css",
+ "source":[
+ "./a.js",
+ "./b.js"
+ ]
+}
From 88241ddf8fc3ac18cfc1ca8ced99a413f8d2b488 Mon Sep 17 00:00:00 2001
From: PeterBurner
Date: Sat, 4 Jun 2022 09:33:48 +0200
Subject: [PATCH 34/50] fix: Incorrect transform with async/await (#565) (#968)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* fix: Incorrect transform with async/await (#565)
* Update babel-plugin-transform-async-to-promises to v0.8.18
* Add changeset
* Update jest test snapshots
Co-authored-by: Björn Saja
---
.changeset/loud-dingos-sleep.md | 5 +++++
package-lock.json | 14 +++++++-------
package.json | 2 +-
test/__snapshots__/index.test.js.snap | 18 +++++++++---------
4 files changed, 22 insertions(+), 17 deletions(-)
create mode 100644 .changeset/loud-dingos-sleep.md
diff --git a/.changeset/loud-dingos-sleep.md b/.changeset/loud-dingos-sleep.md
new file mode 100644
index 00000000..814cb150
--- /dev/null
+++ b/.changeset/loud-dingos-sleep.md
@@ -0,0 +1,5 @@
+---
+'microbundle': patch
+---
+
+deps: upgrade babel-plugin-transform-async-to-promises to latest v0.8.18 to fix #565
diff --git a/package-lock.json b/package-lock.json
index 5e266a48..dd2a8bce 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -28,7 +28,7 @@
"asyncro": "^3.0.0",
"autoprefixer": "^10.1.0",
"babel-plugin-macros": "^3.0.1",
- "babel-plugin-transform-async-to-promises": "^0.8.15",
+ "babel-plugin-transform-async-to-promises": "^0.8.18",
"babel-plugin-transform-replace-expressions": "^0.2.0",
"brotli-size": "^4.0.0",
"builtin-modules": "^3.1.0",
@@ -4009,9 +4009,9 @@
}
},
"node_modules/babel-plugin-transform-async-to-promises": {
- "version": "0.8.15",
- "resolved": "https://registry.npmjs.org/babel-plugin-transform-async-to-promises/-/babel-plugin-transform-async-to-promises-0.8.15.tgz",
- "integrity": "sha512-fDXP68ZqcinZO2WCiimCL9zhGjGXOnn3D33zvbh+yheZ/qOrNVVDDIBtAaM3Faz8TRvQzHiRKsu3hfrBAhEncQ=="
+ "version": "0.8.18",
+ "resolved": "https://registry.npmjs.org/babel-plugin-transform-async-to-promises/-/babel-plugin-transform-async-to-promises-0.8.18.tgz",
+ "integrity": "sha512-WpOrF76nUHijnNn10eBGOHZmXQC8JYRME9rOLxStOga7Av2VO53ehVFvVNImMksVtQuL2/7ZNxEgxnx7oo/3Hw=="
},
"node_modules/babel-plugin-transform-replace-expressions": {
"version": "0.2.0",
@@ -21164,9 +21164,9 @@
}
},
"babel-plugin-transform-async-to-promises": {
- "version": "0.8.15",
- "resolved": "https://registry.npmjs.org/babel-plugin-transform-async-to-promises/-/babel-plugin-transform-async-to-promises-0.8.15.tgz",
- "integrity": "sha512-fDXP68ZqcinZO2WCiimCL9zhGjGXOnn3D33zvbh+yheZ/qOrNVVDDIBtAaM3Faz8TRvQzHiRKsu3hfrBAhEncQ=="
+ "version": "0.8.18",
+ "resolved": "https://registry.npmjs.org/babel-plugin-transform-async-to-promises/-/babel-plugin-transform-async-to-promises-0.8.18.tgz",
+ "integrity": "sha512-WpOrF76nUHijnNn10eBGOHZmXQC8JYRME9rOLxStOga7Av2VO53ehVFvVNImMksVtQuL2/7ZNxEgxnx7oo/3Hw=="
},
"babel-plugin-transform-replace-expressions": {
"version": "0.2.0",
diff --git a/package.json b/package.json
index 12340793..e2af9177 100644
--- a/package.json
+++ b/package.json
@@ -92,7 +92,7 @@
"asyncro": "^3.0.0",
"autoprefixer": "^10.1.0",
"babel-plugin-macros": "^3.0.1",
- "babel-plugin-transform-async-to-promises": "^0.8.15",
+ "babel-plugin-transform-async-to-promises": "^0.8.18",
"babel-plugin-transform-replace-expressions": "^0.2.0",
"brotli-size": "^4.0.0",
"builtin-modules": "^3.1.0",
diff --git a/test/__snapshots__/index.test.js.snap b/test/__snapshots__/index.test.js.snap
index 6657d699..495874f9 100644
--- a/test/__snapshots__/index.test.js.snap
+++ b/test/__snapshots__/index.test.js.snap
@@ -1740,30 +1740,30 @@ esnext-ts
Build \\"esnext-ts\\" to dist:
-1007 B: esnext-ts.js.gz
-898 B: esnext-ts.js.br
-1008 B: esnext-ts.esm.mjs.gz
-898 B: esnext-ts.esm.mjs.br
-1068 B: esnext-ts.umd.js.gz
-950 B: esnext-ts.umd.js.br"
+1010 B: esnext-ts.js.gz
+899 B: esnext-ts.js.br
+1011 B: esnext-ts.esm.mjs.gz
+896 B: esnext-ts.esm.mjs.br
+1072 B: esnext-ts.umd.js.gz
+959 B: esnext-ts.umd.js.br"
`;
exports[`fixtures build esnext-ts with microbundle 2`] = `7`;
exports[`fixtures build esnext-ts with microbundle 3`] = `
-"function n(t,e,i){if(!t.s){if(i instanceof r){if(!i.s)return void(i.o=n.bind(null,t,e));1&e&&(e=i.s),i=i.v}if(i&&i.then)return void i.then(n.bind(null,t,e),n.bind(null,t,2));t.s=e,t.v=i;var o=t.o;o&&o(t)}}var t=function(){try{var t,o,u,f,h=[],c=!0,v=!1,a=i(function(){return function(i,f){try{var v=function(){t=function(n){var t;if(\\"undefined\\"!=typeof Symbol){if(Symbol.asyncIterator&&null!=(t=n[Symbol.asyncIterator]))return t.call(n);if(Symbol.iterator&&null!=(t=n[Symbol.iterator]))return t.call(n)}throw new TypeError(\\"Object is not async iterable\\")}([1,2]);var i=function(t,i,o){for(var u;;){var f=t();if(e(f)&&(f=f.v),!f)return h;if(f.then){u=0;break}var h=o();if(h&&h.then){if(!e(h)){u=1;break}h=h.s}if(i){var c=i();if(c&&c.then&&!e(c)){u=2;break}}}var v=new r,a=n.bind(null,v,2);return(0===u?f.then(s):1===u?h.then(l):c.then(d)).then(void 0,a),v;function l(r){h=r;do{if(i&&(c=i())&&c.then&&!e(c))return void c.then(d).then(void 0,a);if(!(f=t())||e(f)&&!f.v)return void n(v,1,h);if(f.then)return void f.then(s).then(void 0,a);e(h=o())&&(h=h.v)}while(!h||!h.then);h.then(l).then(void 0,a)}function s(t){t?(h=o())&&h.then?h.then(l).then(void 0,a):l(h):n(v,1,h)}function d(){(f=t())?f.then?f.then(s).then(void 0,a):s(f):n(v,1,h)}}(function(){return!!Promise.resolve(t.next()).then(function(n){return c=o.done,o=n,Promise.resolve(o.value).then(function(n){return u=n,!c})})},function(){return!!(c=!0)},function(){h.push(u)});if(i&&i.then)return i.then(function(){})}()}catch(n){return f(n)}return v&&v.then?v.then(void 0,f):v}(0,function(n){v=!0,f=n})},function(n,r){function e(t){if(n)throw r;return r}var o=i(function(){var n=function(){if(!c&&null!=t.return)return Promise.resolve(t.return()).then(function(){})}();if(n&&n.then)return n.then(function(){})},function(n,t){if(v)throw f;if(n)throw t;return t});return o&&o.then?o.then(e):e()});return Promise.resolve(a&&a.then?a.then(function(n){return h}):h)}catch(n){return Promise.reject(n)}},r=/*#__PURE__*/function(){function t(){}return t.prototype.then=function(r,e){var i=new t,o=this.s;if(o){var u=1&o?r:e;if(u){try{n(i,1,u(this.v))}catch(t){n(i,2,t)}return i}return this}return this.o=function(t){try{var o=t.v;1&t.s?n(i,1,r?r(o):o):e?n(i,1,e(o)):n(i,2,o)}catch(t){n(i,2,t)}},i},t}();function e(n){return n instanceof r&&1&n.s}function i(n,t){try{var r=n()}catch(n){return t(!0,n)}return r&&r.then?r.then(t.bind(null,!1),t.bind(null,!0)):t(!1,r)}t().then(console.log);export default t;
+"function n(t,e,i){if(!t.s){if(i instanceof r){if(!i.s)return void(i.o=n.bind(null,t,e));1&e&&(e=i.s),i=i.v}if(i&&i.then)return void i.then(n.bind(null,t,e),n.bind(null,t,2));t.s=e,t.v=i;var o=t.o;o&&o(t)}}var t=function(){try{var t,o,u,f,h=[],c=!0,v=!1,l=i(function(){return function(i,f){try{var v=function(){t=function(n){var t;if(\\"undefined\\"!=typeof Symbol){if(Symbol.asyncIterator&&null!=(t=n[Symbol.asyncIterator]))return t.call(n);if(Symbol.iterator&&null!=(t=n[Symbol.iterator]))return t.call(n)}throw new TypeError(\\"Object is not async iterable\\")}([1,2]);var i=function(t,i,o){for(var u;;){var f=t();if(e(f)&&(f=f.v),!f)return h;if(f.then){u=0;break}var h=o();if(h&&h.then){if(!e(h)){u=1;break}h=h.s}if(i){var c=i();if(c&&c.then&&!e(c)){u=2;break}}}var v=new r,l=n.bind(null,v,2);return(0===u?f.then(s):1===u?h.then(a):c.then(d)).then(void 0,l),v;function a(r){h=r;do{if(i&&(c=i())&&c.then&&!e(c))return void c.then(d).then(void 0,l);if(!(f=t())||e(f)&&!f.v)return void n(v,1,h);if(f.then)return void f.then(s).then(void 0,l);e(h=o())&&(h=h.v)}while(!h||!h.then);h.then(a).then(void 0,l)}function s(t){t?(h=o())&&h.then?h.then(a).then(void 0,l):a(h):n(v,1,h)}function d(){(f=t())?f.then?f.then(s).then(void 0,l):s(f):n(v,1,h)}}(function(){return Promise.resolve(t.next()).then(function(n){return c=o.done,o=n,Promise.resolve(o.value).then(function(n){return u=n,!c})})},function(){return!!(c=!0)},function(){h.push(u)});if(i&&i.then)return i.then(function(){})}()}catch(n){return f(n)}return v&&v.then?v.then(void 0,f):v}(0,function(n){v=!0,f=n})},function(n,r){function e(t){if(n)throw r;return r}var o=i(function(){var n=function(){if(!c&&null!=t.return)return Promise.resolve(t.return()).then(function(){})}();if(n&&n.then)return n.then(function(){})},function(n,t){if(v)throw f;if(n)throw t;return t});return o&&o.then?o.then(e):e()});return Promise.resolve(l&&l.then?l.then(function(n){return h}):h)}catch(n){return Promise.reject(n)}};const r=/*#__PURE__*/function(){function t(){}return t.prototype.then=function(r,e){const i=new t,o=this.s;if(o){const t=1&o?r:e;if(t){try{n(i,1,t(this.v))}catch(t){n(i,2,t)}return i}return this}return this.o=function(t){try{const o=t.v;1&t.s?n(i,1,r?r(o):o):e?n(i,1,e(o)):n(i,2,o)}catch(t){n(i,2,t)}},i},t}();function e(n){return n instanceof r&&1&n.s}function i(n,t){try{var r=n()}catch(n){return t(!0,n)}return r&&r.then?r.then(t.bind(null,!1),t.bind(null,!0)):t(!1,r)}t().then(console.log);export default t;
//# sourceMappingURL=esnext-ts.esm.mjs.map
"
`;
exports[`fixtures build esnext-ts with microbundle 4`] = `
-"function n(t,e,i){if(!t.s){if(i instanceof r){if(!i.s)return void(i.o=n.bind(null,t,e));1&e&&(e=i.s),i=i.v}if(i&&i.then)return void i.then(n.bind(null,t,e),n.bind(null,t,2));t.s=e,t.v=i;var o=t.o;o&&o(t)}}var t=function(){try{var t,o,u,f,h=[],c=!0,v=!1,a=i(function(){return function(i,f){try{var v=function(){t=function(n){var t;if(\\"undefined\\"!=typeof Symbol){if(Symbol.asyncIterator&&null!=(t=n[Symbol.asyncIterator]))return t.call(n);if(Symbol.iterator&&null!=(t=n[Symbol.iterator]))return t.call(n)}throw new TypeError(\\"Object is not async iterable\\")}([1,2]);var i=function(t,i,o){for(var u;;){var f=t();if(e(f)&&(f=f.v),!f)return h;if(f.then){u=0;break}var h=o();if(h&&h.then){if(!e(h)){u=1;break}h=h.s}if(i){var c=i();if(c&&c.then&&!e(c)){u=2;break}}}var v=new r,a=n.bind(null,v,2);return(0===u?f.then(s):1===u?h.then(l):c.then(d)).then(void 0,a),v;function l(r){h=r;do{if(i&&(c=i())&&c.then&&!e(c))return void c.then(d).then(void 0,a);if(!(f=t())||e(f)&&!f.v)return void n(v,1,h);if(f.then)return void f.then(s).then(void 0,a);e(h=o())&&(h=h.v)}while(!h||!h.then);h.then(l).then(void 0,a)}function s(t){t?(h=o())&&h.then?h.then(l).then(void 0,a):l(h):n(v,1,h)}function d(){(f=t())?f.then?f.then(s).then(void 0,a):s(f):n(v,1,h)}}(function(){return!!Promise.resolve(t.next()).then(function(n){return c=o.done,o=n,Promise.resolve(o.value).then(function(n){return u=n,!c})})},function(){return!!(c=!0)},function(){h.push(u)});if(i&&i.then)return i.then(function(){})}()}catch(n){return f(n)}return v&&v.then?v.then(void 0,f):v}(0,function(n){v=!0,f=n})},function(n,r){function e(t){if(n)throw r;return r}var o=i(function(){var n=function(){if(!c&&null!=t.return)return Promise.resolve(t.return()).then(function(){})}();if(n&&n.then)return n.then(function(){})},function(n,t){if(v)throw f;if(n)throw t;return t});return o&&o.then?o.then(e):e()});return Promise.resolve(a&&a.then?a.then(function(n){return h}):h)}catch(n){return Promise.reject(n)}},r=/*#__PURE__*/function(){function t(){}return t.prototype.then=function(r,e){var i=new t,o=this.s;if(o){var u=1&o?r:e;if(u){try{n(i,1,u(this.v))}catch(t){n(i,2,t)}return i}return this}return this.o=function(t){try{var o=t.v;1&t.s?n(i,1,r?r(o):o):e?n(i,1,e(o)):n(i,2,o)}catch(t){n(i,2,t)}},i},t}();function e(n){return n instanceof r&&1&n.s}function i(n,t){try{var r=n()}catch(n){return t(!0,n)}return r&&r.then?r.then(t.bind(null,!1),t.bind(null,!0)):t(!1,r)}t().then(console.log),module.exports=t;
+"function n(t,e,i){if(!t.s){if(i instanceof r){if(!i.s)return void(i.o=n.bind(null,t,e));1&e&&(e=i.s),i=i.v}if(i&&i.then)return void i.then(n.bind(null,t,e),n.bind(null,t,2));t.s=e,t.v=i;var o=t.o;o&&o(t)}}var t=function(){try{var t,o,u,f,h=[],c=!0,v=!1,l=i(function(){return function(i,f){try{var v=function(){t=function(n){var t;if(\\"undefined\\"!=typeof Symbol){if(Symbol.asyncIterator&&null!=(t=n[Symbol.asyncIterator]))return t.call(n);if(Symbol.iterator&&null!=(t=n[Symbol.iterator]))return t.call(n)}throw new TypeError(\\"Object is not async iterable\\")}([1,2]);var i=function(t,i,o){for(var u;;){var f=t();if(e(f)&&(f=f.v),!f)return h;if(f.then){u=0;break}var h=o();if(h&&h.then){if(!e(h)){u=1;break}h=h.s}if(i){var c=i();if(c&&c.then&&!e(c)){u=2;break}}}var v=new r,l=n.bind(null,v,2);return(0===u?f.then(s):1===u?h.then(a):c.then(d)).then(void 0,l),v;function a(r){h=r;do{if(i&&(c=i())&&c.then&&!e(c))return void c.then(d).then(void 0,l);if(!(f=t())||e(f)&&!f.v)return void n(v,1,h);if(f.then)return void f.then(s).then(void 0,l);e(h=o())&&(h=h.v)}while(!h||!h.then);h.then(a).then(void 0,l)}function s(t){t?(h=o())&&h.then?h.then(a).then(void 0,l):a(h):n(v,1,h)}function d(){(f=t())?f.then?f.then(s).then(void 0,l):s(f):n(v,1,h)}}(function(){return Promise.resolve(t.next()).then(function(n){return c=o.done,o=n,Promise.resolve(o.value).then(function(n){return u=n,!c})})},function(){return!!(c=!0)},function(){h.push(u)});if(i&&i.then)return i.then(function(){})}()}catch(n){return f(n)}return v&&v.then?v.then(void 0,f):v}(0,function(n){v=!0,f=n})},function(n,r){function e(t){if(n)throw r;return r}var o=i(function(){var n=function(){if(!c&&null!=t.return)return Promise.resolve(t.return()).then(function(){})}();if(n&&n.then)return n.then(function(){})},function(n,t){if(v)throw f;if(n)throw t;return t});return o&&o.then?o.then(e):e()});return Promise.resolve(l&&l.then?l.then(function(n){return h}):h)}catch(n){return Promise.reject(n)}};const r=/*#__PURE__*/function(){function t(){}return t.prototype.then=function(r,e){const i=new t,o=this.s;if(o){const t=1&o?r:e;if(t){try{n(i,1,t(this.v))}catch(t){n(i,2,t)}return i}return this}return this.o=function(t){try{const o=t.v;1&t.s?n(i,1,r?r(o):o):e?n(i,1,e(o)):n(i,2,o)}catch(t){n(i,2,t)}},i},t}();function e(n){return n instanceof r&&1&n.s}function i(n,t){try{var r=n()}catch(n){return t(!0,n)}return r&&r.then?r.then(t.bind(null,!1),t.bind(null,!0)):t(!1,r)}t().then(console.log),module.exports=t;
//# sourceMappingURL=esnext-ts.js.map
"
`;
exports[`fixtures build esnext-ts with microbundle 5`] = `
-"!function(n,t){\\"object\\"==typeof exports&&\\"undefined\\"!=typeof module?module.exports=t():\\"function\\"==typeof define&&define.amd?define(t):(n||self).esnextTs=t()}(this,function(){function n(t,r,i){if(!t.s){if(i instanceof e){if(!i.s)return void(i.o=n.bind(null,t,r));1&r&&(r=i.s),i=i.v}if(i&&i.then)return void i.then(n.bind(null,t,r),n.bind(null,t,2));t.s=r,t.v=i;var o=t.o;o&&o(t)}}var t=function(){try{var t,o,u,f,h=[],c=!0,l=!1,a=i(function(){return function(i,f){try{var l=function(){t=function(n){var t;if(\\"undefined\\"!=typeof Symbol){if(Symbol.asyncIterator&&null!=(t=n[Symbol.asyncIterator]))return t.call(n);if(Symbol.iterator&&null!=(t=n[Symbol.iterator]))return t.call(n)}throw new TypeError(\\"Object is not async iterable\\")}([1,2]);var i=function(t,i,o){for(var u;;){var f=t();if(r(f)&&(f=f.v),!f)return h;if(f.then){u=0;break}var h=o();if(h&&h.then){if(!r(h)){u=1;break}h=h.s}if(i){var c=i();if(c&&c.then&&!r(c)){u=2;break}}}var l=new e,a=n.bind(null,l,2);return(0===u?f.then(s):1===u?h.then(v):c.then(d)).then(void 0,a),l;function v(e){h=e;do{if(i&&(c=i())&&c.then&&!r(c))return void c.then(d).then(void 0,a);if(!(f=t())||r(f)&&!f.v)return void n(l,1,h);if(f.then)return void f.then(s).then(void 0,a);r(h=o())&&(h=h.v)}while(!h||!h.then);h.then(v).then(void 0,a)}function s(t){t?(h=o())&&h.then?h.then(v).then(void 0,a):v(h):n(l,1,h)}function d(){(f=t())?f.then?f.then(s).then(void 0,a):s(f):n(l,1,h)}}(function(){return!!Promise.resolve(t.next()).then(function(n){return c=o.done,o=n,Promise.resolve(o.value).then(function(n){return u=n,!c})})},function(){return!!(c=!0)},function(){h.push(u)});if(i&&i.then)return i.then(function(){})}()}catch(n){return f(n)}return l&&l.then?l.then(void 0,f):l}(0,function(n){l=!0,f=n})},function(n,e){function r(t){if(n)throw e;return e}var o=i(function(){var n=function(){if(!c&&null!=t.return)return Promise.resolve(t.return()).then(function(){})}();if(n&&n.then)return n.then(function(){})},function(n,t){if(l)throw f;if(n)throw t;return t});return o&&o.then?o.then(r):r()});return Promise.resolve(a&&a.then?a.then(function(n){return h}):h)}catch(n){return Promise.reject(n)}},e=/*#__PURE__*/function(){function t(){}return t.prototype.then=function(e,r){var i=new t,o=this.s;if(o){var u=1&o?e:r;if(u){try{n(i,1,u(this.v))}catch(t){n(i,2,t)}return i}return this}return this.o=function(t){try{var o=t.v;1&t.s?n(i,1,e?e(o):o):r?n(i,1,r(o)):n(i,2,o)}catch(t){n(i,2,t)}},i},t}();function r(n){return n instanceof e&&1&n.s}function i(n,t){try{var e=n()}catch(n){return t(!0,n)}return e&&e.then?e.then(t.bind(null,!1),t.bind(null,!0)):t(!1,e)}return t().then(console.log),t});
+"!function(n,t){\\"object\\"==typeof exports&&\\"undefined\\"!=typeof module?module.exports=t():\\"function\\"==typeof define&&define.amd?define(t):(n||self).esnextTs=t()}(this,function(){function n(t,r,i){if(!t.s){if(i instanceof e){if(!i.s)return void(i.o=n.bind(null,t,r));1&r&&(r=i.s),i=i.v}if(i&&i.then)return void i.then(n.bind(null,t,r),n.bind(null,t,2));t.s=r,t.v=i;var o=t.o;o&&o(t)}}var t=function(){try{var t,o,u,f,c=[],h=!0,l=!1,s=i(function(){return function(i,f){try{var l=function(){t=function(n){var t;if(\\"undefined\\"!=typeof Symbol){if(Symbol.asyncIterator&&null!=(t=n[Symbol.asyncIterator]))return t.call(n);if(Symbol.iterator&&null!=(t=n[Symbol.iterator]))return t.call(n)}throw new TypeError(\\"Object is not async iterable\\")}([1,2]);var i=function(t,i,o){for(var u;;){var f=t();if(r(f)&&(f=f.v),!f)return c;if(f.then){u=0;break}var c=o();if(c&&c.then){if(!r(c)){u=1;break}c=c.s}if(i){var h=i();if(h&&h.then&&!r(h)){u=2;break}}}var l=new e,s=n.bind(null,l,2);return(0===u?f.then(v):1===u?c.then(a):h.then(d)).then(void 0,s),l;function a(e){c=e;do{if(i&&(h=i())&&h.then&&!r(h))return void h.then(d).then(void 0,s);if(!(f=t())||r(f)&&!f.v)return void n(l,1,c);if(f.then)return void f.then(v).then(void 0,s);r(c=o())&&(c=c.v)}while(!c||!c.then);c.then(a).then(void 0,s)}function v(t){t?(c=o())&&c.then?c.then(a).then(void 0,s):a(c):n(l,1,c)}function d(){(f=t())?f.then?f.then(v).then(void 0,s):v(f):n(l,1,c)}}(function(){return Promise.resolve(t.next()).then(function(n){return h=o.done,o=n,Promise.resolve(o.value).then(function(n){return u=n,!h})})},function(){return!!(h=!0)},function(){c.push(u)});if(i&&i.then)return i.then(function(){})}()}catch(n){return f(n)}return l&&l.then?l.then(void 0,f):l}(0,function(n){l=!0,f=n})},function(n,e){function r(t){if(n)throw e;return e}var o=i(function(){var n=function(){if(!h&&null!=t.return)return Promise.resolve(t.return()).then(function(){})}();if(n&&n.then)return n.then(function(){})},function(n,t){if(l)throw f;if(n)throw t;return t});return o&&o.then?o.then(r):r()});return Promise.resolve(s&&s.then?s.then(function(n){return c}):c)}catch(n){return Promise.reject(n)}};const e=/*#__PURE__*/function(){function t(){}return t.prototype.then=function(e,r){const i=new t,o=this.s;if(o){const t=1&o?e:r;if(t){try{n(i,1,t(this.v))}catch(t){n(i,2,t)}return i}return this}return this.o=function(t){try{const o=t.v;1&t.s?n(i,1,e?e(o):o):r?n(i,1,r(o)):n(i,2,o)}catch(t){n(i,2,t)}},i},t}();function r(n){return n instanceof e&&1&n.s}function i(n,t){try{var e=n()}catch(n){return t(!0,n)}return e&&e.then?e.then(t.bind(null,!1),t.bind(null,!0)):t(!1,e)}return t().then(console.log),t});
//# sourceMappingURL=esnext-ts.umd.js.map
"
`;
From fd4ea1a54456cf0416fb9a15932715b5beb1ba0e Mon Sep 17 00:00:00 2001
From: Jovi De Croock
Date: Tue, 19 Jul 2022 23:47:02 +0200
Subject: [PATCH 35/50] Cleanup repository (#976)
* remove bors, appveyor and replace sizereport with our own
* remove install from size
* Update .github/workflows/nodejs.yml
Co-authored-by: Ryan Christian <33403762+rschristian@users.noreply.github.com>
Co-authored-by: Ryan Christian <33403762+rschristian@users.noreply.github.com>
---
.github/workflows/nodejs.yml | 41 +++++--------
.github/workflows/size.yml | 25 ++++++++
appveyor.yml | 16 -----
bors.toml | 5 --
package-lock.json | 112 +----------------------------------
package.json | 34 +++++------
sizereport.config.js | 5 --
7 files changed, 55 insertions(+), 183 deletions(-)
create mode 100644 .github/workflows/size.yml
delete mode 100644 appveyor.yml
delete mode 100644 bors.toml
delete mode 100644 sizereport.config.js
diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml
index a7e707f9..51f60d6f 100644
--- a/.github/workflows/nodejs.yml
+++ b/.github/workflows/nodejs.yml
@@ -21,29 +21,18 @@ jobs:
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- - name: install npm@latest
- run: npm i -g npm@latest --registry=https://registry.npmjs.org
- - name: npm install, build, and test
- run: |
- npm install
- npm test
- - name: sizereport
- run: ./node_modules/.bin/sizereport --config
-
-# Could add this for canary versions
-# publish-gpr:
-# needs: build
-# runs-on: ubuntu-latest
-# steps:
-# - uses: actions/checkout@v1
-# - uses: actions/setup-node@v1
-# with:
-# node-version: 12
-# registry-url: https://npm.pkg.github.com/
-# scope: '@preact'
-# - run: |
-# npm install
-# npm config set registry https://npm.pkg.github.com/
-# npm publish
-# env:
-# NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
+ - name: Cache node modules
+ uses: actions/cache@v1
+ env:
+ cache-name: cache-node-modules
+ with:
+ path: ~/.npm
+ # This uses the same name as the build-action so we can share the caches.
+ key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
+ restore-keys: |
+ ${{ runner.os }}-build-${{ env.cache-name }}-
+ ${{ runner.os }}-build-
+ ${{ runner.os }}-
+ - run: npm ci --ignore-scripts
+ - name: npm build and test
+ run: npm test
diff --git a/.github/workflows/size.yml b/.github/workflows/size.yml
new file mode 100644
index 00000000..0e541a0d
--- /dev/null
+++ b/.github/workflows/size.yml
@@ -0,0 +1,25 @@
+name: compressed-size
+on:
+ pull_request:
+ branches:
+ - master
+
+jobs:
+ build:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+
+ - name: compressed-size-action
+ uses: preactjs/compressed-size-action@v2
+ with:
+ pattern: 'dist/!(*.js.map)'
+ build-script: build
+ repo-token: '${{ secrets.GITHUB_TOKEN }}'
+
+ - name: compressed-size-action
+ uses: preactjs/compressed-size-action@v2
+ with:
+ pattern: 'test/fixtures/**/dist/!(*.map)'
+ build-script: 'test'
+ repo-token: '${{ secrets.GITHUB_TOKEN }}'
diff --git a/appveyor.yml b/appveyor.yml
deleted file mode 100644
index d0190667..00000000
--- a/appveyor.yml
+++ /dev/null
@@ -1,16 +0,0 @@
-environment:
- nodejs_version: "10"
-
-install:
- - ps: Install-Product node $env:nodejs_version
- - npm install
-
-test_script:
- - node --version
- - npm --version
- - npm test
-
-build: false
-
-cache:
- - node_modules
diff --git a/bors.toml b/bors.toml
deleted file mode 100644
index 7209cc0e..00000000
--- a/bors.toml
+++ /dev/null
@@ -1,5 +0,0 @@
-status = [
- "continuous-integration/travis-ci/push",
-]
-delete_merged_branches = true
-use_squash_merge = true
diff --git a/package-lock.json b/package-lock.json
index dd2a8bce..adec7f6b 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -78,8 +78,7 @@
"regenerator-runtime": "^0.13.7",
"rimraf": "^3.0.2",
"shell-quote": "^1.7.2",
- "strip-ansi": "^6.0.0",
- "travis-size-report": "^1.1.0"
+ "strip-ansi": "^6.0.0"
}
},
"node_modules/@babel/cli": {
@@ -16797,69 +16796,6 @@
"node": ">=8"
}
},
- "node_modules/travis-size-report": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/travis-size-report/-/travis-size-report-1.1.0.tgz",
- "integrity": "sha512-mAMeCPZ1TvUEXDvweVCAG/ek6KgPeVsmQYXtv6I85UoIUIFAI/mCXnN7vyvTSCjIa8B0+cYn5slvqNn9Jo0U0g==",
- "dev": true,
- "dependencies": {
- "chalk": "^2.4.2",
- "escape-string-regexp": "^2.0.0",
- "glob": "^7.1.3",
- "gzip-size": "^5.1.0",
- "minimist": "^1.2.0",
- "node-fetch": "^2.3.0",
- "pretty-bytes": "^5.1.0",
- "typescript": "^3.4.4"
- },
- "bin": {
- "sizereport": "build/bin.js"
- }
- },
- "node_modules/travis-size-report/node_modules/escape-string-regexp": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz",
- "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==",
- "dev": true,
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/travis-size-report/node_modules/gzip-size": {
- "version": "5.1.1",
- "resolved": "https://registry.npmjs.org/gzip-size/-/gzip-size-5.1.1.tgz",
- "integrity": "sha512-FNHi6mmoHvs1mxZAds4PpdCS6QG8B4C1krxJsMutgxl5t3+GlRTzzI3NEkifXx2pVsOvJdOGSmIgDhQ55FwdPA==",
- "dev": true,
- "dependencies": {
- "duplexer": "^0.1.1",
- "pify": "^4.0.1"
- },
- "engines": {
- "node": ">=6"
- }
- },
- "node_modules/travis-size-report/node_modules/pify": {
- "version": "4.0.1",
- "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz",
- "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==",
- "dev": true,
- "engines": {
- "node": ">=6"
- }
- },
- "node_modules/travis-size-report/node_modules/typescript": {
- "version": "3.9.7",
- "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.7.tgz",
- "integrity": "sha512-BLbiRkiBzAwsjut4x/dsibSTB6yWpwT5qWmC2OfuCg3GgVQCSgMs4vEctYPhsaGtd0AeuuHMkjZ2h2WG8MSzRw==",
- "dev": true,
- "bin": {
- "tsc": "bin/tsc",
- "tsserver": "bin/tsserver"
- },
- "engines": {
- "node": ">=4.2.0"
- }
- },
"node_modules/trim-newlines": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-3.0.0.tgz",
@@ -31378,52 +31314,6 @@
"punycode": "^2.1.1"
}
},
- "travis-size-report": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/travis-size-report/-/travis-size-report-1.1.0.tgz",
- "integrity": "sha512-mAMeCPZ1TvUEXDvweVCAG/ek6KgPeVsmQYXtv6I85UoIUIFAI/mCXnN7vyvTSCjIa8B0+cYn5slvqNn9Jo0U0g==",
- "dev": true,
- "requires": {
- "chalk": "^2.4.2",
- "escape-string-regexp": "^2.0.0",
- "glob": "^7.1.3",
- "gzip-size": "^5.1.0",
- "minimist": "^1.2.0",
- "node-fetch": "^2.3.0",
- "pretty-bytes": "^5.1.0",
- "typescript": "^3.4.4"
- },
- "dependencies": {
- "escape-string-regexp": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz",
- "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==",
- "dev": true
- },
- "gzip-size": {
- "version": "5.1.1",
- "resolved": "https://registry.npmjs.org/gzip-size/-/gzip-size-5.1.1.tgz",
- "integrity": "sha512-FNHi6mmoHvs1mxZAds4PpdCS6QG8B4C1krxJsMutgxl5t3+GlRTzzI3NEkifXx2pVsOvJdOGSmIgDhQ55FwdPA==",
- "dev": true,
- "requires": {
- "duplexer": "^0.1.1",
- "pify": "^4.0.1"
- }
- },
- "pify": {
- "version": "4.0.1",
- "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz",
- "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==",
- "dev": true
- },
- "typescript": {
- "version": "3.9.7",
- "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.7.tgz",
- "integrity": "sha512-BLbiRkiBzAwsjut4x/dsibSTB6yWpwT5qWmC2OfuCg3GgVQCSgMs4vEctYPhsaGtd0AeuuHMkjZ2h2WG8MSzRw==",
- "dev": true
- }
- }
- },
"trim-newlines": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-3.0.0.tgz",
diff --git a/package.json b/package.json
index e2af9177..7691d265 100644
--- a/package.json
+++ b/package.json
@@ -5,6 +5,19 @@
"main": "dist/microbundle.js",
"source": "src/index.js",
"bin": "dist/cli.js",
+ "repository": "developit/microbundle",
+ "keywords": [
+ "bundle",
+ "rollup",
+ "micro library"
+ ],
+ "files": [
+ "src",
+ "dist",
+ "index.d.ts"
+ ],
+ "author": "Jason Miller (http://jasonformat.com)",
+ "license": "MIT",
"scripts": {
"build": "npm run -s build:babel && npm run -s build:self",
"build:babel": "babel-node src/cli.js --target=node --format cjs src/{cli,index}.js",
@@ -18,7 +31,6 @@
"changeset": "changeset",
"release": "npm run -s prepare && npm test && changeset publish"
},
- "repository": "developit/microbundle",
"prettier": {
"singleQuote": true,
"trailingComma": "all",
@@ -55,23 +67,6 @@
"pre-commit": "lint-staged"
}
},
- "greenkeeper": {
- "lockfiles": {
- "outOfRangeUpdatesOnly": true
- }
- },
- "keywords": [
- "bundle",
- "rollup",
- "micro library"
- ],
- "files": [
- "src",
- "dist",
- "index.d.ts"
- ],
- "author": "Jason Miller (http://jasonformat.com)",
- "license": "MIT",
"dependencies": {
"@babel/core": "^7.12.10",
"@babel/plugin-proposal-class-properties": "7.12.1",
@@ -139,7 +134,6 @@
"regenerator-runtime": "^0.13.7",
"rimraf": "^3.0.2",
"shell-quote": "^1.7.2",
- "strip-ansi": "^6.0.0",
- "travis-size-report": "^1.1.0"
+ "strip-ansi": "^6.0.0"
}
}
diff --git a/sizereport.config.js b/sizereport.config.js
deleted file mode 100644
index 4e188d38..00000000
--- a/sizereport.config.js
+++ /dev/null
@@ -1,5 +0,0 @@
-module.exports = {
- repo: 'developit/microbundle',
- path: ['dist/!(*.js.map)', 'test/fixtures/**/dist/!(*.map)'],
- branch: 'master',
-};
From e72377a001cc5925ff25aadbe26fdb96a0dab3a4 Mon Sep 17 00:00:00 2001
From: Ryan Christian <33403762+rschristian@users.noreply.github.com>
Date: Thu, 11 Aug 2022 12:34:30 -0500
Subject: [PATCH 36/50] fix: mains by format fallbacks (#964)
---
.changeset/old-dodos-laugh.md | 5 +
src/index.js | 8 +-
test/__snapshots__/index.test.js.snap | 116 ++++++++++++++++++
test/fixtures/custom-outputs-alt/package.json | 10 ++
test/fixtures/custom-outputs-alt/src/index.js | 5 +
test/fixtures/custom-outputs-alt/src/two.js | 3 +
test/fixtures/custom-outputs/package.json | 10 ++
test/fixtures/custom-outputs/src/index.js | 5 +
test/fixtures/custom-outputs/src/two.js | 3 +
9 files changed, 159 insertions(+), 6 deletions(-)
create mode 100644 .changeset/old-dodos-laugh.md
create mode 100644 test/fixtures/custom-outputs-alt/package.json
create mode 100644 test/fixtures/custom-outputs-alt/src/index.js
create mode 100644 test/fixtures/custom-outputs-alt/src/two.js
create mode 100644 test/fixtures/custom-outputs/package.json
create mode 100644 test/fixtures/custom-outputs/src/index.js
create mode 100644 test/fixtures/custom-outputs/src/two.js
diff --git a/.changeset/old-dodos-laugh.md b/.changeset/old-dodos-laugh.md
new file mode 100644
index 00000000..c883e67e
--- /dev/null
+++ b/.changeset/old-dodos-laugh.md
@@ -0,0 +1,5 @@
+---
+'microbundle': patch
+---
+
+Fixes filename generation for es & modern outputs. Both 'jsnext:main' and 'esmodule' were incorrectly ignored.
diff --git a/src/index.js b/src/index.js
index 709ba2a2..ddf90f2d 100644
--- a/src/index.js
+++ b/src/index.js
@@ -297,9 +297,7 @@ function getMain({ options, entry, format }) {
mainsByFormat.es = replaceName(
pkg.module && !pkg.module.match(/src\//)
? pkg.module
- : pkg['jsnext:main'] || pkgTypeModule
- ? 'x.esm.js'
- : 'x.esm.mjs',
+ : pkg['jsnext:main'] || (pkgTypeModule ? 'x.esm.js' : 'x.esm.mjs'),
mainNoExtension,
);
@@ -307,9 +305,7 @@ function getMain({ options, entry, format }) {
(pkg.exports && walk(pkg.exports, pkgTypeModule)) ||
(pkg.syntax && pkg.syntax.esmodules) ||
pkg.esmodule ||
- pkgTypeModule
- ? 'x.modern.js'
- : 'x.modern.mjs',
+ (pkgTypeModule ? 'x.modern.js' : 'x.modern.mjs'),
mainNoExtension,
);
mainsByFormat.cjs = replaceName(
diff --git a/test/__snapshots__/index.test.js.snap b/test/__snapshots__/index.test.js.snap
index 495874f9..1155d4f2 100644
--- a/test/__snapshots__/index.test.js.snap
+++ b/test/__snapshots__/index.test.js.snap
@@ -1511,6 +1511,122 @@ exports[`fixtures build custom-babelrc with microbundle 5`] = `
"
`;
+exports[`fixtures build custom-outputs with microbundle 1`] = `
+"Used script: microbundle -f modern,es,umd,cjs
+
+Directory tree:
+
+custom-outputs
+ dist
+ custom-outputs.exportsx.mjs
+ custom-outputs.exportsx.mjs.map
+ custom-outputs.js
+ custom-outputs.js.map
+ custom-outputs.modulex.mjs
+ custom-outputs.modulex.mjs.map
+ custom-outputs.umdx.js
+ custom-outputs.umdx.js.map
+ package.json
+ src
+ index.js
+ two.js
+
+
+Build \\"custom-outputs\\" to dist:
+187 B: custom-outputs.js.gz
+138 B: custom-outputs.js.br
+113 B: custom-outputs.exportsx.mjs.gz
+92 B: custom-outputs.exportsx.mjs.br
+188 B: custom-outputs.modulex.mjs.gz
+139 B: custom-outputs.modulex.mjs.br
+273 B: custom-outputs.umdx.js.gz
+203 B: custom-outputs.umdx.js.br"
+`;
+
+exports[`fixtures build custom-outputs with microbundle 2`] = `8`;
+
+exports[`fixtures build custom-outputs with microbundle 3`] = `
+"async function n(...n){return n.reduce((n,t)=>n+t,0)}async function t(...t){return[await n(...t),await n(...t)]}export default t;
+//# sourceMappingURL=custom-outputs.exportsx.mjs.map
+"
+`;
+
+exports[`fixtures build custom-outputs with microbundle 4`] = `
+"var r=function(){try{var r=arguments;return Promise.resolve([].slice.call(r).reduce(function(r,e){return r+e},0))}catch(r){return Promise.reject(r)}};module.exports=function(){try{var e=arguments,t=[].slice.call(e);return Promise.resolve(r.apply(void 0,t)).then(function(e){return Promise.resolve(r.apply(void 0,t)).then(function(r){return[e,r]})})}catch(r){return Promise.reject(r)}};
+//# sourceMappingURL=custom-outputs.js.map
+"
+`;
+
+exports[`fixtures build custom-outputs with microbundle 5`] = `
+"var r=function(){try{var r=arguments;return Promise.resolve([].slice.call(r).reduce(function(r,e){return r+e},0))}catch(r){return Promise.reject(r)}};export default function(){try{var e=arguments,t=[].slice.call(e);return Promise.resolve(r.apply(void 0,t)).then(function(e){return Promise.resolve(r.apply(void 0,t)).then(function(r){return[e,r]})})}catch(r){return Promise.reject(r)}}
+//# sourceMappingURL=custom-outputs.modulex.mjs.map
+"
+`;
+
+exports[`fixtures build custom-outputs with microbundle 6`] = `
+"!function(e,t){\\"object\\"==typeof exports&&\\"undefined\\"!=typeof module?module.exports=t():\\"function\\"==typeof define&&define.amd?define(t):(e||self).customOutputs=t()}(this,function(){var e=function(){try{var e=arguments;return Promise.resolve([].slice.call(e).reduce(function(e,t){return e+t},0))}catch(e){return Promise.reject(e)}};return function(){try{var t=arguments,r=[].slice.call(t);return Promise.resolve(e.apply(void 0,r)).then(function(t){return Promise.resolve(e.apply(void 0,r)).then(function(e){return[t,e]})})}catch(e){return Promise.reject(e)}}});
+//# sourceMappingURL=custom-outputs.umdx.js.map
+"
+`;
+
+exports[`fixtures build custom-outputs-alt with microbundle 1`] = `
+"Used script: microbundle -f modern,es,umd,cjs
+
+Directory tree:
+
+custom-outputs-alt
+ dist
+ custom-outputs-alt.cjsmain.js
+ custom-outputs-alt.cjsmain.js.map
+ custom-outputs-alt.esmodule.mjs
+ custom-outputs-alt.esmodule.mjs.map
+ custom-outputs-alt.jsnextmain.mjs
+ custom-outputs-alt.jsnextmain.mjs.map
+ custom-outputs-alt.unpkg.js
+ custom-outputs-alt.unpkg.js.map
+ package.json
+ src
+ index.js
+ two.js
+
+
+Build \\"custom-outputs-alt\\" to dist:
+187 B: custom-outputs-alt.cjsmain.js.gz
+138 B: custom-outputs-alt.cjsmain.js.br
+113 B: custom-outputs-alt.esmodule.mjs.gz
+92 B: custom-outputs-alt.esmodule.mjs.br
+188 B: custom-outputs-alt.jsnextmain.mjs.gz
+139 B: custom-outputs-alt.jsnextmain.mjs.br
+277 B: custom-outputs-alt.unpkg.js.gz
+226 B: custom-outputs-alt.unpkg.js.br"
+`;
+
+exports[`fixtures build custom-outputs-alt with microbundle 2`] = `8`;
+
+exports[`fixtures build custom-outputs-alt with microbundle 3`] = `
+"var r=function(){try{var r=arguments;return Promise.resolve([].slice.call(r).reduce(function(r,e){return r+e},0))}catch(r){return Promise.reject(r)}};module.exports=function(){try{var e=arguments,t=[].slice.call(e);return Promise.resolve(r.apply(void 0,t)).then(function(e){return Promise.resolve(r.apply(void 0,t)).then(function(r){return[e,r]})})}catch(r){return Promise.reject(r)}};
+//# sourceMappingURL=custom-outputs-alt.cjsmain.js.map
+"
+`;
+
+exports[`fixtures build custom-outputs-alt with microbundle 4`] = `
+"async function n(...n){return n.reduce((n,t)=>n+t,0)}async function t(...t){return[await n(...t),await n(...t)]}export default t;
+//# sourceMappingURL=custom-outputs-alt.esmodule.mjs.map
+"
+`;
+
+exports[`fixtures build custom-outputs-alt with microbundle 5`] = `
+"var r=function(){try{var r=arguments;return Promise.resolve([].slice.call(r).reduce(function(r,e){return r+e},0))}catch(r){return Promise.reject(r)}};export default function(){try{var e=arguments,t=[].slice.call(e);return Promise.resolve(r.apply(void 0,t)).then(function(e){return Promise.resolve(r.apply(void 0,t)).then(function(r){return[e,r]})})}catch(r){return Promise.reject(r)}}
+//# sourceMappingURL=custom-outputs-alt.jsnextmain.mjs.map
+"
+`;
+
+exports[`fixtures build custom-outputs-alt with microbundle 6`] = `
+"!function(e,t){\\"object\\"==typeof exports&&\\"undefined\\"!=typeof module?module.exports=t():\\"function\\"==typeof define&&define.amd?define(t):(e||self).customOutputsAlt=t()}(this,function(){var e=function(){try{var e=arguments;return Promise.resolve([].slice.call(e).reduce(function(e,t){return e+t},0))}catch(e){return Promise.reject(e)}};return function(){try{var t=arguments,r=[].slice.call(t);return Promise.resolve(e.apply(void 0,r)).then(function(t){return Promise.resolve(e.apply(void 0,r)).then(function(e){return[t,e]})})}catch(e){return Promise.reject(e)}}});
+//# sourceMappingURL=custom-outputs-alt.unpkg.js.map
+"
+`;
+
exports[`fixtures build custom-source with microbundle 1`] = `
"Used script: microbundle
diff --git a/test/fixtures/custom-outputs-alt/package.json b/test/fixtures/custom-outputs-alt/package.json
new file mode 100644
index 00000000..6c5acc49
--- /dev/null
+++ b/test/fixtures/custom-outputs-alt/package.json
@@ -0,0 +1,10 @@
+{
+ "name": "custom-outputs-alt",
+ "cjs:main": "dist/custom-outputs-alt.cjsmain.js",
+ "unpkg": "dist/custom-outputs-alt.unpkg.js",
+ "jsnext:main": "dist/custom-outputs-alt.jsnextmain.mjs",
+ "esmodule": "dist/custom-outputs-alt.esmodule.mjs",
+ "scripts": {
+ "build": "microbundle -f modern,es,umd,cjs"
+ }
+}
diff --git a/test/fixtures/custom-outputs-alt/src/index.js b/test/fixtures/custom-outputs-alt/src/index.js
new file mode 100644
index 00000000..a756a0a4
--- /dev/null
+++ b/test/fixtures/custom-outputs-alt/src/index.js
@@ -0,0 +1,5 @@
+import { two } from './two';
+
+export default async function(...args) {
+ return [await two(...args), await two(...args)];
+}
diff --git a/test/fixtures/custom-outputs-alt/src/two.js b/test/fixtures/custom-outputs-alt/src/two.js
new file mode 100644
index 00000000..9f1f741b
--- /dev/null
+++ b/test/fixtures/custom-outputs-alt/src/two.js
@@ -0,0 +1,3 @@
+export async function two(...args) {
+ return args.reduce((total, value) => total + value, 0);
+}
diff --git a/test/fixtures/custom-outputs/package.json b/test/fixtures/custom-outputs/package.json
new file mode 100644
index 00000000..4338d399
--- /dev/null
+++ b/test/fixtures/custom-outputs/package.json
@@ -0,0 +1,10 @@
+{
+ "name": "custom-outputs",
+ "main": "dist/custom-outputs.js",
+ "umd:main": "dist/custom-outputs.umdx.js",
+ "module": "dist/custom-outputs.modulex.mjs",
+ "exports": "./dist/custom-outputs.exportsx.mjs",
+ "scripts": {
+ "build": "microbundle -f modern,es,umd,cjs"
+ }
+}
diff --git a/test/fixtures/custom-outputs/src/index.js b/test/fixtures/custom-outputs/src/index.js
new file mode 100644
index 00000000..a756a0a4
--- /dev/null
+++ b/test/fixtures/custom-outputs/src/index.js
@@ -0,0 +1,5 @@
+import { two } from './two';
+
+export default async function(...args) {
+ return [await two(...args), await two(...args)];
+}
diff --git a/test/fixtures/custom-outputs/src/two.js b/test/fixtures/custom-outputs/src/two.js
new file mode 100644
index 00000000..9f1f741b
--- /dev/null
+++ b/test/fixtures/custom-outputs/src/two.js
@@ -0,0 +1,3 @@
+export async function two(...args) {
+ return args.reduce((total, value) => total + value, 0);
+}
From c76c41f8317611f7592d8e44c569e8083076f25f Mon Sep 17 00:00:00 2001
From: Preact Bot <71229973+preact-bot@users.noreply.github.com>
Date: Fri, 12 Aug 2022 18:04:22 -0400
Subject: [PATCH 37/50] Version Packages (#958)
Co-authored-by: github-actions[bot]
---
.changeset/angry-worms-smell.md | 5 -----
.changeset/breezy-cheetahs-kick.md | 5 -----
.changeset/green-foxes-poke.md | 5 -----
.changeset/hot-dryers-train.md | 5 -----
.changeset/loud-dingos-sleep.md | 5 -----
.changeset/old-dodos-laugh.md | 5 -----
CHANGELOG.md | 16 ++++++++++++++++
package.json | 4 ++--
8 files changed, 18 insertions(+), 32 deletions(-)
delete mode 100644 .changeset/angry-worms-smell.md
delete mode 100644 .changeset/breezy-cheetahs-kick.md
delete mode 100644 .changeset/green-foxes-poke.md
delete mode 100644 .changeset/hot-dryers-train.md
delete mode 100644 .changeset/loud-dingos-sleep.md
delete mode 100644 .changeset/old-dodos-laugh.md
diff --git a/.changeset/angry-worms-smell.md b/.changeset/angry-worms-smell.md
deleted file mode 100644
index 7abee405..00000000
--- a/.changeset/angry-worms-smell.md
+++ /dev/null
@@ -1,5 +0,0 @@
----
-'microbundle': patch
----
-
-Fix for when multiple entries reference different CSS, only the CSS referenced by the first entry will be packaged
diff --git a/.changeset/breezy-cheetahs-kick.md b/.changeset/breezy-cheetahs-kick.md
deleted file mode 100644
index 50f627ad..00000000
--- a/.changeset/breezy-cheetahs-kick.md
+++ /dev/null
@@ -1,5 +0,0 @@
----
-'microbundle': patch
----
-
-Bumps Node target to v12
diff --git a/.changeset/green-foxes-poke.md b/.changeset/green-foxes-poke.md
deleted file mode 100644
index 511e824a..00000000
--- a/.changeset/green-foxes-poke.md
+++ /dev/null
@@ -1,5 +0,0 @@
----
-'microbundle': patch
----
-
-deps: upgrade rpt2 to latest v0.32.0 to fix monorepos
diff --git a/.changeset/hot-dryers-train.md b/.changeset/hot-dryers-train.md
deleted file mode 100644
index d12b08cd..00000000
--- a/.changeset/hot-dryers-train.md
+++ /dev/null
@@ -1,5 +0,0 @@
----
-'microbundle': patch
----
-
-Silences warnings when using Node builtins with the 'node:...' protocol on imports. Warnings related to bare usage of these builtins were already silenced.
diff --git a/.changeset/loud-dingos-sleep.md b/.changeset/loud-dingos-sleep.md
deleted file mode 100644
index 814cb150..00000000
--- a/.changeset/loud-dingos-sleep.md
+++ /dev/null
@@ -1,5 +0,0 @@
----
-'microbundle': patch
----
-
-deps: upgrade babel-plugin-transform-async-to-promises to latest v0.8.18 to fix #565
diff --git a/.changeset/old-dodos-laugh.md b/.changeset/old-dodos-laugh.md
deleted file mode 100644
index c883e67e..00000000
--- a/.changeset/old-dodos-laugh.md
+++ /dev/null
@@ -1,5 +0,0 @@
----
-'microbundle': patch
----
-
-Fixes filename generation for es & modern outputs. Both 'jsnext:main' and 'esmodule' were incorrectly ignored.
diff --git a/CHANGELOG.md b/CHANGELOG.md
index da946e0c..043f5fa8 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,21 @@
# microbundle
+## 0.15.1
+
+### Patch Changes
+
+- [`cebafa1`](https://github.com/developit/microbundle/commit/cebafa121953a771f010b3cfd250a83bfc754e2c) [#961](https://github.com/developit/microbundle/pull/961) Thanks [@zyrong](https://github.com/zyrong)! - Fix for when multiple entries reference different CSS, only the CSS referenced by the first entry will be packaged
+
+* [`9a4e2b2`](https://github.com/developit/microbundle/commit/9a4e2b2096d3824661738edb142b4658cf3d9d0b) [#954](https://github.com/developit/microbundle/pull/954) Thanks [@rschristian](https://github.com/rschristian)! - Bumps Node target to v12
+
+- [`4ad4b76`](https://github.com/developit/microbundle/commit/4ad4b768f0ef6f434b753c4a42cdcfe85d01c404) [#967](https://github.com/developit/microbundle/pull/967) Thanks [@agilgur5](https://github.com/agilgur5)! - deps: upgrade rpt2 to latest v0.32.0 to fix monorepos
+
+* [`6018e58`](https://github.com/developit/microbundle/commit/6018e586b91125233026ca977a97b72bb6082ec6) [#956](https://github.com/developit/microbundle/pull/956) Thanks [@rschristian](https://github.com/rschristian)! - Silences warnings when using Node builtins with the 'node:...' protocol on imports. Warnings related to bare usage of these builtins were already silenced.
+
+- [`88241dd`](https://github.com/developit/microbundle/commit/88241ddf8fc3ac18cfc1ca8ced99a413f8d2b488) [#968](https://github.com/developit/microbundle/pull/968) Thanks [@PeterBurner](https://github.com/PeterBurner)! - deps: upgrade babel-plugin-transform-async-to-promises to latest v0.8.18 to fix #565
+
+* [`e72377a`](https://github.com/developit/microbundle/commit/e72377a001cc5925ff25aadbe26fdb96a0dab3a4) [#964](https://github.com/developit/microbundle/pull/964) Thanks [@rschristian](https://github.com/rschristian)! - Fixes filename generation for es & modern outputs. Both 'jsnext:main' and 'esmodule' were incorrectly ignored.
+
## 0.15.0
### Minor Changes
diff --git a/package.json b/package.json
index 7691d265..6cf2034f 100644
--- a/package.json
+++ b/package.json
@@ -1,12 +1,12 @@
{
"name": "microbundle",
- "version": "0.15.0",
+ "version": "0.15.1",
"description": "Zero-configuration bundler for tiny JS libs, powered by Rollup.",
"main": "dist/microbundle.js",
"source": "src/index.js",
"bin": "dist/cli.js",
"repository": "developit/microbundle",
- "keywords": [
+ "keywords": [
"bundle",
"rollup",
"micro library"
From 60b5edcf5d96c26877134febbdf0a247ee56b9c7 Mon Sep 17 00:00:00 2001
From: Jeff Posnick
Date: Tue, 23 Aug 2022 17:00:40 -0400
Subject: [PATCH 38/50] Add example of exports.types field (#992)
* Add example of exports.types field
* Update README.md
Co-authored-by: Ryan Christian <33403762+rschristian@users.noreply.github.com>
---
README.md | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index 0135a1bb..2b6d70fa 100644
--- a/README.md
+++ b/README.md
@@ -166,12 +166,13 @@ The filenames and paths for generated bundles in each format are defined by the
"source": "src/index.js", // input
"main": "dist/foo.js", // CommonJS output bundle
"umd:main": "dist/foo.umd.js", // UMD output bundle
- "module": "dist/foo.mjs", // ES Modules output bundle
+ "module": "dist/foo.mjs", // ES Modules output bundle
"exports": {
+ "types": "./dist/foo.d.ts", // TypeScript typings for NodeNext modules
"require": "./dist/foo.js", // CommonJS output bundle
"default": "./dist/foo.modern.mjs", // Modern ES Modules output bundle
},
- "types": "dist/foo.d.ts" // TypeScript typings directory
+ "types": "dist/foo.d.ts" // TypeScript typings
}
```
@@ -230,6 +231,8 @@ To ensure Microbundle does not process extraneous files, by default it only incl
If you're using TypeScript with CSS Modules, you will want to set `"include": ["node_modules/microbundle/index.d.ts"]` in your `tsconfig.json` to tell TypeScript how to handle your CSS Module imports.
+To ensure that your module's `.d.ts` type info is visible to other TypeScript projects that use [`moduleResolution: 'NodeNext'`](https://www.typescriptlang.org/docs/handbook/esm-node.html), add a [`types` key](https://www.typescriptlang.org/docs/handbook/esm-node.html#packagejson-exports-imports-and-self-referencing) to your `package.json`'s corresponding `exports` mapping.
+
### CSS and CSS Modules
Importing CSS files is supported via `import "./foo.css"`. By default, generated CSS output is written to disk. The `--css inline` command line option will inline generated CSS into your bundles as a string, returning the CSS string from the import:
From 124c9c607cfc1c33fd2376bd86ddd15531b507d6 Mon Sep 17 00:00:00 2001
From: Franco Arza
Date: Thu, 25 Aug 2022 20:20:17 -0300
Subject: [PATCH 39/50] Update README.md (#993)
---
README.md | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index 2b6d70fa..fd79e1b7 100644
--- a/README.md
+++ b/README.md
@@ -382,8 +382,11 @@ Here's what's coming up for Microbundle:
- [routex.js](https://github.com/alexhoma/routex.js) A dynamic routing library for Next.js.
- [hooked-form](https://github.com/JoviDeCroock/hooked-form) A lightweight form-management library for React.
- [goober](https://github.com/cristianbote/goober) Less than 1KB css-in-js alternative with a familiar API.
-- [react-model](https://github.com/byte-fe/react-model) The next generation state management library for React
-- [Teaful](https://github.com/teafuljs/teaful) Tiny, easy and powerful (P)React state management
+- [react-model](https://github.com/byte-fe/react-model) The next generation state management library for React.
+- [Teaful](https://github.com/teafuljs/teaful) Tiny, easy and powerful (P)React state management.
+- [@studio-freight/lenis](https://github.com/studio-freight/lenis) Tiny, Performant, Vanilla JS, Smooth Scroll library.
+- [@studio-freight/tempus](https://github.com/studio-freight/tempus) One rAF to rule them all.
+- [@studio-freight/hamo](https://github.com/studio-freight/hamo) Collection of React hooks.
## 🥂 License
From 22187fba8a2d404a9f3dc5db357e243cd45e8479 Mon Sep 17 00:00:00 2001
From: Marvin Hagemeister
Date: Sun, 18 Sep 2022 09:27:43 +0200
Subject: [PATCH 40/50] Fix `mangle.json` indentation style not preserved
(#999)
---
.changeset/gold-berries-march.md | 5 +++++
src/index.js | 8 +++++++-
2 files changed, 12 insertions(+), 1 deletion(-)
create mode 100644 .changeset/gold-berries-march.md
diff --git a/.changeset/gold-berries-march.md b/.changeset/gold-berries-march.md
new file mode 100644
index 00000000..a96679e4
--- /dev/null
+++ b/.changeset/gold-berries-march.md
@@ -0,0 +1,5 @@
+---
+'microbundle': patch
+---
+
+Fix indentation style in `mangle.json` not preserved
diff --git a/src/index.js b/src/index.js
index ddf90f2d..99e6a8fc 100644
--- a/src/index.js
+++ b/src/index.js
@@ -408,9 +408,11 @@ function createConfig(options, entry, format, writeMeta) {
let endsWithNewLine = false;
+ let nameCacheIndentTabs = false;
function loadNameCache() {
try {
const data = fs.readFileSync(getNameCachePath(), 'utf8');
+ nameCacheIndentTabs = /^\t+/gm.test(data);
endsWithNewLine = data.endsWith(EOL);
nameCache = JSON.parse(data);
// mangle.json can contain a "minify" field, same format as the pkg.mangle:
@@ -628,7 +630,11 @@ function createConfig(options, entry, format, writeMeta) {
writeBundle() {
if (writeMeta && nameCache) {
let filename = getNameCachePath();
- let json = JSON.stringify(nameCache, null, 2);
+ let json = JSON.stringify(
+ nameCache,
+ null,
+ nameCacheIndentTabs ? '\t' : 2,
+ );
if (endsWithNewLine) json += EOL;
fs.writeFile(filename, json, () => {});
}
From bb8713c74706f466672b3109552c7d3e675b5325 Mon Sep 17 00:00:00 2001
From: Ryan Christian <33403762+rschristian@users.noreply.github.com>
Date: Thu, 23 Feb 2023 11:32:18 -0600
Subject: [PATCH 41/50] chore: Silence Rollup's `this is undefined` warnings
(#991)
* chore: Silence Rollup's `this is undefined` warning
* docs: Adding changeset
---
.changeset/swift-plums-fix.md | 5 +++++
src/index.js | 2 +-
2 files changed, 6 insertions(+), 1 deletion(-)
create mode 100644 .changeset/swift-plums-fix.md
diff --git a/.changeset/swift-plums-fix.md b/.changeset/swift-plums-fix.md
new file mode 100644
index 00000000..941c04d4
--- /dev/null
+++ b/.changeset/swift-plums-fix.md
@@ -0,0 +1,5 @@
+---
+'microbundle': patch
+---
+
+Silence Rollup's noisy (and usually harmless) `The 'this' keyword is equivalent to 'undefined' at the top level of an ES module, and has been rewritten.` warnings
diff --git a/src/index.js b/src/index.js
index 99e6a8fc..06a36d29 100644
--- a/src/index.js
+++ b/src/index.js
@@ -475,7 +475,7 @@ function createConfig(options, entry, format, writeMeta) {
`\n ↳ to depend on a module via import/require, install it to "dependencies".`,
);
return;
- }
+ } else if (warning.code === 'THIS_IS_UNDEFINED') return;
warn(warning);
},
From 105a09b9aa686ac46dc728e774d7ae3aef00aed8 Mon Sep 17 00:00:00 2001
From: Don McCurdy
Date: Wed, 26 Apr 2023 18:28:40 -0400
Subject: [PATCH 42/50] Add glTF Transform to "Built with Microbundle" list
(#1040)
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index fd79e1b7..c10bddaf 100644
--- a/README.md
+++ b/README.md
@@ -387,7 +387,7 @@ Here's what's coming up for Microbundle:
- [@studio-freight/lenis](https://github.com/studio-freight/lenis) Tiny, Performant, Vanilla JS, Smooth Scroll library.
- [@studio-freight/tempus](https://github.com/studio-freight/tempus) One rAF to rule them all.
- [@studio-freight/hamo](https://github.com/studio-freight/hamo) Collection of React hooks.
-
+- [glTF Transform](https://github.com/donmccurdy/glTF-Transform) Library for working with .gltf and .glb 3D models.
## 🥂 License
From ef8376ee9076b2f56aca42fd9e4c8fd4dcaf8fd0 Mon Sep 17 00:00:00 2001
From: Diego Tonini
Date: Fri, 30 Jun 2023 00:19:18 +0200
Subject: [PATCH 43/50] chore: add eta js to readme (#1051)
---
README.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/README.md b/README.md
index c10bddaf..69aab462 100644
--- a/README.md
+++ b/README.md
@@ -388,6 +388,7 @@ Here's what's coming up for Microbundle:
- [@studio-freight/tempus](https://github.com/studio-freight/tempus) One rAF to rule them all.
- [@studio-freight/hamo](https://github.com/studio-freight/hamo) Collection of React hooks.
- [glTF Transform](https://github.com/donmccurdy/glTF-Transform) Library for working with .gltf and .glb 3D models.
+- [eta](https://github.com/eta-dev/eta) Lightweight, powerful, pluggable embedded JS template engine
## 🥂 License
From b8755477f82f20ac52e6783984092dbb9dc55347 Mon Sep 17 00:00:00 2001
From: Oskar Legner
Date: Thu, 24 Aug 2023 10:31:15 +0200
Subject: [PATCH 44/50] Fix typo in comment (#1056)
---
src/lib/css-modules.js | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/lib/css-modules.js b/src/lib/css-modules.js
index fcda6dc7..e4fa1889 100644
--- a/src/lib/css-modules.js
+++ b/src/lib/css-modules.js
@@ -33,9 +33,9 @@ export function cssModulesConfig(options) {
}
/**
- * This is done because if you use the cli default property, you get a primiatve "null" or "false",
+ * This is done because if you use the cli default property, you get a primitive "null" or "false",
* but when using the cli arguments, you always get back strings. This method aims at correcting those
- * for both realms. So that both realms _convert_ into primatives.
+ * for both realms. So that both realms _convert_ into primitives.
*/
function processCssmodulesArgument(options) {
if (options['css-modules'] === 'true' || options['css-modules'] === true)
From 3aca5a0a8f9b0df57a1603f044fdd8e86da79ae7 Mon Sep 17 00:00:00 2001
From: Philipp Daun
Date: Mon, 18 Sep 2023 19:22:19 +0200
Subject: [PATCH 45/50] Add swup to example projects (#1061)
---
README.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/README.md b/README.md
index 69aab462..2f4dbb48 100644
--- a/README.md
+++ b/README.md
@@ -389,6 +389,7 @@ Here's what's coming up for Microbundle:
- [@studio-freight/hamo](https://github.com/studio-freight/hamo) Collection of React hooks.
- [glTF Transform](https://github.com/donmccurdy/glTF-Transform) Library for working with .gltf and .glb 3D models.
- [eta](https://github.com/eta-dev/eta) Lightweight, powerful, pluggable embedded JS template engine
+- [swup](https://github.com/swup/swup) Page transition library for server-rendered websites.
## 🥂 License
From 4724a779917bae462113a81f66684cbad2351a6e Mon Sep 17 00:00:00 2001
From: Jude Agboola
Date: Tue, 5 Dec 2023 17:49:01 +0100
Subject: [PATCH 46/50] remove brazillian-utils from readme (#1062)
---
README.md | 1 -
1 file changed, 1 deletion(-)
diff --git a/README.md b/README.md
index 2f4dbb48..03471c77 100644
--- a/README.md
+++ b/README.md
@@ -375,7 +375,6 @@ Here's what's coming up for Microbundle:
- [Microenvi](https://github.com/fwilkerson/microenvi) Bundle, serve, and hot reload with one command.
- [Theme UI](https://github.com/system-ui/theme-ui) Build consistent, themeable React apps based on constraint-based design principles.
- [react-recomponent](https://github.com/philipp-spiess/react-recomponent) Reason-style reducer components for React using ES6 classes.
-- [brazilian-utils](https://github.com/brazilian-utils/brazilian-utils) Utils library for specific Brazilian businesses.
- [react-hooks-lib](https://github.com/beizhedenglong/react-hooks-lib) A set of reusable react hooks.
- [mdx-deck-live-code](https://github.com/JReinhold/mdx-deck-live-code) A library for [mdx-deck](https://github.com/jxnblk/mdx-deck) to do live React and JS coding directly in slides.
- [react-router-ext](https://github.com/ri7nz/react-router-ext) An Extended [react-router-dom](https://github.com/ReactTraining/react-router/tree/master/packages/react-router-dom) with simple usage.
From 4b11285f27e7fa5a5f9ff4733489bb75e8a0763d Mon Sep 17 00:00:00 2001
From: Luke Edwards
Date: Tue, 23 Jan 2024 21:23:07 -0800
Subject: [PATCH 47/50] chore: add licenses badge (#1074)
this service recursively checks/lists all licenses within a package's dependency graph. I remember there being a fair number of pieces involved here so was happy to see that all 400+ licenses involved are green!
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 03471c77..e8dc7bff 100644
--- a/README.md
+++ b/README.md
@@ -3,7 +3,7 @@
Microbundle
-
+
The zero-configuration bundler for tiny modules, powered by Rollup.
From aae1611ef4f95f17332057018b595ef7b2794b2d Mon Sep 17 00:00:00 2001
From: Ryan Christian <33403762+rschristian@users.noreply.github.com>
Date: Tue, 4 Feb 2025 14:20:33 -0600
Subject: [PATCH 48/50] fix: Incorrect UMD sourcemaps (#1043)
---
.changeset/violet-falcons-dream.md | 5 ++++
.github/workflows/size.yml | 4 +++-
package-lock.json | 25 +++++++++++---------
package.json | 1 +
src/index.js | 34 +++++++++++++++++++++------
test/__snapshots__/index.test.js.snap | 2 +-
6 files changed, 51 insertions(+), 20 deletions(-)
create mode 100644 .changeset/violet-falcons-dream.md
diff --git a/.changeset/violet-falcons-dream.md b/.changeset/violet-falcons-dream.md
new file mode 100644
index 00000000..9cd3e61b
--- /dev/null
+++ b/.changeset/violet-falcons-dream.md
@@ -0,0 +1,5 @@
+---
+'microbundle': patch
+---
+
+Fixes positioning bug with UMD sourcemaps
diff --git a/.github/workflows/size.yml b/.github/workflows/size.yml
index 0e541a0d..e1d7f789 100644
--- a/.github/workflows/size.yml
+++ b/.github/workflows/size.yml
@@ -21,5 +21,7 @@ jobs:
uses: preactjs/compressed-size-action@v2
with:
pattern: 'test/fixtures/**/dist/!(*.map)'
- build-script: 'test'
+ # We're using this to report size differences, not test, so update snapshots if they fail.
+ # The CI can catch the test failures instead.
+ build-script: 'test -- -u'
repo-token: '${{ secrets.GITHUB_TOKEN }}'
diff --git a/package-lock.json b/package-lock.json
index adec7f6b..6603abea 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "microbundle",
- "version": "0.15.0",
+ "version": "0.15.1",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "microbundle",
- "version": "0.15.0",
+ "version": "0.15.1",
"license": "MIT",
"dependencies": {
"@babel/core": "^7.12.10",
@@ -38,6 +38,7 @@
"gzip-size": "^6.0.0",
"kleur": "^4.1.3",
"lodash.merge": "^4.6.2",
+ "magic-string": "^0.25.9",
"postcss": "^8.2.1",
"pretty-bytes": "^5.4.1",
"rollup": "^2.35.1",
@@ -11320,11 +11321,12 @@
}
},
"node_modules/magic-string": {
- "version": "0.25.7",
- "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.7.tgz",
- "integrity": "sha512-4CrMT5DOHTDk4HYDlzmwu4FVCcIYI8gauveasrdCu2IKIFOJ3f0v/8MDGJCDL9oD2ppz/Av1b0Nj345H9M+XIA==",
+ "version": "0.25.9",
+ "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.9.tgz",
+ "integrity": "sha512-RmF0AsMzgt25qzqqLc1+MbHmhdx0ojF2Fvs4XnOqz2ZOBXzzkEwc/dJQZCYHAn7v1jbVOjAZfK8msRn4BxO4VQ==",
+ "license": "MIT",
"dependencies": {
- "sourcemap-codec": "^1.4.4"
+ "sourcemap-codec": "^1.4.8"
}
},
"node_modules/make-dir": {
@@ -16050,7 +16052,8 @@
"node_modules/sourcemap-codec": {
"version": "1.4.8",
"resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz",
- "integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA=="
+ "integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==",
+ "deprecated": "Please use @jridgewell/sourcemap-codec instead"
},
"node_modules/spawndamnit": {
"version": "2.0.0",
@@ -26937,11 +26940,11 @@
}
},
"magic-string": {
- "version": "0.25.7",
- "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.7.tgz",
- "integrity": "sha512-4CrMT5DOHTDk4HYDlzmwu4FVCcIYI8gauveasrdCu2IKIFOJ3f0v/8MDGJCDL9oD2ppz/Av1b0Nj345H9M+XIA==",
+ "version": "0.25.9",
+ "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.9.tgz",
+ "integrity": "sha512-RmF0AsMzgt25qzqqLc1+MbHmhdx0ojF2Fvs4XnOqz2ZOBXzzkEwc/dJQZCYHAn7v1jbVOjAZfK8msRn4BxO4VQ==",
"requires": {
- "sourcemap-codec": "^1.4.4"
+ "sourcemap-codec": "^1.4.8"
}
},
"make-dir": {
diff --git a/package.json b/package.json
index 6cf2034f..1f4488f5 100644
--- a/package.json
+++ b/package.json
@@ -97,6 +97,7 @@
"gzip-size": "^6.0.0",
"kleur": "^4.1.3",
"lodash.merge": "^4.6.2",
+ "magic-string": "^0.25.9",
"postcss": "^8.2.1",
"pretty-bytes": "^5.4.1",
"rollup": "^2.35.1",
diff --git a/src/index.js b/src/index.js
index 06a36d29..c1e2f151 100644
--- a/src/index.js
+++ b/src/index.js
@@ -39,6 +39,7 @@ import {
import { getConfigFromPkgJson, getName } from './lib/package-info';
import { shouldCssModules, cssModulesConfig } from './lib/css-modules';
import { EOL } from 'os';
+import MagicString from 'magic-string';
// Extensions to use when resolving modules
const EXTENSIONS = ['.ts', '.tsx', '.js', '.jsx', '.es6', '.es', '.mjs'];
@@ -653,17 +654,36 @@ function createConfig(options, entry, format, writeMeta) {
// So we remove the globalThis check, replacing it with `this||self` to match Rollup 1's output:
renderChunk(code, chunk, opts) {
if (opts.format === 'umd') {
- // minified:
- code = code.replace(
+ // Can swap this out with MagicString.replace() when we bump it:
+ // https://github.com/developit/microbundle/blob/f815a01cb63d90b9f847a4dcad2a64e6b2f8596f/src/index.js#L657-L671
+ const s = new MagicString(code);
+
+ const minified = code.match(
/([a-zA-Z$_]+)="undefined"!=typeof globalThis\?globalThis:(\1\|\|self)/,
- '$2',
);
- // unminified:
- code = code.replace(
+ if (minified) {
+ s.overwrite(
+ minified.index,
+ minified.index + minified[0].length,
+ minified[2],
+ );
+ }
+
+ const unminified = code.match(
/(global *= *)typeof +globalThis *!== *['"]undefined['"] *\? *globalThis *: *(global *\|\| *self)/,
- '$1$2',
);
- return { code, map: null };
+ if (unminified) {
+ s.overwrite(
+ unminified.index,
+ unminified.index + unminified[0].length,
+ unminified[1] + unminified[2],
+ );
+ }
+
+ return {
+ code: s.toString(),
+ map: s.generateMap({ hires: true }),
+ };
}
},
// Grab size info before writing files to disk:
diff --git a/test/__snapshots__/index.test.js.snap b/test/__snapshots__/index.test.js.snap
index 1155d4f2..cabd2132 100644
--- a/test/__snapshots__/index.test.js.snap
+++ b/test/__snapshots__/index.test.js.snap
@@ -1930,7 +1930,7 @@ exports[`fixtures build inline-source-map with microbundle 4`] = `
exports[`fixtures build inline-source-map with microbundle 5`] = `
"!function(e,n){\\"object\\"==typeof exports&&\\"undefined\\"!=typeof module?module.exports=n():\\"function\\"==typeof define&&define.amd?define(n):(e||self).inlineSourceMap=n()}(this,function(){var e=function(){try{var e=arguments;return Promise.resolve([].slice.call(e).reduce(function(e,n){return e+n},0))}catch(e){return Promise.reject(e)}};return function(){try{var n=arguments,r=[].slice.call(n);return Promise.resolve(e.apply(void 0,r)).then(function(n){return Promise.resolve(e.apply(void 0,r)).then(function(e){return[n,e]})})}catch(e){return Promise.reject(e)}}});
-//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5saW5lLXNvdXJjZS1tYXAudW1kLmpzIiwic291cmNlcyI6WyIuLi9zcmMvdHdvLmpzIiwiLi4vc3JjL2luZGV4LmpzIl0sInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCBhc3luYyBmdW5jdGlvbiB0d28oLi4uYXJncykge1xuXHRyZXR1cm4gYXJncy5yZWR1Y2UoKHRvdGFsLCB2YWx1ZSkgPT4gdG90YWwgKyB2YWx1ZSwgMCk7XG59XG4iLCJpbXBvcnQgeyB0d28gfSBmcm9tICcuL3R3byc7XG5cbmV4cG9ydCBkZWZhdWx0IGFzeW5jIGZ1bmN0aW9uKC4uLmFyZ3MpIHtcblx0cmV0dXJuIFthd2FpdCB0d28oLi4uYXJncyksIGF3YWl0IHR3byguLi5hcmdzKV07XG59XG4iXSwibmFtZXMiOlsidHdvIiwicmVkdWNlIiwidG90YWwiLCJ2YWx1ZSIsImFyZ3MiXSwibWFwcGluZ3MiOiJzT0FBc0JBLGlDQUNyQix1QkFBTyxpQkFBS0MsT0FBTyxTQUFDQyxFQUFPQyxVQUFVRCxFQUFRQyxHQUFPLElBRHJELDBFQ0VpQ0MsMENBQ2xCSixlQUFPSSw0Q0FBYUosZUFBT0kscUJBQXpDLE1BQU8sVUFEUiJ9
+//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5saW5lLXNvdXJjZS1tYXAudW1kLmpzIiwic291cmNlcyI6WyIuLi9zcmMvdHdvLmpzIiwiLi4vc3JjL2luZGV4LmpzIl0sInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCBhc3luYyBmdW5jdGlvbiB0d28oLi4uYXJncykge1xuXHRyZXR1cm4gYXJncy5yZWR1Y2UoKHRvdGFsLCB2YWx1ZSkgPT4gdG90YWwgKyB2YWx1ZSwgMCk7XG59XG4iLCJpbXBvcnQgeyB0d28gfSBmcm9tICcuL3R3byc7XG5cbmV4cG9ydCBkZWZhdWx0IGFzeW5jIGZ1bmN0aW9uKC4uLmFyZ3MpIHtcblx0cmV0dXJuIFthd2FpdCB0d28oLi4uYXJncyksIGF3YWl0IHR3byguLi5hcmdzKV07XG59XG4iXSwibmFtZXMiOlsidHdvIiwicmVkdWNlIiwidG90YWwiLCJ2YWx1ZSIsImFyZ3MiXSwibWFwcGluZ3MiOiIwTEFBc0JBLGlDQUNyQix1QkFBTyxpQkFBS0MsT0FBTyxTQUFDQyxFQUFPQyxVQUFVRCxFQUFRQyxHQUFPLElBRHJELDBFQ0VpQ0MsMENBQ2xCSixlQUFPSSw0Q0FBYUosZUFBT0kscUJBQXpDLE1BQU8sVUFEUiJ9
"
`;
From 00016d892b1eb89df3ececbbb896b1cd3bddde7d Mon Sep 17 00:00:00 2001
From: Ryan Christian <33403762+rschristian@users.noreply.github.com>
Date: Thu, 23 Oct 2025 20:01:00 -0500
Subject: [PATCH 49/50] ci: Bump CI actions (#1082)
* ci: Bump CI versions
* ci: Limit compressed-size to microbundle itself
* ci: Limit push CI to master
* test: Drop output messages from tests, not reliable enough nor completely necessary
* ci: Revert removal of test reporter
* ci: Downgrade Node versions
* revert: Try reverting this whilst we're at it
* ci: Bump release workflow
---
.github/workflows/nodejs.yml | 22 +++++-----------------
.github/workflows/release.yml | 8 ++++----
.github/workflows/size.yml | 2 +-
3 files changed, 10 insertions(+), 22 deletions(-)
diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml
index 51f60d6f..5cc3932f 100644
--- a/.github/workflows/nodejs.yml
+++ b/.github/workflows/nodejs.yml
@@ -3,9 +3,8 @@ name: Node CI
on:
pull_request: {}
push:
- branches-ignore:
- - trying.tmp
- - staging.tmp
+ branches:
+ - master
jobs:
build:
@@ -16,23 +15,12 @@ jobs:
node-version: [12.x, 14.x]
steps:
- - uses: actions/checkout@v1
+ - uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
- uses: actions/setup-node@v1
+ uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- - name: Cache node modules
- uses: actions/cache@v1
- env:
- cache-name: cache-node-modules
- with:
- path: ~/.npm
- # This uses the same name as the build-action so we can share the caches.
- key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
- restore-keys: |
- ${{ runner.os }}-build-${{ env.cache-name }}-
- ${{ runner.os }}-build-
- ${{ runner.os }}-
+ cache: npm
- run: npm ci --ignore-scripts
- name: npm build and test
run: npm test
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 9548e01c..d3fd15c6 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -11,15 +11,15 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
- uses: actions/checkout@master
+ uses: actions/checkout@v4
with:
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
fetch-depth: 0
- - name: Setup Node.js 12.x
- uses: actions/setup-node@master
+ - name: Setup Node.js 22.x
+ uses: actions/setup-node@v4
with:
- node-version: 12.x
+ node-version: 22.x
- name: Install Dependencies
run: npm install
diff --git a/.github/workflows/size.yml b/.github/workflows/size.yml
index e1d7f789..d6fc9378 100644
--- a/.github/workflows/size.yml
+++ b/.github/workflows/size.yml
@@ -8,7 +8,7 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v2
+ - uses: actions/checkout@v4
- name: compressed-size-action
uses: preactjs/compressed-size-action@v2
From 9f56e06b0d1d412f3f0aa4c94d332e77791dd09b Mon Sep 17 00:00:00 2001
From: Andre Wiggins <459878+andrewiggins@users.noreply.github.com>
Date: Thu, 23 Oct 2025 18:08:29 -0700
Subject: [PATCH 50/50] Format repo (#1096)
Ran `npm run format` to fix up some formatting issues in the repo
---
test/__snapshots__/index.test.js.snap | 6 +++---
test/fixtures/basic-compress-false/src/index.js | 2 +-
test/fixtures/basic-css/src/index.js | 2 +-
test/fixtures/basic-dashed-external/src/index.js | 2 +-
test/fixtures/basic-json/src/index.js | 2 +-
test/fixtures/basic-no-compress/src/index.js | 2 +-
test/fixtures/basic-no-pkg-main/src/index.js | 2 +-
test/fixtures/basic-with-cwd/basic/src/index.js | 2 +-
test/fixtures/basic/src/index.js | 2 +-
test/fixtures/css-modules--false/src/index.js | 2 +-
test/fixtures/css-modules--null/src/index.js | 2 +-
test/fixtures/css-modules--string/src/index.js | 2 +-
test/fixtures/css-modules--true/src/index.js | 2 +-
test/fixtures/custom-outputs-alt/src/index.js | 2 +-
test/fixtures/custom-outputs/src/index.js | 2 +-
.../custom-source/src/custom-source.js | 2 +-
test/fixtures/custom-source/src/custom-source.js | 2 +-
test/fixtures/inline-source-map/src/index.js | 2 +-
test/fixtures/mangle-json-file/src/index.js | 2 +-
test/fixtures/minify-config/src/index.js | 2 +-
test/fixtures/minify-path-config/src/index.js | 2 +-
.../minify-path-parent-dir/index.js | 2 +-
test/fixtures/modern-generators/src/index.js | 2 +-
test/fixtures/modern/src/index.js | 2 +-
test/fixtures/name-custom-amd/src/index.js | 2 +-
test/fixtures/name-custom-cli/src/index.js | 2 +-
test/fixtures/no-pkg-name/src/index.js | 2 +-
test/fixtures/no-pkg/src/index.js | 2 +-
28 files changed, 30 insertions(+), 30 deletions(-)
diff --git a/test/__snapshots__/index.test.js.snap b/test/__snapshots__/index.test.js.snap
index cabd2132..27dedc37 100644
--- a/test/__snapshots__/index.test.js.snap
+++ b/test/__snapshots__/index.test.js.snap
@@ -1918,19 +1918,19 @@ exports[`fixtures build inline-source-map with microbundle 2`] = `3`;
exports[`fixtures build inline-source-map with microbundle 3`] = `
"var r=function(){try{var r=arguments;return Promise.resolve([].slice.call(r).reduce(function(r,e){return r+e},0))}catch(r){return Promise.reject(r)}};export default function(){try{var e=arguments,t=[].slice.call(e);return Promise.resolve(r.apply(void 0,t)).then(function(e){return Promise.resolve(r.apply(void 0,t)).then(function(r){return[e,r]})})}catch(r){return Promise.reject(r)}}
-//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5saW5lLXNvdXJjZS1tYXAuZXNtLm1qcyIsInNvdXJjZXMiOlsiLi4vc3JjL3R3by5qcyIsIi4uL3NyYy9pbmRleC5qcyJdLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgYXN5bmMgZnVuY3Rpb24gdHdvKC4uLmFyZ3MpIHtcblx0cmV0dXJuIGFyZ3MucmVkdWNlKCh0b3RhbCwgdmFsdWUpID0+IHRvdGFsICsgdmFsdWUsIDApO1xufVxuIiwiaW1wb3J0IHsgdHdvIH0gZnJvbSAnLi90d28nO1xuXG5leHBvcnQgZGVmYXVsdCBhc3luYyBmdW5jdGlvbiguLi5hcmdzKSB7XG5cdHJldHVybiBbYXdhaXQgdHdvKC4uLmFyZ3MpLCBhd2FpdCB0d28oLi4uYXJncyldO1xufVxuIl0sIm5hbWVzIjpbInR3byIsInJlZHVjZSIsInRvdGFsIiwidmFsdWUiLCJhcmdzIl0sIm1hcHBpbmdzIjoiSUFBc0JBLGlDQUNyQix1QkFBTyxpQkFBS0MsT0FBTyxTQUFDQyxFQUFPQyxVQUFVRCxFQUFRQyxHQUFPLElBRHJELGtGQ0VpQ0MsMENBQ2xCSixlQUFPSSw0Q0FBYUosZUFBT0kscUJBQXpDLE1BQU8sVUFEUiJ9
+//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5saW5lLXNvdXJjZS1tYXAuZXNtLm1qcyIsInNvdXJjZXMiOlsiLi4vc3JjL3R3by5qcyIsIi4uL3NyYy9pbmRleC5qcyJdLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgYXN5bmMgZnVuY3Rpb24gdHdvKC4uLmFyZ3MpIHtcblx0cmV0dXJuIGFyZ3MucmVkdWNlKCh0b3RhbCwgdmFsdWUpID0+IHRvdGFsICsgdmFsdWUsIDApO1xufVxuIiwiaW1wb3J0IHsgdHdvIH0gZnJvbSAnLi90d28nO1xuXG5leHBvcnQgZGVmYXVsdCBhc3luYyBmdW5jdGlvbiAoLi4uYXJncykge1xuXHRyZXR1cm4gW2F3YWl0IHR3byguLi5hcmdzKSwgYXdhaXQgdHdvKC4uLmFyZ3MpXTtcbn1cbiJdLCJuYW1lcyI6WyJ0d28iLCJyZWR1Y2UiLCJ0b3RhbCIsInZhbHVlIiwiYXJncyJdLCJtYXBwaW5ncyI6IklBQXNCQSxpQ0FDckIsdUJBQU8saUJBQUtDLE9BQU8sU0FBQ0MsRUFBT0MsVUFBVUQsRUFBUUMsR0FBTyxJQURyRCxrRkNFa0NDLDBDQUNuQkosZUFBT0ksNENBQWFKLGVBQU9JLHFCQUF6QyxNQUFPLFVBRFIifQ==
"
`;
exports[`fixtures build inline-source-map with microbundle 4`] = `
"var r=function(){try{var r=arguments;return Promise.resolve([].slice.call(r).reduce(function(r,e){return r+e},0))}catch(r){return Promise.reject(r)}};module.exports=function(){try{var e=arguments,t=[].slice.call(e);return Promise.resolve(r.apply(void 0,t)).then(function(e){return Promise.resolve(r.apply(void 0,t)).then(function(r){return[e,r]})})}catch(r){return Promise.reject(r)}};
-//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5saW5lLXNvdXJjZS1tYXAuanMiLCJzb3VyY2VzIjpbIi4uL3NyYy90d28uanMiLCIuLi9zcmMvaW5kZXguanMiXSwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IGFzeW5jIGZ1bmN0aW9uIHR3byguLi5hcmdzKSB7XG5cdHJldHVybiBhcmdzLnJlZHVjZSgodG90YWwsIHZhbHVlKSA9PiB0b3RhbCArIHZhbHVlLCAwKTtcbn1cbiIsImltcG9ydCB7IHR3byB9IGZyb20gJy4vdHdvJztcblxuZXhwb3J0IGRlZmF1bHQgYXN5bmMgZnVuY3Rpb24oLi4uYXJncykge1xuXHRyZXR1cm4gW2F3YWl0IHR3byguLi5hcmdzKSwgYXdhaXQgdHdvKC4uLmFyZ3MpXTtcbn1cbiJdLCJuYW1lcyI6WyJ0d28iLCJyZWR1Y2UiLCJ0b3RhbCIsInZhbHVlIiwiYXJncyJdLCJtYXBwaW5ncyI6IklBQXNCQSxpQ0FDckIsdUJBQU8saUJBQUtDLE9BQU8sU0FBQ0MsRUFBT0MsVUFBVUQsRUFBUUMsR0FBTyxJQURyRCxrRkNFaUNDLDBDQUNsQkosZUFBT0ksNENBQWFKLGVBQU9JLHFCQUF6QyxNQUFPLFVBRFIifQ==
+//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5saW5lLXNvdXJjZS1tYXAuanMiLCJzb3VyY2VzIjpbIi4uL3NyYy90d28uanMiLCIuLi9zcmMvaW5kZXguanMiXSwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IGFzeW5jIGZ1bmN0aW9uIHR3byguLi5hcmdzKSB7XG5cdHJldHVybiBhcmdzLnJlZHVjZSgodG90YWwsIHZhbHVlKSA9PiB0b3RhbCArIHZhbHVlLCAwKTtcbn1cbiIsImltcG9ydCB7IHR3byB9IGZyb20gJy4vdHdvJztcblxuZXhwb3J0IGRlZmF1bHQgYXN5bmMgZnVuY3Rpb24gKC4uLmFyZ3MpIHtcblx0cmV0dXJuIFthd2FpdCB0d28oLi4uYXJncyksIGF3YWl0IHR3byguLi5hcmdzKV07XG59XG4iXSwibmFtZXMiOlsidHdvIiwicmVkdWNlIiwidG90YWwiLCJ2YWx1ZSIsImFyZ3MiXSwibWFwcGluZ3MiOiJJQUFzQkEsaUNBQ3JCLHVCQUFPLGlCQUFLQyxPQUFPLFNBQUNDLEVBQU9DLFVBQVVELEVBQVFDLEdBQU8sSUFEckQsa0ZDRWtDQywwQ0FDbkJKLGVBQU9JLDRDQUFhSixlQUFPSSxxQkFBekMsTUFBTyxVQURSIn0=
"
`;
exports[`fixtures build inline-source-map with microbundle 5`] = `
"!function(e,n){\\"object\\"==typeof exports&&\\"undefined\\"!=typeof module?module.exports=n():\\"function\\"==typeof define&&define.amd?define(n):(e||self).inlineSourceMap=n()}(this,function(){var e=function(){try{var e=arguments;return Promise.resolve([].slice.call(e).reduce(function(e,n){return e+n},0))}catch(e){return Promise.reject(e)}};return function(){try{var n=arguments,r=[].slice.call(n);return Promise.resolve(e.apply(void 0,r)).then(function(n){return Promise.resolve(e.apply(void 0,r)).then(function(e){return[n,e]})})}catch(e){return Promise.reject(e)}}});
-//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5saW5lLXNvdXJjZS1tYXAudW1kLmpzIiwic291cmNlcyI6WyIuLi9zcmMvdHdvLmpzIiwiLi4vc3JjL2luZGV4LmpzIl0sInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCBhc3luYyBmdW5jdGlvbiB0d28oLi4uYXJncykge1xuXHRyZXR1cm4gYXJncy5yZWR1Y2UoKHRvdGFsLCB2YWx1ZSkgPT4gdG90YWwgKyB2YWx1ZSwgMCk7XG59XG4iLCJpbXBvcnQgeyB0d28gfSBmcm9tICcuL3R3byc7XG5cbmV4cG9ydCBkZWZhdWx0IGFzeW5jIGZ1bmN0aW9uKC4uLmFyZ3MpIHtcblx0cmV0dXJuIFthd2FpdCB0d28oLi4uYXJncyksIGF3YWl0IHR3byguLi5hcmdzKV07XG59XG4iXSwibmFtZXMiOlsidHdvIiwicmVkdWNlIiwidG90YWwiLCJ2YWx1ZSIsImFyZ3MiXSwibWFwcGluZ3MiOiIwTEFBc0JBLGlDQUNyQix1QkFBTyxpQkFBS0MsT0FBTyxTQUFDQyxFQUFPQyxVQUFVRCxFQUFRQyxHQUFPLElBRHJELDBFQ0VpQ0MsMENBQ2xCSixlQUFPSSw0Q0FBYUosZUFBT0kscUJBQXpDLE1BQU8sVUFEUiJ9
+//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5saW5lLXNvdXJjZS1tYXAudW1kLmpzIiwic291cmNlcyI6WyIuLi9zcmMvdHdvLmpzIiwiLi4vc3JjL2luZGV4LmpzIl0sInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCBhc3luYyBmdW5jdGlvbiB0d28oLi4uYXJncykge1xuXHRyZXR1cm4gYXJncy5yZWR1Y2UoKHRvdGFsLCB2YWx1ZSkgPT4gdG90YWwgKyB2YWx1ZSwgMCk7XG59XG4iLCJpbXBvcnQgeyB0d28gfSBmcm9tICcuL3R3byc7XG5cbmV4cG9ydCBkZWZhdWx0IGFzeW5jIGZ1bmN0aW9uICguLi5hcmdzKSB7XG5cdHJldHVybiBbYXdhaXQgdHdvKC4uLmFyZ3MpLCBhd2FpdCB0d28oLi4uYXJncyldO1xufVxuIl0sIm5hbWVzIjpbInR3byIsInJlZHVjZSIsInRvdGFsIiwidmFsdWUiLCJhcmdzIl0sIm1hcHBpbmdzIjoiMExBQXNCQSxpQ0FDckIsdUJBQU8saUJBQUtDLE9BQU8sU0FBQ0MsRUFBT0MsVUFBVUQsRUFBUUMsR0FBTyxJQURyRCwwRUNFa0NDLDBDQUNuQkosZUFBT0ksNENBQWFKLGVBQU9JLHFCQUF6QyxNQUFPLFVBRFIifQ==
"
`;
diff --git a/test/fixtures/basic-compress-false/src/index.js b/test/fixtures/basic-compress-false/src/index.js
index a756a0a4..c0a2efb0 100644
--- a/test/fixtures/basic-compress-false/src/index.js
+++ b/test/fixtures/basic-compress-false/src/index.js
@@ -1,5 +1,5 @@
import { two } from './two';
-export default async function(...args) {
+export default async function (...args) {
return [await two(...args), await two(...args)];
}
diff --git a/test/fixtures/basic-css/src/index.js b/test/fixtures/basic-css/src/index.js
index 3a807d79..69d12538 100644
--- a/test/fixtures/basic-css/src/index.js
+++ b/test/fixtures/basic-css/src/index.js
@@ -1,6 +1,6 @@
import './two.css';
-export default function() {
+export default function () {
const el = document.createElement('div');
el.className = 'testing';
return el;
diff --git a/test/fixtures/basic-dashed-external/src/index.js b/test/fixtures/basic-dashed-external/src/index.js
index f1fd29e2..dd7e2f97 100644
--- a/test/fixtures/basic-dashed-external/src/index.js
+++ b/test/fixtures/basic-dashed-external/src/index.js
@@ -3,6 +3,6 @@ console.log(tinyglob);
import { two } from './two';
-export default async function(...args) {
+export default async function (...args) {
return [await two(...args), await two(...args)];
}
diff --git a/test/fixtures/basic-json/src/index.js b/test/fixtures/basic-json/src/index.js
index c00eab09..88442f08 100644
--- a/test/fixtures/basic-json/src/index.js
+++ b/test/fixtures/basic-json/src/index.js
@@ -1,5 +1,5 @@
import two from './two.json';
-export default async function(...args) {
+export default async function (...args) {
return two;
}
diff --git a/test/fixtures/basic-no-compress/src/index.js b/test/fixtures/basic-no-compress/src/index.js
index a756a0a4..c0a2efb0 100644
--- a/test/fixtures/basic-no-compress/src/index.js
+++ b/test/fixtures/basic-no-compress/src/index.js
@@ -1,5 +1,5 @@
import { two } from './two';
-export default async function(...args) {
+export default async function (...args) {
return [await two(...args), await two(...args)];
}
diff --git a/test/fixtures/basic-no-pkg-main/src/index.js b/test/fixtures/basic-no-pkg-main/src/index.js
index a756a0a4..c0a2efb0 100644
--- a/test/fixtures/basic-no-pkg-main/src/index.js
+++ b/test/fixtures/basic-no-pkg-main/src/index.js
@@ -1,5 +1,5 @@
import { two } from './two';
-export default async function(...args) {
+export default async function (...args) {
return [await two(...args), await two(...args)];
}
diff --git a/test/fixtures/basic-with-cwd/basic/src/index.js b/test/fixtures/basic-with-cwd/basic/src/index.js
index a756a0a4..c0a2efb0 100644
--- a/test/fixtures/basic-with-cwd/basic/src/index.js
+++ b/test/fixtures/basic-with-cwd/basic/src/index.js
@@ -1,5 +1,5 @@
import { two } from './two';
-export default async function(...args) {
+export default async function (...args) {
return [await two(...args), await two(...args)];
}
diff --git a/test/fixtures/basic/src/index.js b/test/fixtures/basic/src/index.js
index a756a0a4..c0a2efb0 100644
--- a/test/fixtures/basic/src/index.js
+++ b/test/fixtures/basic/src/index.js
@@ -1,5 +1,5 @@
import { two } from './two';
-export default async function(...args) {
+export default async function (...args) {
return [await two(...args), await two(...args)];
}
diff --git a/test/fixtures/css-modules--false/src/index.js b/test/fixtures/css-modules--false/src/index.js
index 6edf3533..430e7c19 100644
--- a/test/fixtures/css-modules--false/src/index.js
+++ b/test/fixtures/css-modules--false/src/index.js
@@ -1,4 +1,4 @@
import './not_scoped.css';
import './not_scoped.module.css';
-export default function() {}
+export default function () {}
diff --git a/test/fixtures/css-modules--null/src/index.js b/test/fixtures/css-modules--null/src/index.js
index e2bfa463..74b754fb 100644
--- a/test/fixtures/css-modules--null/src/index.js
+++ b/test/fixtures/css-modules--null/src/index.js
@@ -1,7 +1,7 @@
import './not_scoped.css';
import scoped from './scoped.module.css';
-export default function() {
+export default function () {
const el = document.createElement('div');
el.className = scoped.scoped_class;
return el;
diff --git a/test/fixtures/css-modules--string/src/index.js b/test/fixtures/css-modules--string/src/index.js
index 7fac50a4..ef4849de 100644
--- a/test/fixtures/css-modules--string/src/index.js
+++ b/test/fixtures/css-modules--string/src/index.js
@@ -1,7 +1,7 @@
import global from './scoped.css';
import scoped from './scoped.module.css';
-export default function() {
+export default function () {
const el = document.createElement('div');
el.className =
scoped.scoped_class + ' ' + global.test_class_that_should_be_scoped;
diff --git a/test/fixtures/css-modules--true/src/index.js b/test/fixtures/css-modules--true/src/index.js
index 7fac50a4..ef4849de 100644
--- a/test/fixtures/css-modules--true/src/index.js
+++ b/test/fixtures/css-modules--true/src/index.js
@@ -1,7 +1,7 @@
import global from './scoped.css';
import scoped from './scoped.module.css';
-export default function() {
+export default function () {
const el = document.createElement('div');
el.className =
scoped.scoped_class + ' ' + global.test_class_that_should_be_scoped;
diff --git a/test/fixtures/custom-outputs-alt/src/index.js b/test/fixtures/custom-outputs-alt/src/index.js
index a756a0a4..c0a2efb0 100644
--- a/test/fixtures/custom-outputs-alt/src/index.js
+++ b/test/fixtures/custom-outputs-alt/src/index.js
@@ -1,5 +1,5 @@
import { two } from './two';
-export default async function(...args) {
+export default async function (...args) {
return [await two(...args), await two(...args)];
}
diff --git a/test/fixtures/custom-outputs/src/index.js b/test/fixtures/custom-outputs/src/index.js
index a756a0a4..c0a2efb0 100644
--- a/test/fixtures/custom-outputs/src/index.js
+++ b/test/fixtures/custom-outputs/src/index.js
@@ -1,5 +1,5 @@
import { two } from './two';
-export default async function(...args) {
+export default async function (...args) {
return [await two(...args), await two(...args)];
}
diff --git a/test/fixtures/custom-source-with-cwd/custom-source/src/custom-source.js b/test/fixtures/custom-source-with-cwd/custom-source/src/custom-source.js
index a756a0a4..c0a2efb0 100644
--- a/test/fixtures/custom-source-with-cwd/custom-source/src/custom-source.js
+++ b/test/fixtures/custom-source-with-cwd/custom-source/src/custom-source.js
@@ -1,5 +1,5 @@
import { two } from './two';
-export default async function(...args) {
+export default async function (...args) {
return [await two(...args), await two(...args)];
}
diff --git a/test/fixtures/custom-source/src/custom-source.js b/test/fixtures/custom-source/src/custom-source.js
index a756a0a4..c0a2efb0 100644
--- a/test/fixtures/custom-source/src/custom-source.js
+++ b/test/fixtures/custom-source/src/custom-source.js
@@ -1,5 +1,5 @@
import { two } from './two';
-export default async function(...args) {
+export default async function (...args) {
return [await two(...args), await two(...args)];
}
diff --git a/test/fixtures/inline-source-map/src/index.js b/test/fixtures/inline-source-map/src/index.js
index a756a0a4..c0a2efb0 100644
--- a/test/fixtures/inline-source-map/src/index.js
+++ b/test/fixtures/inline-source-map/src/index.js
@@ -1,5 +1,5 @@
import { two } from './two';
-export default async function(...args) {
+export default async function (...args) {
return [await two(...args), await two(...args)];
}
diff --git a/test/fixtures/mangle-json-file/src/index.js b/test/fixtures/mangle-json-file/src/index.js
index 8d0f5527..cca8c9ac 100644
--- a/test/fixtures/mangle-json-file/src/index.js
+++ b/test/fixtures/mangle-json-file/src/index.js
@@ -1,6 +1,6 @@
import { two } from './two';
-export default function() {
+export default function () {
console.log(two.prop1);
console.log(two._prop2);
return two;
diff --git a/test/fixtures/minify-config/src/index.js b/test/fixtures/minify-config/src/index.js
index 8d0f5527..cca8c9ac 100644
--- a/test/fixtures/minify-config/src/index.js
+++ b/test/fixtures/minify-config/src/index.js
@@ -1,6 +1,6 @@
import { two } from './two';
-export default function() {
+export default function () {
console.log(two.prop1);
console.log(two._prop2);
return two;
diff --git a/test/fixtures/minify-path-config/src/index.js b/test/fixtures/minify-path-config/src/index.js
index 8d0f5527..cca8c9ac 100644
--- a/test/fixtures/minify-path-config/src/index.js
+++ b/test/fixtures/minify-path-config/src/index.js
@@ -1,6 +1,6 @@
import { two } from './two';
-export default function() {
+export default function () {
console.log(two.prop1);
console.log(two._prop2);
return two;
diff --git a/test/fixtures/minify-path-parent-dir-with-cwd/minify-path-parent-dir/index.js b/test/fixtures/minify-path-parent-dir-with-cwd/minify-path-parent-dir/index.js
index 8d0f5527..cca8c9ac 100644
--- a/test/fixtures/minify-path-parent-dir-with-cwd/minify-path-parent-dir/index.js
+++ b/test/fixtures/minify-path-parent-dir-with-cwd/minify-path-parent-dir/index.js
@@ -1,6 +1,6 @@
import { two } from './two';
-export default function() {
+export default function () {
console.log(two.prop1);
console.log(two._prop2);
return two;
diff --git a/test/fixtures/modern-generators/src/index.js b/test/fixtures/modern-generators/src/index.js
index a9d95a89..551eefcf 100644
--- a/test/fixtures/modern-generators/src/index.js
+++ b/test/fixtures/modern-generators/src/index.js
@@ -1,6 +1,6 @@
import { idMaker } from './two';
-export default async function() {
+export default async function () {
const gen = idMaker();
return [gen.next().value, gen.next().value];
}
diff --git a/test/fixtures/modern/src/index.js b/test/fixtures/modern/src/index.js
index a756a0a4..c0a2efb0 100644
--- a/test/fixtures/modern/src/index.js
+++ b/test/fixtures/modern/src/index.js
@@ -1,5 +1,5 @@
import { two } from './two';
-export default async function(...args) {
+export default async function (...args) {
return [await two(...args), await two(...args)];
}
diff --git a/test/fixtures/name-custom-amd/src/index.js b/test/fixtures/name-custom-amd/src/index.js
index a756a0a4..c0a2efb0 100644
--- a/test/fixtures/name-custom-amd/src/index.js
+++ b/test/fixtures/name-custom-amd/src/index.js
@@ -1,5 +1,5 @@
import { two } from './two';
-export default async function(...args) {
+export default async function (...args) {
return [await two(...args), await two(...args)];
}
diff --git a/test/fixtures/name-custom-cli/src/index.js b/test/fixtures/name-custom-cli/src/index.js
index a756a0a4..c0a2efb0 100644
--- a/test/fixtures/name-custom-cli/src/index.js
+++ b/test/fixtures/name-custom-cli/src/index.js
@@ -1,5 +1,5 @@
import { two } from './two';
-export default async function(...args) {
+export default async function (...args) {
return [await two(...args), await two(...args)];
}
diff --git a/test/fixtures/no-pkg-name/src/index.js b/test/fixtures/no-pkg-name/src/index.js
index a756a0a4..c0a2efb0 100644
--- a/test/fixtures/no-pkg-name/src/index.js
+++ b/test/fixtures/no-pkg-name/src/index.js
@@ -1,5 +1,5 @@
import { two } from './two';
-export default async function(...args) {
+export default async function (...args) {
return [await two(...args), await two(...args)];
}
diff --git a/test/fixtures/no-pkg/src/index.js b/test/fixtures/no-pkg/src/index.js
index a756a0a4..c0a2efb0 100644
--- a/test/fixtures/no-pkg/src/index.js
+++ b/test/fixtures/no-pkg/src/index.js
@@ -1,5 +1,5 @@
import { two } from './two';
-export default async function(...args) {
+export default async function (...args) {
return [await two(...args), await two(...args)];
}