From 60b5edcf5d96c26877134febbdf0a247ee56b9c7 Mon Sep 17 00:00:00 2001
From: Jeff Posnick
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 11/13] 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: 2025年10月23日 20:01:00 -0500 Subject: [PATCH 12/13] 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: 2025年10月23日 18:08:29 -0700 Subject: [PATCH 13/13] 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)]; }