From abdd87e804cd50a8c56b17bb295f6e40842a3f16 Mon Sep 17 00:00:00 2001 From: Leah Date: Mon, 27 May 2019 23:29:54 +0200 Subject: [PATCH 01/13] fix: breaking updates --- package.json | 34 ++++++++++++------------- test/__snapshots__/index.test.js.snap | 36 +++++++++++++-------------- 2 files changed, 35 insertions(+), 35 deletions(-) diff --git a/package.json b/package.json index b68b520..68a232f 100644 --- a/package.json +++ b/package.json @@ -42,7 +42,7 @@ "author": "Jason Miller (http://jasonformat.com)", "license": "MIT", "dependencies": { - "@babel/core": "^7.4.4", + "@babel/core": "^7.4.5", "@babel/plugin-proposal-class-properties": "7.4.4", "@babel/plugin-syntax-jsx": "^7.2.0", "@babel/plugin-transform-flow-strip-types": "^7.4.4", @@ -51,28 +51,28 @@ "@babel/preset-flow": "^7.0.0", "asyncro": "^3.0.0", "autoprefixer": "^9.5.1", - "babel-plugin-transform-async-to-promises": "^0.8.10", + "babel-plugin-transform-async-to-promises": "^0.8.11", "babel-plugin-transform-replace-expressions": "^0.2.0", "brotli-size": "^0.1.0", "camelcase": "^5.3.1", "cssnano": "^4.1.10", "es6-promisify": "^6.0.1", "filesize": "^4.1.2", - "gzip-size": "^5.1.0", + "gzip-size": "^5.1.1", "kleur": "^3.0.3", "module-details-from-path": "^1.0.3", "pretty-bytes": "^5.2.0", - "rollup": "^1.11.3", + "rollup": "^1.12.4", "rollup-plugin-alias": "^1.5.1", "rollup-plugin-babel": "^4.3.2", "rollup-plugin-bundle-size": "^1.0.1", - "rollup-plugin-commonjs": "^9.0.0", + "rollup-plugin-commonjs": "^10.0.0", "rollup-plugin-es3": "^1.1.0", "rollup-plugin-json": "^4.0.0", - "rollup-plugin-node-resolve": "^4.2.3", + "rollup-plugin-node-resolve": "^5.0.0", "rollup-plugin-postcss": "^2.0.3", - "rollup-plugin-terser": "^4.0.4", - "rollup-plugin-typescript2": "^0.21.0", + "rollup-plugin-terser": "^5.0.0", + "rollup-plugin-typescript2": "^0.21.1", "sade": "^1.4.0", "tiny-glob": "^0.2.6", "tslib": "^1.9.0", @@ -80,23 +80,23 @@ }, "devDependencies": { "@babel/cli": "^7.4.4", - "@babel/node": "^7.2.2", + "@babel/node": "^7.4.5", "@babel/plugin-proposal-throw-expressions": "^7.2.0", - "@babel/preset-env": "^7.4.4", + "@babel/preset-env": "^7.4.5", "babel-core": "^7.0.0-bridge.0", "babel-jest": "^24.8.0", "cross-env": "^5.2.0", - "directory-tree": "^2.2.2", + "directory-tree": "^2.2.3", "eslint": "^5.16.0", "eslint-config-developit": "^1.1.1", - "eslint-config-prettier": "^4.2.0", - "eslint-plugin-prettier": "^3.0.1", + "eslint-config-prettier": "^4.3.0", + "eslint-plugin-prettier": "^3.1.0", "esm": "^3.2.22", - "fs-extra": "^7.0.1", - "husky": "^2.2.0", + "fs-extra": "^8.0.1", + "husky": "^2.3.0", "jest": "^24.8.0", - "lint-staged": "^8.1.6", - "prettier": "^1.17.0", + "lint-staged": "^8.1.7", + "prettier": "^1.17.1", "regenerator-runtime": "^0.13.2", "rimraf": "^2.6.3", "shell-quote": "^1.6.1", diff --git a/test/__snapshots__/index.test.js.snap b/test/__snapshots__/index.test.js.snap index 538a788..8d3b91b 100644 --- a/test/__snapshots__/index.test.js.snap +++ b/test/__snapshots__/index.test.js.snap @@ -65,30 +65,30 @@ async-iife-ts Build \\"asyncIifeTs\\" to dist: -93 B: async-iife-ts.js.gz -74 B: async-iife-ts.js.br -93 B: async-iife-ts.mjs.gz -74 B: async-iife-ts.mjs.br -136 B: async-iife-ts.umd.js.gz -106 B: async-iife-ts.umd.js.br" +100 B: async-iife-ts.js.gz +78 B: async-iife-ts.js.br +100 B: async-iife-ts.mjs.gz +78 B: async-iife-ts.mjs.br +142 B: async-iife-ts.umd.js.gz +105 B: async-iife-ts.umd.js.br" `; exports[`fixtures build async-iife-ts with microbundle 2`] = `7`; exports[`fixtures build async-iife-ts with microbundle 3`] = ` -"!function(){try{console.log(\\"foo\\")}catch(o){return Promise.reject(o)}}(); +"!function(){try{console.log(\\"foo\\"),Promise.resolve()}catch(o){return Promise.reject(o)}}(); //# sourceMappingURL=async-iife-ts.js.map " `; exports[`fixtures build async-iife-ts with microbundle 4`] = ` -"!function(){try{console.log(\\"foo\\")}catch(o){return Promise.reject(o)}}(); +"!function(){try{console.log(\\"foo\\"),Promise.resolve()}catch(o){return Promise.reject(o)}}(); //# sourceMappingURL=async-iife-ts.mjs.map " `; exports[`fixtures build async-iife-ts with microbundle 5`] = ` -"!function(n){\\"function\\"==typeof define&&define.amd?define(n):n()}(function(){!function(){try{console.log(\\"foo\\")}catch(n){return Promise.reject(n)}}()}); +"!function(e){\\"function\\"==typeof define&&define.amd?define(e):e()}(function(){!function(){try{console.log(\\"foo\\"),Promise.resolve()}catch(e){return Promise.reject(e)}}()}); //# sourceMappingURL=async-iife-ts.umd.js.map " `; @@ -910,30 +910,30 @@ esnext-ts Build \\"esnextTs\\" to dist: -826 B: esnext-ts.js.gz -739 B: esnext-ts.js.br -826 B: esnext-ts.mjs.gz -742 B: esnext-ts.mjs.br -893 B: esnext-ts.umd.js.gz -800 B: esnext-ts.umd.js.br" +878 B: esnext-ts.js.gz +786 B: esnext-ts.js.br +877 B: esnext-ts.mjs.gz +786 B: esnext-ts.mjs.br +938 B: esnext-ts.umd.js.gz +841 B: esnext-ts.umd.js.br" `; exports[`fixtures build esnext-ts with microbundle 2`] = `7`; exports[`fixtures build esnext-ts with microbundle 3`] = ` -"var n=function(){function n(){}return n.prototype.then=function(e,r){var i=new n,o=this.s;if(o){var u=1&o?e:r;if(u){try{t(i,1,u(this.v))}catch(n){t(i,2,n)}return i}return this}return this.o=function(n){try{var o=n.v;1&n.s?t(i,1,e?e(o):o):r?t(i,1,r(o)):t(i,2,o)}catch(n){t(i,2,n)}},i},n}();function t(e,r,i){if(!e.s){if(i instanceof n){if(!i.s)return void(i.o=t.bind(null,e,r));1&r&&(r=i.s),i=i.v}if(i&&i.then)return void i.then(t.bind(null,e,r),t.bind(null,e,2));e.s=r,e.v=i;var o=e.o;o&&o(e)}}function e(t){return t instanceof n&&1&t.s}var r=function(){try{var r=[],i=function(r,i,o){if(\\"undefined\\"!=typeof Symbol){var u=Symbol.asyncIterator;if(u&&u in r){var f=function(n){a.next().then(c).then(void 0,h)},c=function(n){n.done?t(v,1):Promise.resolve(i(n.value)).then(f).then(void 0,h)},h=function(n){t(v,2,a.return?a.return().then(function(){return n}):n)},v=new n,a=r[u]();return a.next().then(c).then(void 0,h),v}}return Promise.resolve(function(r,i,o){if(\\"undefined\\"!=typeof Symbol){var u=Symbol.iterator;if(u&&u in r){var f,c,h,v=r[u]();if(function r(o){try{for(;!(f=v.next()).done;)if((o=i(f.value))&&o.then){if(!e(o))return void o.then(r,h||(h=t.bind(null,c=new n,2)));o=o.v}c?t(c,1,o):c=o}catch(n){t(c||(c=new Pact),2,n)}}(),v.return){var a=function(n){try{f.done||v.return()}catch(n){}return n};if(c&&c.then)return c.then(a,function(n){throw a(n)});a()}return c}}if(!(\\"length\\"in r))throw new TypeError(\\"value is not iterable\\");for(var l=[],s=0;s Date: Tue, 28 May 2019 00:24:03 +0200 Subject: [PATCH 02/13] fix: allow disabling minification from cli (#395) --- src/index.js | 3 + test/__snapshots__/index.test.js.snap | 145 +++++++++++++++++++ test/fixtures/basic-no-compress/package.json | 6 + test/fixtures/basic-no-compress/src/index.js | 5 + test/fixtures/basic-no-compress/src/two.js | 3 + 5 files changed, 162 insertions(+) create mode 100644 test/fixtures/basic-no-compress/package.json create mode 100644 test/fixtures/basic-no-compress/src/index.js create mode 100644 test/fixtures/basic-no-compress/src/two.js diff --git a/src/index.js b/src/index.js index 657cb0b..78f98e5 100644 --- a/src/index.js +++ b/src/index.js @@ -164,6 +164,9 @@ export default async function microbundle(inputOptions) { options.multipleEntries = options.entries.length > 1; + // to disable compress you can put in false or 0 but it's a string so our boolean checks won't work + options.compress = options.compress !== 'false' && options.compress !== '0'; + let formats = (options.format || options.formats).split(','); // always compile cjs first if it's there: formats.sort((a, b) => (a === 'cjs' ? -1 : a > b ? 1 : 0)); diff --git a/test/__snapshots__/index.test.js.snap b/test/__snapshots__/index.test.js.snap index 8d3b91b..f0cd346 100644 --- a/test/__snapshots__/index.test.js.snap +++ b/test/__snapshots__/index.test.js.snap @@ -423,6 +423,151 @@ exports[`fixtures build basic-multi-source with microbundle 8`] = ` " `; +exports[`fixtures build basic-no-compress with microbundle 1`] = ` +"Used script: microbundle --compress=false + +Directory tree: + +basic-no-compress + dist + basic-no-compress.js + basic-no-compress.js.map + basic-no-compress.mjs + basic-no-compress.mjs.map + basic-no-compress.umd.js + basic-no-compress.umd.js.map + package.json + src + index.js + two.js + + +Build \\"basicNoCompress\\" to dist: +303 B: basic-no-compress.js.gz +244 B: basic-no-compress.js.br +301 B: basic-no-compress.mjs.gz +244 B: basic-no-compress.mjs.br +422 B: basic-no-compress.umd.js.gz +349 B: basic-no-compress.umd.js.br" +`; + +exports[`fixtures build basic-no-compress with microbundle 2`] = `6`; + +exports[`fixtures build basic-no-compress with microbundle 3`] = ` +"var two = function two() { + try { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + return Promise.resolve(args.reduce(function (total, value) { + return total + value; + }, 0)); + } catch (e) { + return Promise.reject(e); + } +}; + +var index = (function () { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + try { + return Promise.resolve(two.apply(void 0, args)).then(function (_two) { + return Promise.resolve(two.apply(void 0, args)).then(function (_two2) { + return [_two, _two2]; + }); + }); + } catch (e) { + return Promise.reject(e); + } +}); + +module.exports = index; +//# sourceMappingURL=basic-no-compress.js.map +" +`; + +exports[`fixtures build basic-no-compress with microbundle 4`] = ` +"var two = function two() { + try { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + return Promise.resolve(args.reduce(function (total, value) { + return total + value; + }, 0)); + } catch (e) { + return Promise.reject(e); + } +}; + +var index = (function () { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + try { + return Promise.resolve(two.apply(void 0, args)).then(function (_two) { + return Promise.resolve(two.apply(void 0, args)).then(function (_two2) { + return [_two, _two2]; + }); + }); + } catch (e) { + return Promise.reject(e); + } +}); + +export default index; +//# sourceMappingURL=basic-no-compress.mjs.map +" +`; + +exports[`fixtures build basic-no-compress with microbundle 5`] = ` +"(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : + typeof define === 'function' && define.amd ? define(factory) : + (global = global || self, global.basicNoCompress = factory()); +}(this, function () { + var two = function two() { + try { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + return Promise.resolve(args.reduce(function (total, value) { + return total + value; + }, 0)); + } catch (e) { + return Promise.reject(e); + } + }; + + var index = (function () { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + try { + return Promise.resolve(two.apply(void 0, args)).then(function (_two) { + return Promise.resolve(two.apply(void 0, args)).then(function (_two2) { + return [_two, _two2]; + }); + }); + } catch (e) { + return Promise.reject(e); + } + }); + + return index; + +})); +//# sourceMappingURL=basic-no-compress.umd.js.map +" +`; + exports[`fixtures build basic-ts with microbundle 1`] = ` "Used script: microbundle diff --git a/test/fixtures/basic-no-compress/package.json b/test/fixtures/basic-no-compress/package.json new file mode 100644 index 0000000..a233732 --- /dev/null +++ b/test/fixtures/basic-no-compress/package.json @@ -0,0 +1,6 @@ +{ + "name": "basic-no-compress", + "scripts": { + "build": "microbundle --compress=false" + } +} diff --git a/test/fixtures/basic-no-compress/src/index.js b/test/fixtures/basic-no-compress/src/index.js new file mode 100644 index 0000000..a756a0a --- /dev/null +++ b/test/fixtures/basic-no-compress/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/basic-no-compress/src/two.js b/test/fixtures/basic-no-compress/src/two.js new file mode 100644 index 0000000..9f1f741 --- /dev/null +++ b/test/fixtures/basic-no-compress/src/two.js @@ -0,0 +1,3 @@ +export async function two(...args) { + return args.reduce((total, value) => total + value, 0); +} From 22ec94a4c9e808d85e2914a372d446008a97287c Mon Sep 17 00:00:00 2001 From: Leah Date: Tue, 28 May 2019 00:52:33 +0200 Subject: [PATCH 03/13] 0.12.0-next.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 68a232f..d77b155 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "microbundle", - "version": "0.11.0", + "version": "0.12.0-next.0", "description": "Zero-configuration bundler for tiny JS libs, powered by Rollup.", "main": "dist/microbundle.js", "source": "src/index.js", From 445fde2ff0bad178db978326c511ebf3691f6129 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Burzy=C5=84ski?= Date: Tue, 28 May 2019 01:01:12 +0200 Subject: [PATCH 04/13] Preserve #__PURE__ annotations (#347) --- src/index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 78f98e5..683761f 100644 --- a/src/index.js +++ b/src/index.js @@ -594,7 +594,9 @@ function createConfig(options, entry, format, writeMeta) { options.compress !== false && [ terser({ sourcemap: true, - output: { comments: false }, + output: { + comments: (node, comment) => /[@#]__PURE__/.test(comment.value), + }, compress: Object.assign( { keep_infinity: true, From 0eadcd9bcef2486307435514a06e7c68c3ff40f8 Mon Sep 17 00:00:00 2001 From: Ward Peeters Date: Wed, 29 May 2019 00:03:08 +0200 Subject: [PATCH 05/13] feat(babel): merges babelrc with microbunde babel config (#396) * feat(babel): merges babelrc with microbunde babel config * update tests * Fix README.md Fix examples description * remove unused rollup-plugin-flow dependency (#379) --- package.json | 2 + src/index.js | 70 ++++------- src/lib/babel-custom.js | 140 ++++++++++++++++++++++ src/utils.js | 8 ++ test/__snapshots__/index.test.js.snap | 65 ++++++++-- test/fixtures/custom-babelrc/.babelrc | 24 ++++ test/fixtures/custom-babelrc/package.json | 3 + test/fixtures/custom-babelrc/src/index.js | 6 + 8 files changed, 262 insertions(+), 56 deletions(-) create mode 100644 src/lib/babel-custom.js create mode 100644 test/fixtures/custom-babelrc/.babelrc create mode 100644 test/fixtures/custom-babelrc/package.json create mode 100644 test/fixtures/custom-babelrc/src/index.js diff --git a/package.json b/package.json index d77b155..a4f7570 100644 --- a/package.json +++ b/package.json @@ -60,6 +60,7 @@ "filesize": "^4.1.2", "gzip-size": "^5.1.1", "kleur": "^3.0.3", + "lodash.merge": "^4.6.1", "module-details-from-path": "^1.0.3", "pretty-bytes": "^5.2.0", "rollup": "^1.12.4", @@ -85,6 +86,7 @@ "@babel/preset-env": "^7.4.5", "babel-core": "^7.0.0-bridge.0", "babel-jest": "^24.8.0", + "core-js": "^3.1.2", "cross-env": "^5.2.0", "directory-tree": "^2.2.3", "eslint": "^5.16.0", diff --git a/src/index.js b/src/index.js index 683761f..ab983a7 100644 --- a/src/index.js +++ b/src/index.js @@ -8,6 +8,7 @@ import cssnano from 'cssnano'; import { rollup, watch } from 'rollup'; import commonjs from 'rollup-plugin-commonjs'; 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 alias from 'rollup-plugin-alias'; @@ -18,7 +19,7 @@ import prettyBytes from 'pretty-bytes'; import typescript from 'rollup-plugin-typescript2'; import json from 'rollup-plugin-json'; import logError from './log-error'; -import { readFile, isDir, isFile, stdout, stderr } from './utils'; +import { readFile, isDir, isFile, stdout, stderr, isTruthy } from './utils'; import camelCase from 'camelcase'; const removeScope = name => name.replace(/^@.*\//, ''); @@ -540,56 +541,31 @@ function createConfig(options, entry, format, writeMeta) { }, }, }), - babel({ - babelrc: false, - configFile: false, - compact: false, - include: 'node_modules/**', - plugins: [ - [ - require.resolve('babel-plugin-transform-replace-expressions'), - { replace: defines }, + // if defines is not set, we shouldn't run babel through node_modules + isTruthy(defines) && + babel({ + babelrc: false, + configFile: false, + compact: false, + include: 'node_modules/**', + plugins: [ + [ + require.resolve('babel-plugin-transform-replace-expressions'), + { replace: defines }, + ], ], - ], - }), - babel({ + }), + customBabel({ extensions: EXTENSIONS, exclude: 'node_modules/**', passPerPreset: true, // @see https://babeljs.io/docs/en/options#passperpreset - presets: [ - [ - '@babel/preset-env', - { - loose: true, - modules: false, - targets: - options.target === 'node' ? { node: '8' } : undefined, - exclude: ['transform-async-to-generator'], - }, - ], - !useTypescript && ['@babel/preset-flow', { all: true }], - ].filter(Boolean), - plugins: [ - [ - require.resolve('@babel/plugin-transform-react-jsx'), - { - pragma: options.jsx || 'h', - pragmaFrag: options.jsxFragment || 'Fragment', - }, - ], - [ - require.resolve('babel-plugin-transform-replace-expressions'), - { replace: defines }, - ], - [ - require.resolve('babel-plugin-transform-async-to-promises'), - { inlineHelpers: true, externalHelpers: true }, - ], - [ - require.resolve('@babel/plugin-proposal-class-properties'), - { loose: true }, - ], - ], + custom: { + defines, + targets: options.target === 'node' ? { node: '8' } : undefined, + pragma: options.jsx || 'h', + pragmaFrag: options.jsxFragment || 'Fragment', + typescript: !!useTypescript, + }, }), options.compress !== false && [ terser({ diff --git a/src/lib/babel-custom.js b/src/lib/babel-custom.js new file mode 100644 index 0000000..958ef93 --- /dev/null +++ b/src/lib/babel-custom.js @@ -0,0 +1,140 @@ +import { createConfigItem } from '@babel/core'; +import babelPlugin from 'rollup-plugin-babel'; +import merge from 'lodash.merge'; +import { isTruthy } from '../utils'; + +const mergeConfigItems = (type, ...configItemsToMerge) => { + const mergedItems = []; + + configItemsToMerge.forEach(configItemToMerge => { + configItemToMerge.forEach(item => { + const itemToMergeWithIndex = mergedItems.findIndex( + mergedItem => mergedItem.file.resolved === item.file.resolved, + ); + + if (itemToMergeWithIndex === -1) { + mergedItems.push(item); + return; + } + + mergedItems[itemToMergeWithIndex] = createConfigItem( + [ + mergedItems[itemToMergeWithIndex].file.resolved, + merge(mergedItems[itemToMergeWithIndex].options, item.options), + ], + { + type, + }, + ); + }); + }); + + return mergedItems; +}; + +const createConfigItems = (type, items) => { + return items.map(({ name, ...options }) => { + return createConfigItem([require.resolve(name), options], { type }); + }); +}; + +export default babelPlugin.custom(babelCore => { + return { + // Passed the plugin options. + options({ custom: customOptions, ...pluginOptions }) { + return { + // Pull out any custom options that the plugin might have. + customOptions, + + // Pass the options back with the two custom options removed. + pluginOptions, + }; + }, + + config(config, { customOptions }) { + const defaultPlugins = createConfigItems( + 'plugin', + [ + { + name: '@babel/plugin-transform-react-jsx', + pragma: customOptions.jsx || 'h', + pragmaFrag: customOptions.jsxFragment || 'Fragment', + }, + isTruthy(customOptions.defines) && { + name: 'babel-plugin-transform-replace-expressions', + replace: customOptions.defines, + }, + { + name: 'babel-plugin-transform-async-to-promises', + inlineHelpers: true, + externalHelpers: true, + }, + { + name: '@babel/plugin-proposal-class-properties', + loose: true, + }, + ].filter(Boolean), + ); + + let babelOptions = { + presets: [], + plugins: [], + }; + if (config.hasFilesystemConfig()) { + babelOptions = config.options; + + if (babelOptions.presets) { + babelOptions.presets = babelOptions.presets.map(preset => { + // When preset-env is configured we want to make sure we override some settings. + // We want to make sure microbundle is still fast & creates small bundles + if (preset.file.request === '@babel/preset-env') { + preset = createConfigItem( + [ + preset.file.resolved, + merge( + { + loose: true, + targets: customOptions.targets, + }, + preset.options, + { + modules: false, + exclude: merge( + ['transform-async-to-generator'], + preset.options.exclude || [], + ), + }, + ), + ], + { + type: `preset`, + }, + ); + } + + return preset; + }); + } + } else { + babelOptions.presets = createConfigItems('preset', [ + { + name: '@babel/preset-env', + targets: customOptions.targets, + modules: false, + loose: true, + exclude: ['transform-async-to-generator'], + }, + ]); + } + + // Merge babelrc & our plugins together + babelOptions.plugins = mergeConfigItems( + 'plugin', + defaultPlugins, + babelOptions.plugins || [], + ); + + return babelOptions; + }, + }; +}); diff --git a/src/utils.js b/src/utils.js index 2af2baf..4044cd4 100644 --- a/src/utils.js +++ b/src/utils.js @@ -14,3 +14,11 @@ export const isFile = name => .catch(() => false); export const stdout = console.log.bind(console); // eslint-disable-line no-console export const stderr = console.error.bind(console); + +export const isTruthy = obj => { + if (!obj) { + return false; + } + + return obj.constructor !== Object || Object.keys(obj).length > 0; +}; diff --git a/test/__snapshots__/index.test.js.snap b/test/__snapshots__/index.test.js.snap index f0cd346..11d369f 100644 --- a/test/__snapshots__/index.test.js.snap +++ b/test/__snapshots__/index.test.js.snap @@ -219,30 +219,30 @@ basic-babelrc Build \\"basicBabelrc\\" to dist: -108 B: basic-babelrc.js.gz -83 B: basic-babelrc.js.br -108 B: basic-babelrc.mjs.gz -83 B: basic-babelrc.mjs.br -150 B: basic-babelrc.umd.js.gz -108 B: basic-babelrc.umd.js.br" +94 B: basic-babelrc.js.gz +75 B: basic-babelrc.js.br +94 B: basic-babelrc.mjs.gz +75 B: basic-babelrc.mjs.br +139 B: basic-babelrc.umd.js.gz +102 B: basic-babelrc.umd.js.br" `; exports[`fixtures build basic-babelrc with microbundle 2`] = `6`; exports[`fixtures build basic-babelrc with microbundle 3`] = ` -"var r;void 0===(r=!0)&&(r=function(r){throw new Error(\\"required!\\")}()),!0===r||function(r){throw new Error(\\"Falsey!\\")}(); +"!function(r=function(r){throw new Error(\\"required!\\")}()){!0===r||function(r){throw new Error(\\"Falsey!\\")}()}(!0); //# sourceMappingURL=basic-babelrc.js.map " `; exports[`fixtures build basic-babelrc with microbundle 4`] = ` -"var r;void 0===(r=!0)&&(r=function(r){throw new Error(\\"required!\\")}()),!0===r||function(r){throw new Error(\\"Falsey!\\")}(); +"!function(r=function(r){throw new Error(\\"required!\\")}()){!0===r||function(r){throw new Error(\\"Falsey!\\")}()}(!0); //# sourceMappingURL=basic-babelrc.mjs.map " `; exports[`fixtures build basic-babelrc with microbundle 5`] = ` -"!function(n){\\"function\\"==typeof define&&define.amd?define(n):n()}(function(){var n;void 0===(n=!0)&&(n=function(n){throw new Error(\\"required!\\")}()),!0===n||function(n){throw new Error(\\"Falsey!\\")}()}); +"!function(n){\\"function\\"==typeof define&&define.amd?define(n):n()}(function(){!function(n=function(n){throw new Error(\\"required!\\")}()){!0===n||function(n){throw new Error(\\"Falsey!\\")}()}(!0)}); //# sourceMappingURL=basic-babelrc.umd.js.map " `; @@ -850,6 +850,53 @@ exports[`fixtures build class-properties with microbundle 5`] = ` " `; +exports[`fixtures build custom-babelrc with microbundle 1`] = ` +"Used script: microbundle + +Directory tree: + +custom-babelrc + dist + custom-babelrc.js + custom-babelrc.js.map + custom-babelrc.mjs + custom-babelrc.mjs.map + custom-babelrc.umd.js + custom-babelrc.umd.js.map + package.json + src + index.js + + +Build \\"customBabelrc\\" to dist: +5.6 kB: custom-babelrc.js.gz +5.05 kB: custom-babelrc.js.br +5.6 kB: custom-babelrc.mjs.gz +5.06 kB: custom-babelrc.mjs.br +5.67 kB: custom-babelrc.umd.js.gz +5.12 kB: custom-babelrc.umd.js.br" +`; + +exports[`fixtures build custom-babelrc with microbundle 2`] = `6`; + +exports[`fixtures build custom-babelrc with microbundle 3`] = ` +"var t=\\"undefined\\"!=typeof globalThis?globalThis:\\"undefined\\"!=typeof window?window:\\"undefined\\"!=typeof global?global:\\"undefined\\"!=typeof self?self:{};function e(t,e){return t(e={exports:{}},e.exports),e.exports}var n,r,o,i=\\"object\\",c=function(t){return t&&t.Math==Math&&t},u=c(typeof globalThis==i&&globalThis)||c(typeof window==i&&window)||c(typeof self==i&&self)||c(typeof t==i&&t)||Function(\\"return this\\")(),a=function(t){try{return!!t()}catch(t){return!0}},f=!a(function(){return 7!=Object.defineProperty({},\\"a\\",{get:function(){return 7}}).a}),s={}.propertyIsEnumerable,l=Object.getOwnPropertyDescriptor,p={f:l&&!s.call({1:2},1)?function(t){var e=l(this,t);return!!e&&e.enumerable}:s},v=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},h={}.toString,d=function(t){return h.call(t).slice(8,-1)},y=\\"\\".split,m=a(function(){return!Object(\\"z\\").propertyIsEnumerable(0)})?function(t){return\\"String\\"==d(t)?y.call(t,\\"\\"):Object(t)}:Object,g=function(t){return m(function(t){if(null==t)throw TypeError(\\"Can't call method on \\"+t);return t}(t))},b=function(t){return\\"object\\"==typeof t?null!==t:\\"function\\"==typeof t},w=function(t,e){if(!b(t))return t;var n,r;if(e&&\\"function\\"==typeof(n=t.toString)&&!b(r=n.call(t)))return r;if(\\"function\\"==typeof(n=t.valueOf)&&!b(r=n.call(t)))return r;if(!e&&\\"function\\"==typeof(n=t.toString)&&!b(r=n.call(t)))return r;throw TypeError(\\"Can't convert object to primitive value\\")},j={}.hasOwnProperty,P=function(t,e){return j.call(t,e)},O=u.document,E=b(O)&&b(O.createElement),S=function(t){return E?O.createElement(t):{}},T=!f&&!a(function(){return 7!=Object.defineProperty(S(\\"div\\"),\\"a\\",{get:function(){return 7}}).a}),x=Object.getOwnPropertyDescriptor,M={f:f?x:function(t,e){if(t=g(t),e=w(e,!0),T)try{return x(t,e)}catch(t){}if(P(t,e))return v(!p.f.call(t,e),t[e])}},k=function(t){if(!b(t))throw TypeError(String(t)+\\" is not an object\\");return t},F=Object.defineProperty,_={f:f?F:function(t,e,n){if(k(t),e=w(e,!0),k(n),T)try{return F(t,e,n)}catch(t){}if(\\"get\\"in n||\\"set\\"in n)throw TypeError(\\"Accessors not supported\\");return\\"value\\"in n&&(t[e]=n.value),t}},I=f?function(t,e,n){return _.f(t,e,v(1,n))}:function(t,e,n){return t[e]=n,t},A=function(t,e){try{I(u,t,e)}catch(n){u[t]=e}return e},C=e(function(t){var e=u[\\"__core-js_shared__\\"]||A(\\"__core-js_shared__\\",{});(t.exports=function(t,n){return e[t]||(e[t]=void 0!==n?n:{})})(\\"versions\\",[]).push({version:\\"3.1.2\\",mode:\\"global\\",copyright:\\"© 2019 Denis Pushkarev (zloirock.ru)\\"})}),L=C(\\"native-function-to-string\\",Function.toString),N=u.WeakMap,D=\\"function\\"==typeof N&&/native code/.test(L.call(N)),R=0,z=Math.random(),K=function(t){return\\"Symbol(\\".concat(void 0===t?\\"\\":t,\\")_\\",(++R+z).toString(36))},W=C(\\"keys\\"),q={};if(D){var B=new(0,u.WeakMap),G=B.get,U=B.has,H=B.set;n=function(t,e){return H.call(B,t,e),e},r=function(t){return G.call(B,t)||{}},o=function(t){return U.call(B,t)}}else{var V=W.state||(W.state=K(\\"state\\"));q[V]=!0,n=function(t,e){return I(t,V,e),e},r=function(t){return P(t,V)?t[V]:{}},o=function(t){return P(t,V)}}var Y={set:n,get:r,has:o,enforce:function(t){return o(t)?r(t):n(t,{})},getterFor:function(t){return function(e){var n;if(!b(e)||(n=r(e)).type!==t)throw TypeError(\\"Incompatible receiver, \\"+t+\\" required\\");return n}}},J=e(function(t){var e=Y.get,n=Y.enforce,r=String(L).split(\\"toString\\");C(\\"inspectSource\\",function(t){return L.call(t)}),(t.exports=function(t,e,o,i){var c=!!i&&!!i.unsafe,a=!!i&&!!i.enumerable,f=!!i&&!!i.noTargetGet;\\"function\\"==typeof o&&(\\"string\\"!=typeof e||P(o,\\"name\\")||I(o,\\"name\\",e),n(o).source=r.join(\\"string\\"==typeof e?e:\\"\\")),t!==u?(c?!f&&t[e]&&(a=!0):delete t[e],a?t[e]=o:I(t,e,o)):a?t[e]=o:A(e,o)})(Function.prototype,\\"toString\\",function(){return\\"function\\"==typeof this&&e(this).source||L.call(this)})}),Q=Math.ceil,X=Math.floor,Z=function(t){return isNaN(t=+t)?0:(t>0?X:Q)(t)},$=Math.min,tt=function(t){return t>0?$(Z(t),9007199254740991):0},et=Math.max,nt=Math.min,rt=function(t,e,n){for(var r=g(t),o=tt(r.length),i=function(t,e){var r=Z(n);return r<0?et(r+e,0):nt(r,e)}(0,o);o>i;i++)if(i in r&&r[i]===e)return i||0;return-1},ot=[\\"constructor\\",\\"hasOwnProperty\\",\\"isPrototypeOf\\",\\"propertyIsEnumerable\\",\\"toLocaleString\\",\\"toString\\",\\"valueOf\\"].concat(\\"length\\",\\"prototype\\"),it={f:Object.getOwnPropertyNames||function(t){return function(t,e){var n,r=g(t),o=0,i=[];for(n in r)!P(q,n)&&P(r,n)&&i.push(n);for(;e.length>o;)P(r,n=e[o++])&&(~rt(i,n)||i.push(n));return i}(t,ot)}},ct={f:Object.getOwnPropertySymbols},ut=u.Reflect,at=ut&&ut.ownKeys||function(t){var e=it.f(k(t)),n=ct.f;return n?e.concat(n(t)):e},ft=function(t,e){for(var n=at(e),r=_.f,o=M.f,i=0;ia;a++)if((o?l(k(s=t[a])[0],s[1]):l(t[a]))===e)return e;return}c=u.call(t)}for(;!(s=c.next()).done;)if(It(c,l,s.value,o)===e)return e}).BREAK=e}),Ct=Et(\\"iterator\\"),Lt=!1;try{var Nt=0;({next:function(){return{done:!!Nt++}},return:function(){Lt=!0}})[Ct]=function(){return this}}catch(t){}var Dt,Rt,zt,Kt=Et(\\"species\\"),Wt=u.document,qt=Wt&&Wt.documentElement,Bt=u.location,Gt=u.setImmediate,Ut=u.clearImmediate,Ht=u.process,Vt=u.MessageChannel,Yt=u.Dispatch,Jt=0,Qt={},Xt=function(t){if(Qt.hasOwnProperty(t)){var e=Qt[t];delete Qt[t],e()}},Zt=function(t){return function(){Xt(t)}},$t=function(t){Xt(t.data)},te=function(t){u.postMessage(t+\\"\\",Bt.protocol+\\"//\\"+Bt.host)};Gt&&Ut||(Gt=function(t){for(var e=[],n=1;arguments.length>n;)e.push(arguments[n++]);return Qt[++Jt]=function(){(\\"function\\"==typeof t?t:Function(t)).apply(void 0,e)},Dt(Jt),Jt},Ut=function(t){delete Qt[t]},\\"process\\"==d(Ht)?Dt=function(t){Ht.nextTick(Zt(t))}:Yt&&Yt.now?Dt=function(t){Yt.now(Zt(t))}:Vt?(zt=(Rt=new Vt).port2,Rt.port1.onmessage=$t,Dt=Mt(zt.postMessage,zt,1)):!u.addEventListener||\\"function\\"!=typeof postMessage||u.importScripts||a(te)?Dt=\\"onreadystatechange\\"in S(\\"script\\")?function(t){qt.appendChild(S(\\"script\\")).onreadystatechange=function(){qt.removeChild(this),Xt(t)}}:function(t){setTimeout(Zt(t),0)}:(Dt=te,u.addEventListener(\\"message\\",$t,!1)));var ee,ne,re,oe,ie,ce,ue,ae={set:Gt,clear:Ut},fe=u.navigator,se=fe&&fe.userAgent||\\"\\",le=M.f,pe=ae.set,ve=u.MutationObserver||u.WebKitMutationObserver,he=u.process,de=u.Promise,ye=\\"process\\"==d(he),me=le(u,\\"queueMicrotask\\"),ge=me&&me.value;ge||(ee=function(){var t,e;for(ye&&(t=he.domain)&&t.exit();ne;){e=ne.fn,ne=ne.next;try{e()}catch(t){throw ne?oe():re=void 0,t}}re=void 0,t&&t.enter()},ye?oe=function(){he.nextTick(ee)}:ve&&!/(iphone|ipod|ipad).*applewebkit/i.test(se)?(ie=!0,ce=document.createTextNode(\\"\\"),new ve(ee).observe(ce,{characterData:!0}),oe=function(){ce.data=ie=!ie}):de&&de.resolve?(ue=de.resolve(void 0),oe=function(){ue.then(ee)}):oe=function(){pe.call(u,ee)});var be,we,je,Pe,Oe,Ee=ge||function(t){var e={fn:t,next:void 0};re&&(re.next=e),ne||(ne=e,oe()),re=e},Se=function(t){var e,n;this.promise=new t(function(t,r){if(void 0!==e||void 0!==n)throw TypeError(\\"Bad Promise constructor\\");e=t,n=r}),this.resolve=bt(e),this.reject=bt(n)},Te={f:function(t){return new Se(t)}},xe=function(t,e){if(k(t),b(e)&&e.constructor===t)return e;var n=Te.f(t);return(0,n.resolve)(e),n.promise},Me=function(t){try{return{error:!1,value:t()}}catch(t){return{error:!0,value:t}}},ke=_.f,Fe=Et(\\"toStringTag\\"),_e=u,Ie=function(t){return\\"function\\"==typeof t?t:void 0},Ae=Et(\\"species\\"),Ce=ae.set,Le=Et(\\"species\\"),Ne=Y.get,De=Y.set,Re=Y.getterFor(\\"Promise\\"),ze=u.Promise,Ke=u.TypeError,We=u.document,qe=u.process,Be=u.fetch,Ge=qe&&qe.versions,Ue=Ge&&Ge.v8||\\"\\",He=Te.f,Ve=He,Ye=\\"process\\"==d(qe),Je=!!(We&&We.createEvent&&u.dispatchEvent),Qe=yt(\\"Promise\\",function(){var t=ze.resolve(1),e=function(){},n=(t.constructor={})[Le]=function(t){t(e,e)};return!((Ye||\\"function\\"==typeof PromiseRejectionEvent)&&t.then(e)instanceof n&&0!==Ue.indexOf(\\"6.6\\")&&-1===se.indexOf(\\"Chrome/66\\"))}),Xe=Qe||!function(t,e){if(!Lt)return!1;var n=!1;try{var r={};r[Ct]=function(){return{next:function(){return{done:n=!0}}}},ze.all(r).catch(function(){})}catch(t){}return n}(),Ze=function(t){var e;return!(!b(t)||\\"function\\"!=typeof(e=t.then))&&e},$e=function(t,e,n){if(!e.notified){e.notified=!0;var r=e.reactions;Ee(function(){for(var o=e.value,i=1==e.state,c=0,u=function(n){var r,c,u,a=i?n.ok:n.fail,f=n.resolve,s=n.reject,l=n.domain;try{a?(i||(2===e.rejection&&rn(t,e),e.rejection=1),!0===a?r=o:(l&&l.enter(),r=a(o),l&&(l.exit(),u=!0)),r===n.promise?s(Ke(\\"Promise-chain cycle\\")):(c=Ze(r))?c.call(r,f,s):f(r)):s(o)}catch(t){l&&!u&&l.exit(),s(t)}};r.length>c;)u(r[c++]);e.reactions=[],e.notified=!1,n&&!e.rejection&&en(t,e)})}},tn=function(t,e,n){var r,o;Je?((r=We.createEvent(\\"Event\\")).promise=e,r.reason=n,r.initEvent(t,!1,!0),u.dispatchEvent(r)):r={promise:e,reason:n},(o=u[\\"on\\"+t])?o(r):\\"unhandledrejection\\"===t&&function(t,e){var n=u.console;n&&n.error&&(1===arguments.length?n.error(t):n.error(t,e))}(\\"Unhandled promise rejection\\",n)},en=function(t,e){Ce.call(u,function(){var n,r=e.value;if(nn(e)&&(n=Me(function(){Ye?qe.emit(\\"unhandledRejection\\",r,t):tn(\\"unhandledrejection\\",t,r)}),e.rejection=Ye||nn(e)?2:1,n.error))throw n.value})},nn=function(t){return 1!==t.rejection&&!t.parent},rn=function(t,e){Ce.call(u,function(){Ye?qe.emit(\\"rejectionHandled\\",t):tn(\\"rejectionhandled\\",t,e.value)})},on=function(t,e,n,r){return function(o){t(e,n,o,r)}},cn=function(t,e,n,r){e.done||(e.done=!0,r&&(e=r),e.value=n,e.state=2,$e(t,e,!0))},un=function t(e,n,r,o){if(!n.done){n.done=!0,o&&(n=o);try{if(e===r)throw Ke(\\"Promise can't be resolved itself\\");var i=Ze(r);i?Ee(function(){var o={done:!1};try{i.call(r,on(t,e,o,n),on(cn,e,o,n))}catch(t){cn(e,o,t,n)}}):(n.value=r,n.state=1,$e(e,n,!1))}catch(t){cn(e,{done:!1},t,n)}}};Qe&&(ze=function(t){!function(t,e,n){if(!(t instanceof ze))throw TypeError(\\"Incorrect Promise invocation\\")}(this),bt(t),be.call(this);var e=Ne(this);try{t(on(un,this,e),on(cn,this,e))}catch(t){cn(this,e,t)}},(be=function(t){De(this,{type:\\"Promise\\",done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=function(t,e,n){for(var r in e)J(t,r,e[r],void 0);return t}(ze.prototype,{then:function(t,e){var n,r,o,i=Re(this),c=He((n=ze,void 0===(o=k(this).constructor)||null==(r=k(o)[Kt])?n:bt(r)));return c.ok=\\"function\\"!=typeof t||t,c.fail=\\"function\\"==typeof e&&e,c.domain=Ye?qe.domain:void 0,i.parent=!0,i.reactions.push(c),0!=i.state&&$e(this,i,!1),c.promise},catch:function(t){return this.then(void 0,t)}}),we=function(){var t=new be,e=Ne(t);this.promise=t,this.resolve=on(un,t,e),this.reject=on(cn,t,e)},Te.f=He=function(t){return t===ze||t===je?new we(t):Ve(t)},\\"function\\"==typeof Be&>({global:!0,enumerable:!0,forced:!0},{fetch:function(t){return xe(ze,Be.apply(u,arguments))}})),gt({global:!0,wrap:!0,forced:Qe},{Promise:ze}),(Pe=ze)&&!P(Pe=Pe.prototype,Fe)&&ke(Pe,Fe,{configurable:!0,value:\\"Promise\\"}),Oe=function(t,e){return arguments.length<2?Ie(_e[t])||Ie(u[t]):_e[t]&&_e[t][e]||u[t]&&u[t][e]}(\\"Promise\\"),f&&Oe&&!Oe[Ae]&&(0,_.f)(Oe,Ae,{configurable:!0,get:function(){return this}}),je=_e.Promise,gt({target:\\"Promise\\",stat:!0,forced:Qe},{reject:function(t){var e=He(this);return e.reject.call(void 0,t),e.promise}}),gt({target:\\"Promise\\",stat:!0,forced:Qe},{resolve:function(t){return xe(this,t)}}),gt({target:\\"Promise\\",stat:!0,forced:Xe},{all:function(t){var e=this,n=He(e),r=n.resolve,o=n.reject,i=Me(function(){var n=bt(e.resolve),i=[],c=0,u=1;At(t,function(t){var a=c++,f=!1;i.push(void 0),u++,n.call(e,t).then(function(t){f||(f=!0,i[a]=t,--u||r(i))},o)}),--u||r(i)});return i.error&&o(i.value),n.promise},race:function(t){var e=this,n=He(e),r=n.reject,o=Me(function(){var o=bt(e.resolve);At(t,function(t){o.call(e,t).then(n.resolve,r)})});return o.error&&r(o.value),n.promise}}),exports.MyClass=class{constructor(){var t;t=[\\"foo\\",\\"bar\\"],\\"myFields\\"in this?Object.defineProperty(this,\\"myFields\\",{value:t,enumerable:!0,configurable:!0,writable:!0}):this.myFields=t}foo(){try{return this.myFields.find(t=>\\"bar\\"===t)}catch(t){return Promise.reject(t)}}}; +//# sourceMappingURL=custom-babelrc.js.map +" +`; + +exports[`fixtures build custom-babelrc with microbundle 4`] = ` +"var t=\\"undefined\\"!=typeof globalThis?globalThis:\\"undefined\\"!=typeof window?window:\\"undefined\\"!=typeof global?global:\\"undefined\\"!=typeof self?self:{};function e(t,e){return t(e={exports:{}},e.exports),e.exports}var n,r,o,i=\\"object\\",c=function(t){return t&&t.Math==Math&&t},u=c(typeof globalThis==i&&globalThis)||c(typeof window==i&&window)||c(typeof self==i&&self)||c(typeof t==i&&t)||Function(\\"return this\\")(),a=function(t){try{return!!t()}catch(t){return!0}},f=!a(function(){return 7!=Object.defineProperty({},\\"a\\",{get:function(){return 7}}).a}),s={}.propertyIsEnumerable,l=Object.getOwnPropertyDescriptor,p={f:l&&!s.call({1:2},1)?function(t){var e=l(this,t);return!!e&&e.enumerable}:s},v=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},h={}.toString,d=function(t){return h.call(t).slice(8,-1)},y=\\"\\".split,m=a(function(){return!Object(\\"z\\").propertyIsEnumerable(0)})?function(t){return\\"String\\"==d(t)?y.call(t,\\"\\"):Object(t)}:Object,g=function(t){return m(function(t){if(null==t)throw TypeError(\\"Can't call method on \\"+t);return t}(t))},b=function(t){return\\"object\\"==typeof t?null!==t:\\"function\\"==typeof t},w=function(t,e){if(!b(t))return t;var n,r;if(e&&\\"function\\"==typeof(n=t.toString)&&!b(r=n.call(t)))return r;if(\\"function\\"==typeof(n=t.valueOf)&&!b(r=n.call(t)))return r;if(!e&&\\"function\\"==typeof(n=t.toString)&&!b(r=n.call(t)))return r;throw TypeError(\\"Can't convert object to primitive value\\")},j={}.hasOwnProperty,P=function(t,e){return j.call(t,e)},O=u.document,E=b(O)&&b(O.createElement),S=function(t){return E?O.createElement(t):{}},T=!f&&!a(function(){return 7!=Object.defineProperty(S(\\"div\\"),\\"a\\",{get:function(){return 7}}).a}),x=Object.getOwnPropertyDescriptor,M={f:f?x:function(t,e){if(t=g(t),e=w(e,!0),T)try{return x(t,e)}catch(t){}if(P(t,e))return v(!p.f.call(t,e),t[e])}},k=function(t){if(!b(t))throw TypeError(String(t)+\\" is not an object\\");return t},F=Object.defineProperty,_={f:f?F:function(t,e,n){if(k(t),e=w(e,!0),k(n),T)try{return F(t,e,n)}catch(t){}if(\\"get\\"in n||\\"set\\"in n)throw TypeError(\\"Accessors not supported\\");return\\"value\\"in n&&(t[e]=n.value),t}},I=f?function(t,e,n){return _.f(t,e,v(1,n))}:function(t,e,n){return t[e]=n,t},A=function(t,e){try{I(u,t,e)}catch(n){u[t]=e}return e},C=e(function(t){var e=u[\\"__core-js_shared__\\"]||A(\\"__core-js_shared__\\",{});(t.exports=function(t,n){return e[t]||(e[t]=void 0!==n?n:{})})(\\"versions\\",[]).push({version:\\"3.1.2\\",mode:\\"global\\",copyright:\\"© 2019 Denis Pushkarev (zloirock.ru)\\"})}),L=C(\\"native-function-to-string\\",Function.toString),N=u.WeakMap,D=\\"function\\"==typeof N&&/native code/.test(L.call(N)),R=0,z=Math.random(),K=function(t){return\\"Symbol(\\".concat(void 0===t?\\"\\":t,\\")_\\",(++R+z).toString(36))},W=C(\\"keys\\"),q={};if(D){var B=new(0,u.WeakMap),G=B.get,U=B.has,H=B.set;n=function(t,e){return H.call(B,t,e),e},r=function(t){return G.call(B,t)||{}},o=function(t){return U.call(B,t)}}else{var V=W.state||(W.state=K(\\"state\\"));q[V]=!0,n=function(t,e){return I(t,V,e),e},r=function(t){return P(t,V)?t[V]:{}},o=function(t){return P(t,V)}}var Y={set:n,get:r,has:o,enforce:function(t){return o(t)?r(t):n(t,{})},getterFor:function(t){return function(e){var n;if(!b(e)||(n=r(e)).type!==t)throw TypeError(\\"Incompatible receiver, \\"+t+\\" required\\");return n}}},J=e(function(t){var e=Y.get,n=Y.enforce,r=String(L).split(\\"toString\\");C(\\"inspectSource\\",function(t){return L.call(t)}),(t.exports=function(t,e,o,i){var c=!!i&&!!i.unsafe,a=!!i&&!!i.enumerable,f=!!i&&!!i.noTargetGet;\\"function\\"==typeof o&&(\\"string\\"!=typeof e||P(o,\\"name\\")||I(o,\\"name\\",e),n(o).source=r.join(\\"string\\"==typeof e?e:\\"\\")),t!==u?(c?!f&&t[e]&&(a=!0):delete t[e],a?t[e]=o:I(t,e,o)):a?t[e]=o:A(e,o)})(Function.prototype,\\"toString\\",function(){return\\"function\\"==typeof this&&e(this).source||L.call(this)})}),Q=Math.ceil,X=Math.floor,Z=function(t){return isNaN(t=+t)?0:(t>0?X:Q)(t)},$=Math.min,tt=function(t){return t>0?$(Z(t),9007199254740991):0},et=Math.max,nt=Math.min,rt=function(t,e,n){for(var r=g(t),o=tt(r.length),i=function(t,e){var r=Z(n);return r<0?et(r+e,0):nt(r,e)}(0,o);o>i;i++)if(i in r&&r[i]===e)return i||0;return-1},ot=[\\"constructor\\",\\"hasOwnProperty\\",\\"isPrototypeOf\\",\\"propertyIsEnumerable\\",\\"toLocaleString\\",\\"toString\\",\\"valueOf\\"].concat(\\"length\\",\\"prototype\\"),it={f:Object.getOwnPropertyNames||function(t){return function(t,e){var n,r=g(t),o=0,i=[];for(n in r)!P(q,n)&&P(r,n)&&i.push(n);for(;e.length>o;)P(r,n=e[o++])&&(~rt(i,n)||i.push(n));return i}(t,ot)}},ct={f:Object.getOwnPropertySymbols},ut=u.Reflect,at=ut&&ut.ownKeys||function(t){var e=it.f(k(t)),n=ct.f;return n?e.concat(n(t)):e},ft=function(t,e){for(var n=at(e),r=_.f,o=M.f,i=0;ia;a++)if((o?l(k(s=t[a])[0],s[1]):l(t[a]))===e)return e;return}c=u.call(t)}for(;!(s=c.next()).done;)if(It(c,l,s.value,o)===e)return e}).BREAK=e}),Ct=Et(\\"iterator\\"),Lt=!1;try{var Nt=0;({next:function(){return{done:!!Nt++}},return:function(){Lt=!0}})[Ct]=function(){return this}}catch(t){}var Dt,Rt,zt,Kt=Et(\\"species\\"),Wt=u.document,qt=Wt&&Wt.documentElement,Bt=u.location,Gt=u.setImmediate,Ut=u.clearImmediate,Ht=u.process,Vt=u.MessageChannel,Yt=u.Dispatch,Jt=0,Qt={},Xt=function(t){if(Qt.hasOwnProperty(t)){var e=Qt[t];delete Qt[t],e()}},Zt=function(t){return function(){Xt(t)}},$t=function(t){Xt(t.data)},te=function(t){u.postMessage(t+\\"\\",Bt.protocol+\\"//\\"+Bt.host)};Gt&&Ut||(Gt=function(t){for(var e=[],n=1;arguments.length>n;)e.push(arguments[n++]);return Qt[++Jt]=function(){(\\"function\\"==typeof t?t:Function(t)).apply(void 0,e)},Dt(Jt),Jt},Ut=function(t){delete Qt[t]},\\"process\\"==d(Ht)?Dt=function(t){Ht.nextTick(Zt(t))}:Yt&&Yt.now?Dt=function(t){Yt.now(Zt(t))}:Vt?(zt=(Rt=new Vt).port2,Rt.port1.onmessage=$t,Dt=Mt(zt.postMessage,zt,1)):!u.addEventListener||\\"function\\"!=typeof postMessage||u.importScripts||a(te)?Dt=\\"onreadystatechange\\"in S(\\"script\\")?function(t){qt.appendChild(S(\\"script\\")).onreadystatechange=function(){qt.removeChild(this),Xt(t)}}:function(t){setTimeout(Zt(t),0)}:(Dt=te,u.addEventListener(\\"message\\",$t,!1)));var ee,ne,re,oe,ie,ce,ue,ae={set:Gt,clear:Ut},fe=u.navigator,se=fe&&fe.userAgent||\\"\\",le=M.f,pe=ae.set,ve=u.MutationObserver||u.WebKitMutationObserver,he=u.process,de=u.Promise,ye=\\"process\\"==d(he),me=le(u,\\"queueMicrotask\\"),ge=me&&me.value;ge||(ee=function(){var t,e;for(ye&&(t=he.domain)&&t.exit();ne;){e=ne.fn,ne=ne.next;try{e()}catch(t){throw ne?oe():re=void 0,t}}re=void 0,t&&t.enter()},ye?oe=function(){he.nextTick(ee)}:ve&&!/(iphone|ipod|ipad).*applewebkit/i.test(se)?(ie=!0,ce=document.createTextNode(\\"\\"),new ve(ee).observe(ce,{characterData:!0}),oe=function(){ce.data=ie=!ie}):de&&de.resolve?(ue=de.resolve(void 0),oe=function(){ue.then(ee)}):oe=function(){pe.call(u,ee)});var be,we,je,Pe,Oe,Ee=ge||function(t){var e={fn:t,next:void 0};re&&(re.next=e),ne||(ne=e,oe()),re=e},Se=function(t){var e,n;this.promise=new t(function(t,r){if(void 0!==e||void 0!==n)throw TypeError(\\"Bad Promise constructor\\");e=t,n=r}),this.resolve=bt(e),this.reject=bt(n)},Te={f:function(t){return new Se(t)}},xe=function(t,e){if(k(t),b(e)&&e.constructor===t)return e;var n=Te.f(t);return(0,n.resolve)(e),n.promise},Me=function(t){try{return{error:!1,value:t()}}catch(t){return{error:!0,value:t}}},ke=_.f,Fe=Et(\\"toStringTag\\"),_e=u,Ie=function(t){return\\"function\\"==typeof t?t:void 0},Ae=Et(\\"species\\"),Ce=ae.set,Le=Et(\\"species\\"),Ne=Y.get,De=Y.set,Re=Y.getterFor(\\"Promise\\"),ze=u.Promise,Ke=u.TypeError,We=u.document,qe=u.process,Be=u.fetch,Ge=qe&&qe.versions,Ue=Ge&&Ge.v8||\\"\\",He=Te.f,Ve=He,Ye=\\"process\\"==d(qe),Je=!!(We&&We.createEvent&&u.dispatchEvent),Qe=yt(\\"Promise\\",function(){var t=ze.resolve(1),e=function(){},n=(t.constructor={})[Le]=function(t){t(e,e)};return!((Ye||\\"function\\"==typeof PromiseRejectionEvent)&&t.then(e)instanceof n&&0!==Ue.indexOf(\\"6.6\\")&&-1===se.indexOf(\\"Chrome/66\\"))}),Xe=Qe||!function(t,e){if(!Lt)return!1;var n=!1;try{var r={};r[Ct]=function(){return{next:function(){return{done:n=!0}}}},ze.all(r).catch(function(){})}catch(t){}return n}(),Ze=function(t){var e;return!(!b(t)||\\"function\\"!=typeof(e=t.then))&&e},$e=function(t,e,n){if(!e.notified){e.notified=!0;var r=e.reactions;Ee(function(){for(var o=e.value,i=1==e.state,c=0,u=function(n){var r,c,u,a=i?n.ok:n.fail,f=n.resolve,s=n.reject,l=n.domain;try{a?(i||(2===e.rejection&&rn(t,e),e.rejection=1),!0===a?r=o:(l&&l.enter(),r=a(o),l&&(l.exit(),u=!0)),r===n.promise?s(Ke(\\"Promise-chain cycle\\")):(c=Ze(r))?c.call(r,f,s):f(r)):s(o)}catch(t){l&&!u&&l.exit(),s(t)}};r.length>c;)u(r[c++]);e.reactions=[],e.notified=!1,n&&!e.rejection&&en(t,e)})}},tn=function(t,e,n){var r,o;Je?((r=We.createEvent(\\"Event\\")).promise=e,r.reason=n,r.initEvent(t,!1,!0),u.dispatchEvent(r)):r={promise:e,reason:n},(o=u[\\"on\\"+t])?o(r):\\"unhandledrejection\\"===t&&function(t,e){var n=u.console;n&&n.error&&(1===arguments.length?n.error(t):n.error(t,e))}(\\"Unhandled promise rejection\\",n)},en=function(t,e){Ce.call(u,function(){var n,r=e.value;if(nn(e)&&(n=Me(function(){Ye?qe.emit(\\"unhandledRejection\\",r,t):tn(\\"unhandledrejection\\",t,r)}),e.rejection=Ye||nn(e)?2:1,n.error))throw n.value})},nn=function(t){return 1!==t.rejection&&!t.parent},rn=function(t,e){Ce.call(u,function(){Ye?qe.emit(\\"rejectionHandled\\",t):tn(\\"rejectionhandled\\",t,e.value)})},on=function(t,e,n,r){return function(o){t(e,n,o,r)}},cn=function(t,e,n,r){e.done||(e.done=!0,r&&(e=r),e.value=n,e.state=2,$e(t,e,!0))},un=function t(e,n,r,o){if(!n.done){n.done=!0,o&&(n=o);try{if(e===r)throw Ke(\\"Promise can't be resolved itself\\");var i=Ze(r);i?Ee(function(){var o={done:!1};try{i.call(r,on(t,e,o,n),on(cn,e,o,n))}catch(t){cn(e,o,t,n)}}):(n.value=r,n.state=1,$e(e,n,!1))}catch(t){cn(e,{done:!1},t,n)}}};Qe&&(ze=function(t){!function(t,e,n){if(!(t instanceof ze))throw TypeError(\\"Incorrect Promise invocation\\")}(this),bt(t),be.call(this);var e=Ne(this);try{t(on(un,this,e),on(cn,this,e))}catch(t){cn(this,e,t)}},(be=function(t){De(this,{type:\\"Promise\\",done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=function(t,e,n){for(var r in e)J(t,r,e[r],void 0);return t}(ze.prototype,{then:function(t,e){var n,r,o,i=Re(this),c=He((n=ze,void 0===(o=k(this).constructor)||null==(r=k(o)[Kt])?n:bt(r)));return c.ok=\\"function\\"!=typeof t||t,c.fail=\\"function\\"==typeof e&&e,c.domain=Ye?qe.domain:void 0,i.parent=!0,i.reactions.push(c),0!=i.state&&$e(this,i,!1),c.promise},catch:function(t){return this.then(void 0,t)}}),we=function(){var t=new be,e=Ne(t);this.promise=t,this.resolve=on(un,t,e),this.reject=on(cn,t,e)},Te.f=He=function(t){return t===ze||t===je?new we(t):Ve(t)},\\"function\\"==typeof Be&>({global:!0,enumerable:!0,forced:!0},{fetch:function(t){return xe(ze,Be.apply(u,arguments))}})),gt({global:!0,wrap:!0,forced:Qe},{Promise:ze}),(Pe=ze)&&!P(Pe=Pe.prototype,Fe)&&ke(Pe,Fe,{configurable:!0,value:\\"Promise\\"}),Oe=function(t,e){return arguments.length<2?Ie(_e[t])||Ie(u[t]):_e[t]&&_e[t][e]||u[t]&&u[t][e]}(\\"Promise\\"),f&&Oe&&!Oe[Ae]&&(0,_.f)(Oe,Ae,{configurable:!0,get:function(){return this}}),je=_e.Promise,gt({target:\\"Promise\\",stat:!0,forced:Qe},{reject:function(t){var e=He(this);return e.reject.call(void 0,t),e.promise}}),gt({target:\\"Promise\\",stat:!0,forced:Qe},{resolve:function(t){return xe(this,t)}}),gt({target:\\"Promise\\",stat:!0,forced:Xe},{all:function(t){var e=this,n=He(e),r=n.resolve,o=n.reject,i=Me(function(){var n=bt(e.resolve),i=[],c=0,u=1;At(t,function(t){var a=c++,f=!1;i.push(void 0),u++,n.call(e,t).then(function(t){f||(f=!0,i[a]=t,--u||r(i))},o)}),--u||r(i)});return i.error&&o(i.value),n.promise},race:function(t){var e=this,n=He(e),r=n.reject,o=Me(function(){var o=bt(e.resolve);At(t,function(t){o.call(e,t).then(n.resolve,r)})});return o.error&&r(o.value),n.promise}});class an{constructor(){var t;t=[\\"foo\\",\\"bar\\"],\\"myFields\\"in this?Object.defineProperty(this,\\"myFields\\",{value:t,enumerable:!0,configurable:!0,writable:!0}):this.myFields=t}foo(){try{return this.myFields.find(t=>\\"bar\\"===t)}catch(t){return Promise.reject(t)}}}export{an as MyClass}; +//# sourceMappingURL=custom-babelrc.mjs.map +" +`; + +exports[`fixtures build custom-babelrc with microbundle 5`] = ` +"!function(t,e){\\"object\\"==typeof exports&&\\"undefined\\"!=typeof module?e(exports):\\"function\\"==typeof define&&define.amd?define([\\"exports\\"],e):e((t=t||self).customBabelrc={})}(this,function(t){var e=\\"undefined\\"!=typeof globalThis?globalThis:\\"undefined\\"!=typeof window?window:\\"undefined\\"!=typeof global?global:\\"undefined\\"!=typeof self?self:{};function n(t,e){return t(e={exports:{}},e.exports),e.exports}var r,o,i,c=\\"object\\",u=function(t){return t&&t.Math==Math&&t},a=u(typeof globalThis==c&&globalThis)||u(typeof window==c&&window)||u(typeof self==c&&self)||u(typeof e==c&&e)||Function(\\"return this\\")(),f=function(t){try{return!!t()}catch(t){return!0}},s=!f(function(){return 7!=Object.defineProperty({},\\"a\\",{get:function(){return 7}}).a}),l={}.propertyIsEnumerable,p=Object.getOwnPropertyDescriptor,v={f:p&&!l.call({1:2},1)?function(t){var e=p(this,t);return!!e&&e.enumerable}:l},h=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},d={}.toString,y=function(t){return d.call(t).slice(8,-1)},m=\\"\\".split,g=f(function(){return!Object(\\"z\\").propertyIsEnumerable(0)})?function(t){return\\"String\\"==y(t)?m.call(t,\\"\\"):Object(t)}:Object,b=function(t){return g(function(t){if(null==t)throw TypeError(\\"Can't call method on \\"+t);return t}(t))},w=function(t){return\\"object\\"==typeof t?null!==t:\\"function\\"==typeof t},j=function(t,e){if(!w(t))return t;var n,r;if(e&&\\"function\\"==typeof(n=t.toString)&&!w(r=n.call(t)))return r;if(\\"function\\"==typeof(n=t.valueOf)&&!w(r=n.call(t)))return r;if(!e&&\\"function\\"==typeof(n=t.toString)&&!w(r=n.call(t)))return r;throw TypeError(\\"Can't convert object to primitive value\\")},P={}.hasOwnProperty,O=function(t,e){return P.call(t,e)},E=a.document,S=w(E)&&w(E.createElement),x=function(t){return S?E.createElement(t):{}},T=!s&&!f(function(){return 7!=Object.defineProperty(x(\\"div\\"),\\"a\\",{get:function(){return 7}}).a}),M=Object.getOwnPropertyDescriptor,k={f:s?M:function(t,e){if(t=b(t),e=j(e,!0),T)try{return M(t,e)}catch(t){}if(O(t,e))return h(!v.f.call(t,e),t[e])}},F=function(t){if(!w(t))throw TypeError(String(t)+\\" is not an object\\");return t},_=Object.defineProperty,I={f:s?_:function(t,e,n){if(F(t),e=j(e,!0),F(n),T)try{return _(t,e,n)}catch(t){}if(\\"get\\"in n||\\"set\\"in n)throw TypeError(\\"Accessors not supported\\");return\\"value\\"in n&&(t[e]=n.value),t}},A=s?function(t,e,n){return I.f(t,e,h(1,n))}:function(t,e,n){return t[e]=n,t},C=function(t,e){try{A(a,t,e)}catch(n){a[t]=e}return e},L=n(function(t){var e=a[\\"__core-js_shared__\\"]||C(\\"__core-js_shared__\\",{});(t.exports=function(t,n){return e[t]||(e[t]=void 0!==n?n:{})})(\\"versions\\",[]).push({version:\\"3.1.2\\",mode:\\"global\\",copyright:\\"© 2019 Denis Pushkarev (zloirock.ru)\\"})}),N=L(\\"native-function-to-string\\",Function.toString),D=a.WeakMap,R=\\"function\\"==typeof D&&/native code/.test(N.call(D)),z=0,B=Math.random(),K=function(t){return\\"Symbol(\\".concat(void 0===t?\\"\\":t,\\")_\\",(++z+B).toString(36))},W=L(\\"keys\\"),q={};if(R){var G=new(0,a.WeakMap),U=G.get,H=G.has,V=G.set;r=function(t,e){return V.call(G,t,e),e},o=function(t){return U.call(G,t)||{}},i=function(t){return H.call(G,t)}}else{var Y=W.state||(W.state=K(\\"state\\"));q[Y]=!0,r=function(t,e){return A(t,Y,e),e},o=function(t){return O(t,Y)?t[Y]:{}},i=function(t){return O(t,Y)}}var J={set:r,get:o,has:i,enforce:function(t){return i(t)?o(t):r(t,{})},getterFor:function(t){return function(e){var n;if(!w(e)||(n=o(e)).type!==t)throw TypeError(\\"Incompatible receiver, \\"+t+\\" required\\");return n}}},Q=n(function(t){var e=J.get,n=J.enforce,r=String(N).split(\\"toString\\");L(\\"inspectSource\\",function(t){return N.call(t)}),(t.exports=function(t,e,o,i){var c=!!i&&!!i.unsafe,u=!!i&&!!i.enumerable,f=!!i&&!!i.noTargetGet;\\"function\\"==typeof o&&(\\"string\\"!=typeof e||O(o,\\"name\\")||A(o,\\"name\\",e),n(o).source=r.join(\\"string\\"==typeof e?e:\\"\\")),t!==a?(c?!f&&t[e]&&(u=!0):delete t[e],u?t[e]=o:A(t,e,o)):u?t[e]=o:C(e,o)})(Function.prototype,\\"toString\\",function(){return\\"function\\"==typeof this&&e(this).source||N.call(this)})}),X=Math.ceil,Z=Math.floor,$=function(t){return isNaN(t=+t)?0:(t>0?Z:X)(t)},tt=Math.min,et=function(t){return t>0?tt($(t),9007199254740991):0},nt=Math.max,rt=Math.min,ot=function(t,e,n){for(var r=b(t),o=et(r.length),i=function(t,e){var r=$(n);return r<0?nt(r+e,0):rt(r,e)}(0,o);o>i;i++)if(i in r&&r[i]===e)return i||0;return-1},it=[\\"constructor\\",\\"hasOwnProperty\\",\\"isPrototypeOf\\",\\"propertyIsEnumerable\\",\\"toLocaleString\\",\\"toString\\",\\"valueOf\\"].concat(\\"length\\",\\"prototype\\"),ct={f:Object.getOwnPropertyNames||function(t){return function(t,e){var n,r=b(t),o=0,i=[];for(n in r)!O(q,n)&&O(r,n)&&i.push(n);for(;e.length>o;)O(r,n=e[o++])&&(~ot(i,n)||i.push(n));return i}(t,it)}},ut={f:Object.getOwnPropertySymbols},at=a.Reflect,ft=at&&at.ownKeys||function(t){var e=ct.f(F(t)),n=ut.f;return n?e.concat(n(t)):e},st=function(t,e){for(var n=ft(e),r=I.f,o=k.f,i=0;ia;a++)if((o?l(F(s=t[a])[0],s[1]):l(t[a]))===e)return e;return}c=u.call(t)}for(;!(s=c.next()).done;)if(At(c,l,s.value,o)===e)return e}).BREAK=e}),Lt=St(\\"iterator\\"),Nt=!1;try{var Dt=0;({next:function(){return{done:!!Dt++}},return:function(){Nt=!0}})[Lt]=function(){return this}}catch(t){}var Rt,zt,Bt,Kt=St(\\"species\\"),Wt=a.document,qt=Wt&&Wt.documentElement,Gt=a.location,Ut=a.setImmediate,Ht=a.clearImmediate,Vt=a.process,Yt=a.MessageChannel,Jt=a.Dispatch,Qt=0,Xt={},Zt=function(t){if(Xt.hasOwnProperty(t)){var e=Xt[t];delete Xt[t],e()}},$t=function(t){return function(){Zt(t)}},te=function(t){Zt(t.data)},ee=function(t){a.postMessage(t+\\"\\",Gt.protocol+\\"//\\"+Gt.host)};Ut&&Ht||(Ut=function(t){for(var e=[],n=1;arguments.length>n;)e.push(arguments[n++]);return Xt[++Qt]=function(){(\\"function\\"==typeof t?t:Function(t)).apply(void 0,e)},Rt(Qt),Qt},Ht=function(t){delete Xt[t]},\\"process\\"==y(Vt)?Rt=function(t){Vt.nextTick($t(t))}:Jt&&Jt.now?Rt=function(t){Jt.now($t(t))}:Yt?(Bt=(zt=new Yt).port2,zt.port1.onmessage=te,Rt=kt(Bt.postMessage,Bt,1)):!a.addEventListener||\\"function\\"!=typeof postMessage||a.importScripts||f(ee)?Rt=\\"onreadystatechange\\"in x(\\"script\\")?function(t){qt.appendChild(x(\\"script\\")).onreadystatechange=function(){qt.removeChild(this),Zt(t)}}:function(t){setTimeout($t(t),0)}:(Rt=ee,a.addEventListener(\\"message\\",te,!1)));var ne,re,oe,ie,ce,ue,ae,fe={set:Ut,clear:Ht},se=a.navigator,le=se&&se.userAgent||\\"\\",pe=k.f,ve=fe.set,he=a.MutationObserver||a.WebKitMutationObserver,de=a.process,ye=a.Promise,me=\\"process\\"==y(de),ge=pe(a,\\"queueMicrotask\\"),be=ge&&ge.value;be||(ne=function(){var t,e;for(me&&(t=de.domain)&&t.exit();re;){e=re.fn,re=re.next;try{e()}catch(t){throw re?ie():oe=void 0,t}}oe=void 0,t&&t.enter()},me?ie=function(){de.nextTick(ne)}:he&&!/(iphone|ipod|ipad).*applewebkit/i.test(le)?(ce=!0,ue=document.createTextNode(\\"\\"),new he(ne).observe(ue,{characterData:!0}),ie=function(){ue.data=ce=!ce}):ye&&ye.resolve?(ae=ye.resolve(void 0),ie=function(){ae.then(ne)}):ie=function(){ve.call(a,ne)});var we,je,Pe,Oe,Ee,Se=be||function(t){var e={fn:t,next:void 0};oe&&(oe.next=e),re||(re=e,ie()),oe=e},xe=function(t){var e,n;this.promise=new t(function(t,r){if(void 0!==e||void 0!==n)throw TypeError(\\"Bad Promise constructor\\");e=t,n=r}),this.resolve=wt(e),this.reject=wt(n)},Te={f:function(t){return new xe(t)}},Me=function(t,e){if(F(t),w(e)&&e.constructor===t)return e;var n=Te.f(t);return(0,n.resolve)(e),n.promise},ke=function(t){try{return{error:!1,value:t()}}catch(t){return{error:!0,value:t}}},Fe=I.f,_e=St(\\"toStringTag\\"),Ie=a,Ae=function(t){return\\"function\\"==typeof t?t:void 0},Ce=St(\\"species\\"),Le=fe.set,Ne=St(\\"species\\"),De=J.get,Re=J.set,ze=J.getterFor(\\"Promise\\"),Be=a.Promise,Ke=a.TypeError,We=a.document,qe=a.process,Ge=a.fetch,Ue=qe&&qe.versions,He=Ue&&Ue.v8||\\"\\",Ve=Te.f,Ye=Ve,Je=\\"process\\"==y(qe),Qe=!!(We&&We.createEvent&&a.dispatchEvent),Xe=mt(\\"Promise\\",function(){var t=Be.resolve(1),e=function(){},n=(t.constructor={})[Ne]=function(t){t(e,e)};return!((Je||\\"function\\"==typeof PromiseRejectionEvent)&&t.then(e)instanceof n&&0!==He.indexOf(\\"6.6\\")&&-1===le.indexOf(\\"Chrome/66\\"))}),Ze=Xe||!function(t,e){if(!Nt)return!1;var n=!1;try{var r={};r[Lt]=function(){return{next:function(){return{done:n=!0}}}},Be.all(r).catch(function(){})}catch(t){}return n}(),$e=function(t){var e;return!(!w(t)||\\"function\\"!=typeof(e=t.then))&&e},tn=function(t,e,n){if(!e.notified){e.notified=!0;var r=e.reactions;Se(function(){for(var o=e.value,i=1==e.state,c=0,u=function(n){var r,c,u,a=i?n.ok:n.fail,f=n.resolve,s=n.reject,l=n.domain;try{a?(i||(2===e.rejection&&on(t,e),e.rejection=1),!0===a?r=o:(l&&l.enter(),r=a(o),l&&(l.exit(),u=!0)),r===n.promise?s(Ke(\\"Promise-chain cycle\\")):(c=$e(r))?c.call(r,f,s):f(r)):s(o)}catch(t){l&&!u&&l.exit(),s(t)}};r.length>c;)u(r[c++]);e.reactions=[],e.notified=!1,n&&!e.rejection&&nn(t,e)})}},en=function(t,e,n){var r,o;Qe?((r=We.createEvent(\\"Event\\")).promise=e,r.reason=n,r.initEvent(t,!1,!0),a.dispatchEvent(r)):r={promise:e,reason:n},(o=a[\\"on\\"+t])?o(r):\\"unhandledrejection\\"===t&&function(t,e){var n=a.console;n&&n.error&&(1===arguments.length?n.error(t):n.error(t,e))}(\\"Unhandled promise rejection\\",n)},nn=function(t,e){Le.call(a,function(){var n,r=e.value;if(rn(e)&&(n=ke(function(){Je?qe.emit(\\"unhandledRejection\\",r,t):en(\\"unhandledrejection\\",t,r)}),e.rejection=Je||rn(e)?2:1,n.error))throw n.value})},rn=function(t){return 1!==t.rejection&&!t.parent},on=function(t,e){Le.call(a,function(){Je?qe.emit(\\"rejectionHandled\\",t):en(\\"rejectionhandled\\",t,e.value)})},cn=function(t,e,n,r){return function(o){t(e,n,o,r)}},un=function(t,e,n,r){e.done||(e.done=!0,r&&(e=r),e.value=n,e.state=2,tn(t,e,!0))},an=function t(e,n,r,o){if(!n.done){n.done=!0,o&&(n=o);try{if(e===r)throw Ke(\\"Promise can't be resolved itself\\");var i=$e(r);i?Se(function(){var o={done:!1};try{i.call(r,cn(t,e,o,n),cn(un,e,o,n))}catch(t){un(e,o,t,n)}}):(n.value=r,n.state=1,tn(e,n,!1))}catch(t){un(e,{done:!1},t,n)}}};Xe&&(Be=function(t){!function(t,e,n){if(!(t instanceof Be))throw TypeError(\\"Incorrect Promise invocation\\")}(this),wt(t),we.call(this);var e=De(this);try{t(cn(an,this,e),cn(un,this,e))}catch(t){un(this,e,t)}},(we=function(t){Re(this,{type:\\"Promise\\",done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=function(t,e,n){for(var r in e)Q(t,r,e[r],void 0);return t}(Be.prototype,{then:function(t,e){var n,r,o,i=ze(this),c=Ve((n=Be,void 0===(o=F(this).constructor)||null==(r=F(o)[Kt])?n:wt(r)));return c.ok=\\"function\\"!=typeof t||t,c.fail=\\"function\\"==typeof e&&e,c.domain=Je?qe.domain:void 0,i.parent=!0,i.reactions.push(c),0!=i.state&&tn(this,i,!1),c.promise},catch:function(t){return this.then(void 0,t)}}),je=function(){var t=new we,e=De(t);this.promise=t,this.resolve=cn(an,t,e),this.reject=cn(un,t,e)},Te.f=Ve=function(t){return t===Be||t===Pe?new je(t):Ye(t)},\\"function\\"==typeof Ge&&bt({global:!0,enumerable:!0,forced:!0},{fetch:function(t){return Me(Be,Ge.apply(a,arguments))}})),bt({global:!0,wrap:!0,forced:Xe},{Promise:Be}),(Oe=Be)&&!O(Oe=Oe.prototype,_e)&&Fe(Oe,_e,{configurable:!0,value:\\"Promise\\"}),Ee=function(t,e){return arguments.length<2?Ae(Ie[t])||Ae(a[t]):Ie[t]&&Ie[t][e]||a[t]&&a[t][e]}(\\"Promise\\"),s&&Ee&&!Ee[Ce]&&(0,I.f)(Ee,Ce,{configurable:!0,get:function(){return this}}),Pe=Ie.Promise,bt({target:\\"Promise\\",stat:!0,forced:Xe},{reject:function(t){var e=Ve(this);return e.reject.call(void 0,t),e.promise}}),bt({target:\\"Promise\\",stat:!0,forced:Xe},{resolve:function(t){return Me(this,t)}}),bt({target:\\"Promise\\",stat:!0,forced:Ze},{all:function(t){var e=this,n=Ve(e),r=n.resolve,o=n.reject,i=ke(function(){var n=wt(e.resolve),i=[],c=0,u=1;Ct(t,function(t){var a=c++,f=!1;i.push(void 0),u++,n.call(e,t).then(function(t){f||(f=!0,i[a]=t,--u||r(i))},o)}),--u||r(i)});return i.error&&o(i.value),n.promise},race:function(t){var e=this,n=Ve(e),r=n.reject,o=ke(function(){var o=wt(e.resolve);Ct(t,function(t){o.call(e,t).then(n.resolve,r)})});return o.error&&r(o.value),n.promise}}),t.MyClass=class{constructor(){var t;t=[\\"foo\\",\\"bar\\"],\\"myFields\\"in this?Object.defineProperty(this,\\"myFields\\",{value:t,enumerable:!0,configurable:!0,writable:!0}):this.myFields=t}foo(){try{return this.myFields.find(t=>\\"bar\\"===t)}catch(t){return Promise.reject(t)}}}}); +//# sourceMappingURL=custom-babelrc.umd.js.map +" +`; + exports[`fixtures build custom-source with microbundle 1`] = ` "Used script: microbundle diff --git a/test/fixtures/custom-babelrc/.babelrc b/test/fixtures/custom-babelrc/.babelrc new file mode 100644 index 0000000..3889030 --- /dev/null +++ b/test/fixtures/custom-babelrc/.babelrc @@ -0,0 +1,24 @@ +{ + "presets": [ + [ + "@babel/preset-env", + { + "loose": true, + "modules": false, + "useBuiltIns": "usage", + "corejs": 3, + "targets": { + "esmodules": true + } + } + ] + ], + "plugins": [ + [ + "@babel/plugin-proposal-class-properties", + { + "loose": false + } + ] + ] +} diff --git a/test/fixtures/custom-babelrc/package.json b/test/fixtures/custom-babelrc/package.json new file mode 100644 index 0000000..8b54057 --- /dev/null +++ b/test/fixtures/custom-babelrc/package.json @@ -0,0 +1,3 @@ +{ + "name": "custom-babelrc" +} diff --git a/test/fixtures/custom-babelrc/src/index.js b/test/fixtures/custom-babelrc/src/index.js new file mode 100644 index 0000000..7484983 --- /dev/null +++ b/test/fixtures/custom-babelrc/src/index.js @@ -0,0 +1,6 @@ +export class MyClass { + myFields = ['foo', 'bar']; + async foo() { + return this.myFields.find(item => item === 'bar'); + } +} From 1066af7942e557e56fc29dc5bf76f340ef86d778 Mon Sep 17 00:00:00 2001 From: Leah Date: Fri, 7 Jun 2019 19:22:40 +0200 Subject: [PATCH 06/13] fix `--no-compress` and update snapshots until terser is fixed --- src/index.js | 5 +- test/__snapshots__/index.test.js.snap | 400 ++++++++++++++---- .../basic-compress-false/package.json | 6 + .../basic-compress-false/src/index.js | 5 + test/fixtures/basic-compress-false/src/two.js | 3 + test/fixtures/basic-no-compress/package.json | 2 +- 6 files changed, 347 insertions(+), 74 deletions(-) create mode 100644 test/fixtures/basic-compress-false/package.json create mode 100644 test/fixtures/basic-compress-false/src/index.js create mode 100644 test/fixtures/basic-compress-false/src/two.js diff --git a/src/index.js b/src/index.js index ab983a7..f0071a0 100644 --- a/src/index.js +++ b/src/index.js @@ -166,7 +166,10 @@ export default async function microbundle(inputOptions) { options.multipleEntries = options.entries.length > 1; // to disable compress you can put in false or 0 but it's a string so our boolean checks won't work - options.compress = options.compress !== 'false' && options.compress !== '0'; + options.compress = + typeof options.compress !== 'boolean' + ? options.compress !== 'false' && options.compress !== '0' + : options.compress; let formats = (options.format || options.formats).split(','); // always compile cjs first if it's there: diff --git a/test/__snapshots__/index.test.js.snap b/test/__snapshots__/index.test.js.snap index 11d369f..7d10954 100644 --- a/test/__snapshots__/index.test.js.snap +++ b/test/__snapshots__/index.test.js.snap @@ -117,30 +117,36 @@ async-ts Build \\"asyncTs\\" to dist: -84 B: async-ts.js.gz -61 B: async-ts.js.br -94 B: async-ts.mjs.gz -76 B: async-ts.mjs.br -187 B: async-ts.umd.js.gz -150 B: async-ts.umd.js.br" +111 B: async-ts.js.gz +85 B: async-ts.js.br +120 B: async-ts.mjs.gz +105 B: async-ts.mjs.br +207 B: async-ts.umd.js.gz +161 B: async-ts.umd.js.br" `; exports[`fixtures build async-ts with microbundle 2`] = `7`; exports[`fixtures build async-ts with microbundle 3`] = ` -"exports.MyClass=function(){function o(){}return o.prototype.foo=function(){},o}(); +"exports.MyClass= +/* */ +function(){function o(){}return o.prototype.foo=function(){return Promise.resolve()},o}(); //# sourceMappingURL=async-ts.js.map " `; exports[`fixtures build async-ts with microbundle 4`] = ` -"var o=function(){function o(){}return o.prototype.foo=function(){},o}();export{o as MyClass}; +"var o= +/* */ +function(){function o(){}return o.prototype.foo=function(){return Promise.resolve()},o}();export{o as MyClass}; //# sourceMappingURL=async-ts.mjs.map " `; exports[`fixtures build async-ts with microbundle 5`] = ` -"!function(e,n){\\"object\\"==typeof exports&&\\"undefined\\"!=typeof module?n(exports):\\"function\\"==typeof define&&define.amd?define([\\"exports\\"],n):n((e=e||self).asyncTs={})}(this,function(e){e.MyClass=function(){function e(){}return e.prototype.foo=function(){},e}()}); +"!function(e,n){\\"object\\"==typeof exports&&\\"undefined\\"!=typeof module?n(exports):\\"function\\"==typeof define&&define.amd?define([\\"exports\\"],n):n((e=e||self).asyncTs={})}(this,function(e){e.MyClass= +/* */ +function(){function e(){}return e.prototype.foo=function(){return Promise.resolve()},e}()}); //# sourceMappingURL=async-ts.umd.js.map " `; @@ -247,6 +253,151 @@ exports[`fixtures build basic-babelrc with microbundle 5`] = ` " `; +exports[`fixtures build basic-compress-false with microbundle 1`] = ` +"Used script: microbundle --compress=false + +Directory tree: + +basic-compress-false + dist + basic-no-compress.js + basic-no-compress.js.map + basic-no-compress.mjs + basic-no-compress.mjs.map + basic-no-compress.umd.js + basic-no-compress.umd.js.map + package.json + src + index.js + two.js + + +Build \\"basicNoCompress\\" to dist: +303 B: basic-no-compress.js.gz +244 B: basic-no-compress.js.br +301 B: basic-no-compress.mjs.gz +244 B: basic-no-compress.mjs.br +422 B: basic-no-compress.umd.js.gz +349 B: basic-no-compress.umd.js.br" +`; + +exports[`fixtures build basic-compress-false with microbundle 2`] = `6`; + +exports[`fixtures build basic-compress-false with microbundle 3`] = ` +"var two = function two() { + try { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + return Promise.resolve(args.reduce(function (total, value) { + return total + value; + }, 0)); + } catch (e) { + return Promise.reject(e); + } +}; + +var index = (function () { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + try { + return Promise.resolve(two.apply(void 0, args)).then(function (_two) { + return Promise.resolve(two.apply(void 0, args)).then(function (_two2) { + return [_two, _two2]; + }); + }); + } catch (e) { + return Promise.reject(e); + } +}); + +module.exports = index; +//# sourceMappingURL=basic-no-compress.js.map +" +`; + +exports[`fixtures build basic-compress-false with microbundle 4`] = ` +"var two = function two() { + try { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + return Promise.resolve(args.reduce(function (total, value) { + return total + value; + }, 0)); + } catch (e) { + return Promise.reject(e); + } +}; + +var index = (function () { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + try { + return Promise.resolve(two.apply(void 0, args)).then(function (_two) { + return Promise.resolve(two.apply(void 0, args)).then(function (_two2) { + return [_two, _two2]; + }); + }); + } catch (e) { + return Promise.reject(e); + } +}); + +export default index; +//# sourceMappingURL=basic-no-compress.mjs.map +" +`; + +exports[`fixtures build basic-compress-false with microbundle 5`] = ` +"(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : + typeof define === 'function' && define.amd ? define(factory) : + (global = global || self, global.basicNoCompress = factory()); +}(this, function () { + var two = function two() { + try { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + return Promise.resolve(args.reduce(function (total, value) { + return total + value; + }, 0)); + } catch (e) { + return Promise.reject(e); + } + }; + + var index = (function () { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + try { + return Promise.resolve(two.apply(void 0, args)).then(function (_two) { + return Promise.resolve(two.apply(void 0, args)).then(function (_two2) { + return [_two, _two2]; + }); + }); + } catch (e) { + return Promise.reject(e); + } + }); + + return index; + +})); +//# sourceMappingURL=basic-no-compress.umd.js.map +" +`; + exports[`fixtures build basic-css with microbundle 1`] = ` "Used script: microbundle @@ -424,7 +575,7 @@ exports[`fixtures build basic-multi-source with microbundle 8`] = ` `; exports[`fixtures build basic-no-compress with microbundle 1`] = ` -"Used script: microbundle --compress=false +"Used script: microbundle --no-compress Directory tree: @@ -592,30 +743,36 @@ basic-ts Build \\"basicLibTs\\" to dist: -104 B: basic-lib-ts.js.gz -76 B: basic-lib-ts.js.br -97 B: basic-lib-ts.mjs.gz -73 B: basic-lib-ts.mjs.br -187 B: basic-lib-ts.umd.js.gz -144 B: basic-lib-ts.umd.js.br" +110 B: basic-lib-ts.js.gz +86 B: basic-lib-ts.js.br +104 B: basic-lib-ts.mjs.gz +84 B: basic-lib-ts.mjs.br +193 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}());module.exports=n; +"var n=new( +/* */ +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 4`] = ` -"export default new(function(){function n(){}return n.prototype.drive=function(n){return!0},n}()); +"export default new( +/* */ +function(){function n(){}return n.prototype.drive=function(n){return!0},n}()); //# sourceMappingURL=basic-lib-ts.mjs.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=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=e||self).basicLibTs=n()}(this,function(){return new( +/* */ +function(){function e(){}return e.prototype.drive=function(e){return!0},e}())}); //# sourceMappingURL=basic-lib-ts.umd.js.map " `; @@ -659,30 +816,36 @@ basic-tsx Build \\"basicLibTsx\\" to dist: -235 B: basic-lib-tsx.js.gz -188 B: basic-lib-tsx.js.br -239 B: basic-lib-tsx.mjs.gz -191 B: basic-lib-tsx.mjs.br -317 B: basic-lib-tsx.umd.js.gz -260 B: basic-lib-tsx.umd.js.br" +245 B: basic-lib-tsx.js.gz +230 B: basic-lib-tsx.js.br +246 B: basic-lib-tsx.mjs.gz +207 B: basic-lib-tsx.mjs.br +324 B: basic-lib-tsx.umd.js.gz +273 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 r=function(r,n){for(var e=arguments.length,o=new Array(e>2?e-2:0),t=2;t2?e-2:0),t=2;t2?e-2:0),o=2;o2?e-2:0),o=2;o2?o-2:0),r=2;r2?o-2:0),r=2;r=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= +/* */ +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 4`] = ` -"var e=function(){function e(e){this.greeting=e}return e.prototype.greet=function(){return\\"Hello, \\"+this.greeting},e}();export default 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\\"); +"var e= +/* */ +function(){function e(e){this.greeting=e}return e.prototype.greet=function(){return\\"Hello, \\"+this.greeting},e}();export default 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\\"); //# sourceMappingURL=class-decorators-ts.mjs.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=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,n,o){var r,f=arguments.length,c=f<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if(\\"object\\"==typeof Reflect&&\\"function\\"==typeof Reflect.decorate)c=Reflect.decorate(e,t,n,o);else for(var i=e.length-1;i>=0;i--)(r=e[i])&&(c=(f<3?r(c):f>3?r(t,n,c):r(t,n))||c);return f>3&&c&&Object.defineProperty(t,n,c),c}([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=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,n,o){var r,f=arguments.length,c=f<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if(\\"object\\"==typeof Reflect&&\\"function\\"==typeof Reflect.decorate)c=Reflect.decorate(e,t,n,o);else for(var i=e.length-1;i>=0;i--)(r=e[i])&&(c=(f<3?r(c):f>3?r(t,n,c):r(t,n))||c);return f>3&&c&&Object.defineProperty(t,n,c),c}([function(e){Object.seal(e),Object.seal(e.prototype)}],e))(\\"Hello World\\")}); //# sourceMappingURL=class-decorators-ts.umd.js.map " `; @@ -869,30 +1038,30 @@ custom-babelrc Build \\"customBabelrc\\" to dist: -5.6 kB: custom-babelrc.js.gz -5.05 kB: custom-babelrc.js.br -5.6 kB: custom-babelrc.mjs.gz -5.06 kB: custom-babelrc.mjs.br -5.67 kB: custom-babelrc.umd.js.gz -5.12 kB: custom-babelrc.umd.js.br" +5.62 kB: custom-babelrc.js.gz +5.07 kB: custom-babelrc.js.br +5.63 kB: custom-babelrc.mjs.gz +5.08 kB: custom-babelrc.mjs.br +5.69 kB: custom-babelrc.umd.js.gz +5.13 kB: custom-babelrc.umd.js.br" `; exports[`fixtures build custom-babelrc with microbundle 2`] = `6`; exports[`fixtures build custom-babelrc with microbundle 3`] = ` -"var t=\\"undefined\\"!=typeof globalThis?globalThis:\\"undefined\\"!=typeof window?window:\\"undefined\\"!=typeof global?global:\\"undefined\\"!=typeof self?self:{};function e(t,e){return t(e={exports:{}},e.exports),e.exports}var n,r,o,i=\\"object\\",c=function(t){return t&&t.Math==Math&&t},u=c(typeof globalThis==i&&globalThis)||c(typeof window==i&&window)||c(typeof self==i&&self)||c(typeof t==i&&t)||Function(\\"return this\\")(),a=function(t){try{return!!t()}catch(t){return!0}},f=!a(function(){return 7!=Object.defineProperty({},\\"a\\",{get:function(){return 7}}).a}),s={}.propertyIsEnumerable,l=Object.getOwnPropertyDescriptor,p={f:l&&!s.call({1:2},1)?function(t){var e=l(this,t);return!!e&&e.enumerable}:s},v=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},h={}.toString,d=function(t){return h.call(t).slice(8,-1)},y=\\"\\".split,m=a(function(){return!Object(\\"z\\").propertyIsEnumerable(0)})?function(t){return\\"String\\"==d(t)?y.call(t,\\"\\"):Object(t)}:Object,g=function(t){return m(function(t){if(null==t)throw TypeError(\\"Can't call method on \\"+t);return t}(t))},b=function(t){return\\"object\\"==typeof t?null!==t:\\"function\\"==typeof t},w=function(t,e){if(!b(t))return t;var n,r;if(e&&\\"function\\"==typeof(n=t.toString)&&!b(r=n.call(t)))return r;if(\\"function\\"==typeof(n=t.valueOf)&&!b(r=n.call(t)))return r;if(!e&&\\"function\\"==typeof(n=t.toString)&&!b(r=n.call(t)))return r;throw TypeError(\\"Can't convert object to primitive value\\")},j={}.hasOwnProperty,P=function(t,e){return j.call(t,e)},O=u.document,E=b(O)&&b(O.createElement),S=function(t){return E?O.createElement(t):{}},T=!f&&!a(function(){return 7!=Object.defineProperty(S(\\"div\\"),\\"a\\",{get:function(){return 7}}).a}),x=Object.getOwnPropertyDescriptor,M={f:f?x:function(t,e){if(t=g(t),e=w(e,!0),T)try{return x(t,e)}catch(t){}if(P(t,e))return v(!p.f.call(t,e),t[e])}},k=function(t){if(!b(t))throw TypeError(String(t)+\\" is not an object\\");return t},F=Object.defineProperty,_={f:f?F:function(t,e,n){if(k(t),e=w(e,!0),k(n),T)try{return F(t,e,n)}catch(t){}if(\\"get\\"in n||\\"set\\"in n)throw TypeError(\\"Accessors not supported\\");return\\"value\\"in n&&(t[e]=n.value),t}},I=f?function(t,e,n){return _.f(t,e,v(1,n))}:function(t,e,n){return t[e]=n,t},A=function(t,e){try{I(u,t,e)}catch(n){u[t]=e}return e},C=e(function(t){var e=u[\\"__core-js_shared__\\"]||A(\\"__core-js_shared__\\",{});(t.exports=function(t,n){return e[t]||(e[t]=void 0!==n?n:{})})(\\"versions\\",[]).push({version:\\"3.1.2\\",mode:\\"global\\",copyright:\\"© 2019 Denis Pushkarev (zloirock.ru)\\"})}),L=C(\\"native-function-to-string\\",Function.toString),N=u.WeakMap,D=\\"function\\"==typeof N&&/native code/.test(L.call(N)),R=0,z=Math.random(),K=function(t){return\\"Symbol(\\".concat(void 0===t?\\"\\":t,\\")_\\",(++R+z).toString(36))},W=C(\\"keys\\"),q={};if(D){var B=new(0,u.WeakMap),G=B.get,U=B.has,H=B.set;n=function(t,e){return H.call(B,t,e),e},r=function(t){return G.call(B,t)||{}},o=function(t){return U.call(B,t)}}else{var V=W.state||(W.state=K(\\"state\\"));q[V]=!0,n=function(t,e){return I(t,V,e),e},r=function(t){return P(t,V)?t[V]:{}},o=function(t){return P(t,V)}}var Y={set:n,get:r,has:o,enforce:function(t){return o(t)?r(t):n(t,{})},getterFor:function(t){return function(e){var n;if(!b(e)||(n=r(e)).type!==t)throw TypeError(\\"Incompatible receiver, \\"+t+\\" required\\");return n}}},J=e(function(t){var e=Y.get,n=Y.enforce,r=String(L).split(\\"toString\\");C(\\"inspectSource\\",function(t){return L.call(t)}),(t.exports=function(t,e,o,i){var c=!!i&&!!i.unsafe,a=!!i&&!!i.enumerable,f=!!i&&!!i.noTargetGet;\\"function\\"==typeof o&&(\\"string\\"!=typeof e||P(o,\\"name\\")||I(o,\\"name\\",e),n(o).source=r.join(\\"string\\"==typeof e?e:\\"\\")),t!==u?(c?!f&&t[e]&&(a=!0):delete t[e],a?t[e]=o:I(t,e,o)):a?t[e]=o:A(e,o)})(Function.prototype,\\"toString\\",function(){return\\"function\\"==typeof this&&e(this).source||L.call(this)})}),Q=Math.ceil,X=Math.floor,Z=function(t){return isNaN(t=+t)?0:(t>0?X:Q)(t)},$=Math.min,tt=function(t){return t>0?$(Z(t),9007199254740991):0},et=Math.max,nt=Math.min,rt=function(t,e,n){for(var r=g(t),o=tt(r.length),i=function(t,e){var r=Z(n);return r<0?et(r+e,0):nt(r,e)}(0,o);o>i;i++)if(i in r&&r[i]===e)return i||0;return-1},ot=[\\"constructor\\",\\"hasOwnProperty\\",\\"isPrototypeOf\\",\\"propertyIsEnumerable\\",\\"toLocaleString\\",\\"toString\\",\\"valueOf\\"].concat(\\"length\\",\\"prototype\\"),it={f:Object.getOwnPropertyNames||function(t){return function(t,e){var n,r=g(t),o=0,i=[];for(n in r)!P(q,n)&&P(r,n)&&i.push(n);for(;e.length>o;)P(r,n=e[o++])&&(~rt(i,n)||i.push(n));return i}(t,ot)}},ct={f:Object.getOwnPropertySymbols},ut=u.Reflect,at=ut&&ut.ownKeys||function(t){var e=it.f(k(t)),n=ct.f;return n?e.concat(n(t)):e},ft=function(t,e){for(var n=at(e),r=_.f,o=M.f,i=0;ia;a++)if((o?l(k(s=t[a])[0],s[1]):l(t[a]))===e)return e;return}c=u.call(t)}for(;!(s=c.next()).done;)if(It(c,l,s.value,o)===e)return e}).BREAK=e}),Ct=Et(\\"iterator\\"),Lt=!1;try{var Nt=0;({next:function(){return{done:!!Nt++}},return:function(){Lt=!0}})[Ct]=function(){return this}}catch(t){}var Dt,Rt,zt,Kt=Et(\\"species\\"),Wt=u.document,qt=Wt&&Wt.documentElement,Bt=u.location,Gt=u.setImmediate,Ut=u.clearImmediate,Ht=u.process,Vt=u.MessageChannel,Yt=u.Dispatch,Jt=0,Qt={},Xt=function(t){if(Qt.hasOwnProperty(t)){var e=Qt[t];delete Qt[t],e()}},Zt=function(t){return function(){Xt(t)}},$t=function(t){Xt(t.data)},te=function(t){u.postMessage(t+\\"\\",Bt.protocol+\\"//\\"+Bt.host)};Gt&&Ut||(Gt=function(t){for(var e=[],n=1;arguments.length>n;)e.push(arguments[n++]);return Qt[++Jt]=function(){(\\"function\\"==typeof t?t:Function(t)).apply(void 0,e)},Dt(Jt),Jt},Ut=function(t){delete Qt[t]},\\"process\\"==d(Ht)?Dt=function(t){Ht.nextTick(Zt(t))}:Yt&&Yt.now?Dt=function(t){Yt.now(Zt(t))}:Vt?(zt=(Rt=new Vt).port2,Rt.port1.onmessage=$t,Dt=Mt(zt.postMessage,zt,1)):!u.addEventListener||\\"function\\"!=typeof postMessage||u.importScripts||a(te)?Dt=\\"onreadystatechange\\"in S(\\"script\\")?function(t){qt.appendChild(S(\\"script\\")).onreadystatechange=function(){qt.removeChild(this),Xt(t)}}:function(t){setTimeout(Zt(t),0)}:(Dt=te,u.addEventListener(\\"message\\",$t,!1)));var ee,ne,re,oe,ie,ce,ue,ae={set:Gt,clear:Ut},fe=u.navigator,se=fe&&fe.userAgent||\\"\\",le=M.f,pe=ae.set,ve=u.MutationObserver||u.WebKitMutationObserver,he=u.process,de=u.Promise,ye=\\"process\\"==d(he),me=le(u,\\"queueMicrotask\\"),ge=me&&me.value;ge||(ee=function(){var t,e;for(ye&&(t=he.domain)&&t.exit();ne;){e=ne.fn,ne=ne.next;try{e()}catch(t){throw ne?oe():re=void 0,t}}re=void 0,t&&t.enter()},ye?oe=function(){he.nextTick(ee)}:ve&&!/(iphone|ipod|ipad).*applewebkit/i.test(se)?(ie=!0,ce=document.createTextNode(\\"\\"),new ve(ee).observe(ce,{characterData:!0}),oe=function(){ce.data=ie=!ie}):de&&de.resolve?(ue=de.resolve(void 0),oe=function(){ue.then(ee)}):oe=function(){pe.call(u,ee)});var be,we,je,Pe,Oe,Ee=ge||function(t){var e={fn:t,next:void 0};re&&(re.next=e),ne||(ne=e,oe()),re=e},Se=function(t){var e,n;this.promise=new t(function(t,r){if(void 0!==e||void 0!==n)throw TypeError(\\"Bad Promise constructor\\");e=t,n=r}),this.resolve=bt(e),this.reject=bt(n)},Te={f:function(t){return new Se(t)}},xe=function(t,e){if(k(t),b(e)&&e.constructor===t)return e;var n=Te.f(t);return(0,n.resolve)(e),n.promise},Me=function(t){try{return{error:!1,value:t()}}catch(t){return{error:!0,value:t}}},ke=_.f,Fe=Et(\\"toStringTag\\"),_e=u,Ie=function(t){return\\"function\\"==typeof t?t:void 0},Ae=Et(\\"species\\"),Ce=ae.set,Le=Et(\\"species\\"),Ne=Y.get,De=Y.set,Re=Y.getterFor(\\"Promise\\"),ze=u.Promise,Ke=u.TypeError,We=u.document,qe=u.process,Be=u.fetch,Ge=qe&&qe.versions,Ue=Ge&&Ge.v8||\\"\\",He=Te.f,Ve=He,Ye=\\"process\\"==d(qe),Je=!!(We&&We.createEvent&&u.dispatchEvent),Qe=yt(\\"Promise\\",function(){var t=ze.resolve(1),e=function(){},n=(t.constructor={})[Le]=function(t){t(e,e)};return!((Ye||\\"function\\"==typeof PromiseRejectionEvent)&&t.then(e)instanceof n&&0!==Ue.indexOf(\\"6.6\\")&&-1===se.indexOf(\\"Chrome/66\\"))}),Xe=Qe||!function(t,e){if(!Lt)return!1;var n=!1;try{var r={};r[Ct]=function(){return{next:function(){return{done:n=!0}}}},ze.all(r).catch(function(){})}catch(t){}return n}(),Ze=function(t){var e;return!(!b(t)||\\"function\\"!=typeof(e=t.then))&&e},$e=function(t,e,n){if(!e.notified){e.notified=!0;var r=e.reactions;Ee(function(){for(var o=e.value,i=1==e.state,c=0,u=function(n){var r,c,u,a=i?n.ok:n.fail,f=n.resolve,s=n.reject,l=n.domain;try{a?(i||(2===e.rejection&&rn(t,e),e.rejection=1),!0===a?r=o:(l&&l.enter(),r=a(o),l&&(l.exit(),u=!0)),r===n.promise?s(Ke(\\"Promise-chain cycle\\")):(c=Ze(r))?c.call(r,f,s):f(r)):s(o)}catch(t){l&&!u&&l.exit(),s(t)}};r.length>c;)u(r[c++]);e.reactions=[],e.notified=!1,n&&!e.rejection&&en(t,e)})}},tn=function(t,e,n){var r,o;Je?((r=We.createEvent(\\"Event\\")).promise=e,r.reason=n,r.initEvent(t,!1,!0),u.dispatchEvent(r)):r={promise:e,reason:n},(o=u[\\"on\\"+t])?o(r):\\"unhandledrejection\\"===t&&function(t,e){var n=u.console;n&&n.error&&(1===arguments.length?n.error(t):n.error(t,e))}(\\"Unhandled promise rejection\\",n)},en=function(t,e){Ce.call(u,function(){var n,r=e.value;if(nn(e)&&(n=Me(function(){Ye?qe.emit(\\"unhandledRejection\\",r,t):tn(\\"unhandledrejection\\",t,r)}),e.rejection=Ye||nn(e)?2:1,n.error))throw n.value})},nn=function(t){return 1!==t.rejection&&!t.parent},rn=function(t,e){Ce.call(u,function(){Ye?qe.emit(\\"rejectionHandled\\",t):tn(\\"rejectionhandled\\",t,e.value)})},on=function(t,e,n,r){return function(o){t(e,n,o,r)}},cn=function(t,e,n,r){e.done||(e.done=!0,r&&(e=r),e.value=n,e.state=2,$e(t,e,!0))},un=function t(e,n,r,o){if(!n.done){n.done=!0,o&&(n=o);try{if(e===r)throw Ke(\\"Promise can't be resolved itself\\");var i=Ze(r);i?Ee(function(){var o={done:!1};try{i.call(r,on(t,e,o,n),on(cn,e,o,n))}catch(t){cn(e,o,t,n)}}):(n.value=r,n.state=1,$e(e,n,!1))}catch(t){cn(e,{done:!1},t,n)}}};Qe&&(ze=function(t){!function(t,e,n){if(!(t instanceof ze))throw TypeError(\\"Incorrect Promise invocation\\")}(this),bt(t),be.call(this);var e=Ne(this);try{t(on(un,this,e),on(cn,this,e))}catch(t){cn(this,e,t)}},(be=function(t){De(this,{type:\\"Promise\\",done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=function(t,e,n){for(var r in e)J(t,r,e[r],void 0);return t}(ze.prototype,{then:function(t,e){var n,r,o,i=Re(this),c=He((n=ze,void 0===(o=k(this).constructor)||null==(r=k(o)[Kt])?n:bt(r)));return c.ok=\\"function\\"!=typeof t||t,c.fail=\\"function\\"==typeof e&&e,c.domain=Ye?qe.domain:void 0,i.parent=!0,i.reactions.push(c),0!=i.state&&$e(this,i,!1),c.promise},catch:function(t){return this.then(void 0,t)}}),we=function(){var t=new be,e=Ne(t);this.promise=t,this.resolve=on(un,t,e),this.reject=on(cn,t,e)},Te.f=He=function(t){return t===ze||t===je?new we(t):Ve(t)},\\"function\\"==typeof Be&>({global:!0,enumerable:!0,forced:!0},{fetch:function(t){return xe(ze,Be.apply(u,arguments))}})),gt({global:!0,wrap:!0,forced:Qe},{Promise:ze}),(Pe=ze)&&!P(Pe=Pe.prototype,Fe)&&ke(Pe,Fe,{configurable:!0,value:\\"Promise\\"}),Oe=function(t,e){return arguments.length<2?Ie(_e[t])||Ie(u[t]):_e[t]&&_e[t][e]||u[t]&&u[t][e]}(\\"Promise\\"),f&&Oe&&!Oe[Ae]&&(0,_.f)(Oe,Ae,{configurable:!0,get:function(){return this}}),je=_e.Promise,gt({target:\\"Promise\\",stat:!0,forced:Qe},{reject:function(t){var e=He(this);return e.reject.call(void 0,t),e.promise}}),gt({target:\\"Promise\\",stat:!0,forced:Qe},{resolve:function(t){return xe(this,t)}}),gt({target:\\"Promise\\",stat:!0,forced:Xe},{all:function(t){var e=this,n=He(e),r=n.resolve,o=n.reject,i=Me(function(){var n=bt(e.resolve),i=[],c=0,u=1;At(t,function(t){var a=c++,f=!1;i.push(void 0),u++,n.call(e,t).then(function(t){f||(f=!0,i[a]=t,--u||r(i))},o)}),--u||r(i)});return i.error&&o(i.value),n.promise},race:function(t){var e=this,n=He(e),r=n.reject,o=Me(function(){var o=bt(e.resolve);At(t,function(t){o.call(e,t).then(n.resolve,r)})});return o.error&&r(o.value),n.promise}}),exports.MyClass=class{constructor(){var t;t=[\\"foo\\",\\"bar\\"],\\"myFields\\"in this?Object.defineProperty(this,\\"myFields\\",{value:t,enumerable:!0,configurable:!0,writable:!0}):this.myFields=t}foo(){try{return this.myFields.find(t=>\\"bar\\"===t)}catch(t){return Promise.reject(t)}}}; +"var t=\\"undefined\\"!=typeof globalThis?globalThis:\\"undefined\\"!=typeof window?window:\\"undefined\\"!=typeof global?global:\\"undefined\\"!=typeof self?self:{};function n(t,n){return t(n={exports:{}},n.exports),n.exports}var e,r,o,i=\\"object\\",c=function(t){return t&&t.Math==Math&&t},u=c(typeof globalThis==i&&globalThis)||c(typeof window==i&&window)||c(typeof self==i&&self)||c(typeof t==i&&t)||Function(\\"return this\\")(),a=function(t){try{return!!t()}catch(t){return!0}},f=!a(function(){return 7!=Object.defineProperty({},\\"a\\",{get:function(){return 7}}).a}),s={}.propertyIsEnumerable,l=Object.getOwnPropertyDescriptor,p={f:l&&!s.call({1:2},1)?function(t){var n=l(this,t);return!!n&&n.enumerable}:s},v=function(t,n){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:n}},h={}.toString,d=function(t){return h.call(t).slice(8,-1)},y=\\"\\".split,m=a(function(){return!Object(\\"z\\").propertyIsEnumerable(0)})?function(t){return\\"String\\"==d(t)?y.call(t,\\"\\"):Object(t)}:Object,g=function(t){return m(function(t){if(null==t)throw TypeError(\\"Can't call method on \\"+t);return t}(t))},b=function(t){return\\"object\\"==typeof t?null!==t:\\"function\\"==typeof t},w=function(t,n){if(!b(t))return t;var e,r;if(n&&\\"function\\"==typeof(e=t.toString)&&!b(r=e.call(t)))return r;if(\\"function\\"==typeof(e=t.valueOf)&&!b(r=e.call(t)))return r;if(!n&&\\"function\\"==typeof(e=t.toString)&&!b(r=e.call(t)))return r;throw TypeError(\\"Can't convert object to primitive value\\")},j={}.hasOwnProperty,P=function(t,n){return j.call(t,n)},O=u.document,E=b(O)&&b(O.createElement),S=function(t){return E?O.createElement(t):{}},T=!f&&!a(function(){return 7!=Object.defineProperty(S(\\"div\\"),\\"a\\",{get:function(){return 7}}).a}),x=Object.getOwnPropertyDescriptor,M={f:f?x:function(t,n){if(t=g(t),n=w(n,!0),T)try{return x(t,n)}catch(t){}if(P(t,n))return v(!p.f.call(t,n),t[n])}},k=function(t){if(!b(t))throw TypeError(String(t)+\\" is not an object\\");return t},_=Object.defineProperty,A={f:f?_:function(t,n,e){if(k(t),n=w(n,!0),k(e),T)try{return _(t,n,e)}catch(t){}if(\\"get\\"in e||\\"set\\"in e)throw TypeError(\\"Accessors not supported\\");return\\"value\\"in e&&(t[n]=e.value),t}},F=f?function(t,n,e){return A.f(t,n,v(1,e))}:function(t,n,e){return t[n]=e,t},I=function(t,n){try{F(u,t,n)}catch(e){u[t]=n}return n},C=n(function(t){var n=u[\\"__core-js_shared__\\"]||I(\\"__core-js_shared__\\",{});(t.exports=function(t,e){return n[t]||(n[t]=void 0!==e?e:{})})(\\"versions\\",[]).push({version:\\"3.1.3\\",mode:\\"global\\",copyright:\\"© 2019 Denis Pushkarev (zloirock.ru)\\"})}),L=C(\\"native-function-to-string\\",Function.toString),N=u.WeakMap,D=\\"function\\"==typeof N&&/native code/.test(L.call(N)),R=0,z=Math.random(),K=function(t){return\\"Symbol(\\".concat(void 0===t?\\"\\":t,\\")_\\",(++R+z).toString(36))},W=C(\\"keys\\"),q={};if(D){var B=new(0,u.WeakMap),G=B.get,U=B.has,H=B.set;e=function(t,n){return H.call(B,t,n),n},r=function(t){return G.call(B,t)||{}},o=function(t){return U.call(B,t)}}else{var V=W.state||(W.state=K(\\"state\\"));q[V]=!0,e=function(t,n){return F(t,V,n),n},r=function(t){return P(t,V)?t[V]:{}},o=function(t){return P(t,V)}}var Y={set:e,get:r,has:o,enforce:function(t){return o(t)?r(t):e(t,{})},getterFor:function(t){return function(n){var e;if(!b(n)||(e=r(n)).type!==t)throw TypeError(\\"Incompatible receiver, \\"+t+\\" required\\");return e}}},J=n(function(t){var n=Y.get,e=Y.enforce,r=String(L).split(\\"toString\\");C(\\"inspectSource\\",function(t){return L.call(t)}),(t.exports=function(t,n,o,i){var c=!!i&&!!i.unsafe,a=!!i&&!!i.enumerable,f=!!i&&!!i.noTargetGet;\\"function\\"==typeof o&&(\\"string\\"!=typeof n||P(o,\\"name\\")||F(o,\\"name\\",n),e(o).source=r.join(\\"string\\"==typeof n?n:\\"\\")),t!==u?(c?!f&&t[n]&&(a=!0):delete t[n],a?t[n]=o:F(t,n,o)):a?t[n]=o:I(n,o)})(Function.prototype,\\"toString\\",function(){return\\"function\\"==typeof this&&n(this).source||L.call(this)})}),Q=Math.ceil,X=Math.floor,Z=function(t){return isNaN(t=+t)?0:(t>0?X:Q)(t)},$=Math.min,tt=function(t){return t>0?$(Z(t),9007199254740991):0},nt=Math.max,et=Math.min,rt=function(t,n,e){for(var r=g(t),o=tt(r.length),i=function(t,n){var r=Z(e);return r<0?nt(r+n,0):et(r,n)}(0,o);o>i;i++)if(i in r&&r[i]===n)return i||0;return-1},ot=[\\"constructor\\",\\"hasOwnProperty\\",\\"isPrototypeOf\\",\\"propertyIsEnumerable\\",\\"toLocaleString\\",\\"toString\\",\\"valueOf\\"].concat(\\"length\\",\\"prototype\\"),it={f:Object.getOwnPropertyNames||function(t){return function(t,n){var e,r=g(t),o=0,i=[];for(e in r)!P(q,e)&&P(r,e)&&i.push(e);for(;n.length>o;)P(r,e=n[o++])&&(~rt(i,e)||i.push(e));return i}(t,ot)}},ct={f:Object.getOwnPropertySymbols},ut=u.Reflect,at=ut&&ut.ownKeys||function(t){var n=it.f(k(t)),e=ct.f;return e?n.concat(e(t)):n},ft=function(t,n){for(var e=at(n),r=A.f,o=M.f,i=0;ia;a++)if((o?l(k(s=t[a])[0],s[1]):l(t[a]))===n)return n;return}c=u.call(t)}for(;!(s=c.next()).done;)if(Dt(c,l,s.value,o)===n)return n}).BREAK=n}),zt=Ot(\\"iterator\\"),Kt=!1;try{var Wt=0,qt={next:function(){return{done:!!Wt++}},return:function(){Kt=!0}};qt[zt]=function(){return this},Array.from(qt,function(){throw 2})}catch(t){}var Bt,Gt,Ut,Ht=Ot(\\"species\\"),Vt=u.document,Yt=Vt&&Vt.documentElement,Jt=u.location,Qt=u.setImmediate,Xt=u.clearImmediate,Zt=u.process,$t=u.MessageChannel,tn=u.Dispatch,nn=0,en={},rn=function(t){if(en.hasOwnProperty(t)){var n=en[t];delete en[t],n()}},on=function(t){return function(){rn(t)}},cn=function(t){rn(t.data)},un=function(t){u.postMessage(t+\\"\\",Jt.protocol+\\"//\\"+Jt.host)};Qt&&Xt||(Qt=function(t){for(var n=[],e=1;arguments.length>e;)n.push(arguments[e++]);return en[++nn]=function(){(\\"function\\"==typeof t?t:Function(t)).apply(void 0,n)},Bt(nn),nn},Xt=function(t){delete en[t]},\\"process\\"==d(Zt)?Bt=function(t){Zt.nextTick(on(t))}:tn&&tn.now?Bt=function(t){tn.now(on(t))}:$t?(Ut=(Gt=new $t).port2,Gt.port1.onmessage=cn,Bt=It(Ut.postMessage,Ut,1)):!u.addEventListener||\\"function\\"!=typeof postMessage||u.importScripts||a(un)?Bt=\\"onreadystatechange\\"in S(\\"script\\")?function(t){Yt.appendChild(S(\\"script\\")).onreadystatechange=function(){Yt.removeChild(this),rn(t)}}:function(t){setTimeout(on(t),0)}:(Bt=un,u.addEventListener(\\"message\\",cn,!1)));var an,fn,sn,ln,pn,vn,hn,dn={set:Qt,clear:Xt},yn=u.navigator,mn=yn&&yn.userAgent||\\"\\",gn=M.f,bn=dn.set,wn=u.MutationObserver||u.WebKitMutationObserver,jn=u.process,Pn=u.Promise,On=\\"process\\"==d(jn),En=gn(u,\\"queueMicrotask\\"),Sn=En&&En.value;Sn||(an=function(){var t,n;for(On&&(t=jn.domain)&&t.exit();fn;){n=fn.fn,fn=fn.next;try{n()}catch(t){throw fn?ln():sn=void 0,t}}sn=void 0,t&&t.enter()},On?ln=function(){jn.nextTick(an)}:wn&&!/(iphone|ipod|ipad).*applewebkit/i.test(mn)?(pn=!0,vn=document.createTextNode(\\"\\"),new wn(an).observe(vn,{characterData:!0}),ln=function(){vn.data=pn=!pn}):Pn&&Pn.resolve?(hn=Pn.resolve(void 0),ln=function(){hn.then(an)}):ln=function(){bn.call(u,an)});var Tn,xn,Mn,kn,_n,An=Sn||function(t){var n={fn:t,next:void 0};sn&&(sn.next=n),fn||(fn=n,ln()),sn=n},Fn=function(t){var n,e;this.promise=new t(function(t,r){if(void 0!==n||void 0!==e)throw TypeError(\\"Bad Promise constructor\\");n=t,e=r}),this.resolve=Mt(n),this.reject=Mt(e)},In={f:function(t){return new Fn(t)}},Cn=function(t,n){if(k(t),b(n)&&n.constructor===t)return n;var e=In.f(t);return(0,e.resolve)(n),e.promise},Ln=function(t){try{return{error:!1,value:t()}}catch(t){return{error:!0,value:t}}},Nn=dn.set,Dn=Ot(\\"species\\"),Rn=Y.get,zn=Y.set,Kn=Y.getterFor(\\"Promise\\"),Wn=u.Promise,qn=u.TypeError,Bn=u.document,Gn=u.process,Un=u.fetch,Hn=Gn&&Gn.versions,Vn=Hn&&Hn.v8||\\"\\",Yn=In.f,Jn=Yn,Qn=\\"process\\"==d(Gn),Xn=!!(Bn&&Bn.createEvent&&u.dispatchEvent),Zn=yt(\\"Promise\\",function(){var t=Wn.resolve(1),n=function(){},e=(t.constructor={})[Dn]=function(t){t(n,n)};return!((Qn||\\"function\\"==typeof PromiseRejectionEvent)&&t.then(n)instanceof e&&0!==Vn.indexOf(\\"6.6\\")&&-1===mn.indexOf(\\"Chrome/66\\"))}),$n=Zn||!function(t,n){if(!Kt)return!1;var e=!1;try{var r={};r[zt]=function(){return{next:function(){return{done:e=!0}}}},Wn.all(r).catch(function(){})}catch(t){}return e}(),te=function(t){var n;return!(!b(t)||\\"function\\"!=typeof(n=t.then))&&n},ne=function(t,n,e){if(!n.notified){n.notified=!0;var r=n.reactions;An(function(){for(var o=n.value,i=1==n.state,c=0,u=function(e){var r,c,u,a=i?e.ok:e.fail,f=e.resolve,s=e.reject,l=e.domain;try{a?(i||(2===n.rejection&&ie(t,n),n.rejection=1),!0===a?r=o:(l&&l.enter(),r=a(o),l&&(l.exit(),u=!0)),r===e.promise?s(qn(\\"Promise-chain cycle\\")):(c=te(r))?c.call(r,f,s):f(r)):s(o)}catch(t){l&&!u&&l.exit(),s(t)}};r.length>c;)u(r[c++]);n.reactions=[],n.notified=!1,e&&!n.rejection&&re(t,n)})}},ee=function(t,n,e){var r,o;Xn?((r=Bn.createEvent(\\"Event\\")).promise=n,r.reason=e,r.initEvent(t,!1,!0),u.dispatchEvent(r)):r={promise:n,reason:e},(o=u[\\"on\\"+t])?o(r):\\"unhandledrejection\\"===t&&function(t,n){var e=u.console;e&&e.error&&(1===arguments.length?e.error(t):e.error(t,n))}(\\"Unhandled promise rejection\\",e)},re=function(t,n){Nn.call(u,function(){var e,r=n.value;if(oe(n)&&(e=Ln(function(){Qn?Gn.emit(\\"unhandledRejection\\",r,t):ee(\\"unhandledrejection\\",t,r)}),n.rejection=Qn||oe(n)?2:1,e.error))throw e.value})},oe=function(t){return 1!==t.rejection&&!t.parent},ie=function(t,n){Nn.call(u,function(){Qn?Gn.emit(\\"rejectionHandled\\",t):ee(\\"rejectionhandled\\",t,n.value)})},ce=function(t,n,e,r){return function(o){t(n,e,o,r)}},ue=function(t,n,e,r){n.done||(n.done=!0,r&&(n=r),n.value=e,n.state=2,ne(t,n,!0))},ae=function t(n,e,r,o){if(!e.done){e.done=!0,o&&(e=o);try{if(n===r)throw qn(\\"Promise can't be resolved itself\\");var i=te(r);i?An(function(){var o={done:!1};try{i.call(r,ce(t,n,o,e),ce(ue,n,o,e))}catch(t){ue(n,o,t,e)}}):(e.value=r,e.state=1,ne(n,e,!1))}catch(t){ue(n,{done:!1},t,e)}}};Zn&&(Wn=function(t){!function(t,n,e){if(!(t instanceof Wn))throw TypeError(\\"Incorrect Promise invocation\\")}(this),Mt(t),Tn.call(this);var n=Rn(this);try{t(ce(ae,this,n),ce(ue,this,n))}catch(t){ue(this,n,t)}},(Tn=function(t){zn(this,{type:\\"Promise\\",done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=function(t,n,e){for(var r in n)J(t,r,n[r],void 0);return t}(Wn.prototype,{then:function(t,n){var e=Kn(this),r=Yn(function(t,n){var e,r=k(t).constructor;return void 0===r||null==(e=k(r)[Ht])?n:Mt(e)}(this,Wn));return r.ok=\\"function\\"!=typeof t||t,r.fail=\\"function\\"==typeof n&&n,r.domain=Qn?Gn.domain:void 0,e.parent=!0,e.reactions.push(r),0!=e.state&&ne(this,e,!1),r.promise},catch:function(t){return this.then(void 0,t)}}),xn=function(){var t=new Tn,n=Rn(t);this.promise=t,this.resolve=ce(ae,t,n),this.reject=ce(ue,t,n)},In.f=Yn=function(t){return t===Wn||t===Mn?new xn(t):Jn(t)},\\"function\\"==typeof Un&>({global:!0,enumerable:!0,forced:!0},{fetch:function(t){return Cn(Wn,Un.apply(u,arguments))}})),gt({global:!0,wrap:!0,forced:Zn},{Promise:Wn}),(kn=Wn)&&!P(kn=kn.prototype,St)&&Et(kn,St,{configurable:!0,value:\\"Promise\\"}),_n=function(t,n){return arguments.length<2?Tt(bt[t])||Tt(u[t]):bt[t]&&bt[t][n]||u[t]&&u[t][n]}(\\"Promise\\"),f&&_n&&!_n[xt]&&(0,A.f)(_n,xt,{configurable:!0,get:function(){return this}}),Mn=bt.Promise,gt({target:\\"Promise\\",stat:!0,forced:Zn},{reject:function(t){var n=Yn(this);return n.reject.call(void 0,t),n.promise}}),gt({target:\\"Promise\\",stat:!0,forced:Zn},{resolve:function(t){return Cn(this,t)}}),gt({target:\\"Promise\\",stat:!0,forced:$n},{all:function(t){var n=this,e=Yn(n),r=e.resolve,o=e.reject,i=Ln(function(){var e=Mt(n.resolve),i=[],c=0,u=1;Rt(t,function(t){var a=c++,f=!1;i.push(void 0),u++,e.call(n,t).then(function(t){f||(f=!0,i[a]=t,--u||r(i))},o)}),--u||r(i)});return i.error&&o(i.value),e.promise},race:function(t){var n=this,e=Yn(n),r=e.reject,o=Ln(function(){var o=Mt(n.resolve);Rt(t,function(t){o.call(n,t).then(e.resolve,r)})});return o.error&&r(o.value),e.promise}}),exports.MyClass=class{constructor(){!function(t,n,e){n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e}(this,\\"myFields\\",[\\"foo\\",\\"bar\\"])}foo(){try{return this.myFields.find(t=>\\"bar\\"===t)}catch(t){return Promise.reject(t)}}}; //# sourceMappingURL=custom-babelrc.js.map " `; exports[`fixtures build custom-babelrc with microbundle 4`] = ` -"var t=\\"undefined\\"!=typeof globalThis?globalThis:\\"undefined\\"!=typeof window?window:\\"undefined\\"!=typeof global?global:\\"undefined\\"!=typeof self?self:{};function e(t,e){return t(e={exports:{}},e.exports),e.exports}var n,r,o,i=\\"object\\",c=function(t){return t&&t.Math==Math&&t},u=c(typeof globalThis==i&&globalThis)||c(typeof window==i&&window)||c(typeof self==i&&self)||c(typeof t==i&&t)||Function(\\"return this\\")(),a=function(t){try{return!!t()}catch(t){return!0}},f=!a(function(){return 7!=Object.defineProperty({},\\"a\\",{get:function(){return 7}}).a}),s={}.propertyIsEnumerable,l=Object.getOwnPropertyDescriptor,p={f:l&&!s.call({1:2},1)?function(t){var e=l(this,t);return!!e&&e.enumerable}:s},v=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},h={}.toString,d=function(t){return h.call(t).slice(8,-1)},y=\\"\\".split,m=a(function(){return!Object(\\"z\\").propertyIsEnumerable(0)})?function(t){return\\"String\\"==d(t)?y.call(t,\\"\\"):Object(t)}:Object,g=function(t){return m(function(t){if(null==t)throw TypeError(\\"Can't call method on \\"+t);return t}(t))},b=function(t){return\\"object\\"==typeof t?null!==t:\\"function\\"==typeof t},w=function(t,e){if(!b(t))return t;var n,r;if(e&&\\"function\\"==typeof(n=t.toString)&&!b(r=n.call(t)))return r;if(\\"function\\"==typeof(n=t.valueOf)&&!b(r=n.call(t)))return r;if(!e&&\\"function\\"==typeof(n=t.toString)&&!b(r=n.call(t)))return r;throw TypeError(\\"Can't convert object to primitive value\\")},j={}.hasOwnProperty,P=function(t,e){return j.call(t,e)},O=u.document,E=b(O)&&b(O.createElement),S=function(t){return E?O.createElement(t):{}},T=!f&&!a(function(){return 7!=Object.defineProperty(S(\\"div\\"),\\"a\\",{get:function(){return 7}}).a}),x=Object.getOwnPropertyDescriptor,M={f:f?x:function(t,e){if(t=g(t),e=w(e,!0),T)try{return x(t,e)}catch(t){}if(P(t,e))return v(!p.f.call(t,e),t[e])}},k=function(t){if(!b(t))throw TypeError(String(t)+\\" is not an object\\");return t},F=Object.defineProperty,_={f:f?F:function(t,e,n){if(k(t),e=w(e,!0),k(n),T)try{return F(t,e,n)}catch(t){}if(\\"get\\"in n||\\"set\\"in n)throw TypeError(\\"Accessors not supported\\");return\\"value\\"in n&&(t[e]=n.value),t}},I=f?function(t,e,n){return _.f(t,e,v(1,n))}:function(t,e,n){return t[e]=n,t},A=function(t,e){try{I(u,t,e)}catch(n){u[t]=e}return e},C=e(function(t){var e=u[\\"__core-js_shared__\\"]||A(\\"__core-js_shared__\\",{});(t.exports=function(t,n){return e[t]||(e[t]=void 0!==n?n:{})})(\\"versions\\",[]).push({version:\\"3.1.2\\",mode:\\"global\\",copyright:\\"© 2019 Denis Pushkarev (zloirock.ru)\\"})}),L=C(\\"native-function-to-string\\",Function.toString),N=u.WeakMap,D=\\"function\\"==typeof N&&/native code/.test(L.call(N)),R=0,z=Math.random(),K=function(t){return\\"Symbol(\\".concat(void 0===t?\\"\\":t,\\")_\\",(++R+z).toString(36))},W=C(\\"keys\\"),q={};if(D){var B=new(0,u.WeakMap),G=B.get,U=B.has,H=B.set;n=function(t,e){return H.call(B,t,e),e},r=function(t){return G.call(B,t)||{}},o=function(t){return U.call(B,t)}}else{var V=W.state||(W.state=K(\\"state\\"));q[V]=!0,n=function(t,e){return I(t,V,e),e},r=function(t){return P(t,V)?t[V]:{}},o=function(t){return P(t,V)}}var Y={set:n,get:r,has:o,enforce:function(t){return o(t)?r(t):n(t,{})},getterFor:function(t){return function(e){var n;if(!b(e)||(n=r(e)).type!==t)throw TypeError(\\"Incompatible receiver, \\"+t+\\" required\\");return n}}},J=e(function(t){var e=Y.get,n=Y.enforce,r=String(L).split(\\"toString\\");C(\\"inspectSource\\",function(t){return L.call(t)}),(t.exports=function(t,e,o,i){var c=!!i&&!!i.unsafe,a=!!i&&!!i.enumerable,f=!!i&&!!i.noTargetGet;\\"function\\"==typeof o&&(\\"string\\"!=typeof e||P(o,\\"name\\")||I(o,\\"name\\",e),n(o).source=r.join(\\"string\\"==typeof e?e:\\"\\")),t!==u?(c?!f&&t[e]&&(a=!0):delete t[e],a?t[e]=o:I(t,e,o)):a?t[e]=o:A(e,o)})(Function.prototype,\\"toString\\",function(){return\\"function\\"==typeof this&&e(this).source||L.call(this)})}),Q=Math.ceil,X=Math.floor,Z=function(t){return isNaN(t=+t)?0:(t>0?X:Q)(t)},$=Math.min,tt=function(t){return t>0?$(Z(t),9007199254740991):0},et=Math.max,nt=Math.min,rt=function(t,e,n){for(var r=g(t),o=tt(r.length),i=function(t,e){var r=Z(n);return r<0?et(r+e,0):nt(r,e)}(0,o);o>i;i++)if(i in r&&r[i]===e)return i||0;return-1},ot=[\\"constructor\\",\\"hasOwnProperty\\",\\"isPrototypeOf\\",\\"propertyIsEnumerable\\",\\"toLocaleString\\",\\"toString\\",\\"valueOf\\"].concat(\\"length\\",\\"prototype\\"),it={f:Object.getOwnPropertyNames||function(t){return function(t,e){var n,r=g(t),o=0,i=[];for(n in r)!P(q,n)&&P(r,n)&&i.push(n);for(;e.length>o;)P(r,n=e[o++])&&(~rt(i,n)||i.push(n));return i}(t,ot)}},ct={f:Object.getOwnPropertySymbols},ut=u.Reflect,at=ut&&ut.ownKeys||function(t){var e=it.f(k(t)),n=ct.f;return n?e.concat(n(t)):e},ft=function(t,e){for(var n=at(e),r=_.f,o=M.f,i=0;ia;a++)if((o?l(k(s=t[a])[0],s[1]):l(t[a]))===e)return e;return}c=u.call(t)}for(;!(s=c.next()).done;)if(It(c,l,s.value,o)===e)return e}).BREAK=e}),Ct=Et(\\"iterator\\"),Lt=!1;try{var Nt=0;({next:function(){return{done:!!Nt++}},return:function(){Lt=!0}})[Ct]=function(){return this}}catch(t){}var Dt,Rt,zt,Kt=Et(\\"species\\"),Wt=u.document,qt=Wt&&Wt.documentElement,Bt=u.location,Gt=u.setImmediate,Ut=u.clearImmediate,Ht=u.process,Vt=u.MessageChannel,Yt=u.Dispatch,Jt=0,Qt={},Xt=function(t){if(Qt.hasOwnProperty(t)){var e=Qt[t];delete Qt[t],e()}},Zt=function(t){return function(){Xt(t)}},$t=function(t){Xt(t.data)},te=function(t){u.postMessage(t+\\"\\",Bt.protocol+\\"//\\"+Bt.host)};Gt&&Ut||(Gt=function(t){for(var e=[],n=1;arguments.length>n;)e.push(arguments[n++]);return Qt[++Jt]=function(){(\\"function\\"==typeof t?t:Function(t)).apply(void 0,e)},Dt(Jt),Jt},Ut=function(t){delete Qt[t]},\\"process\\"==d(Ht)?Dt=function(t){Ht.nextTick(Zt(t))}:Yt&&Yt.now?Dt=function(t){Yt.now(Zt(t))}:Vt?(zt=(Rt=new Vt).port2,Rt.port1.onmessage=$t,Dt=Mt(zt.postMessage,zt,1)):!u.addEventListener||\\"function\\"!=typeof postMessage||u.importScripts||a(te)?Dt=\\"onreadystatechange\\"in S(\\"script\\")?function(t){qt.appendChild(S(\\"script\\")).onreadystatechange=function(){qt.removeChild(this),Xt(t)}}:function(t){setTimeout(Zt(t),0)}:(Dt=te,u.addEventListener(\\"message\\",$t,!1)));var ee,ne,re,oe,ie,ce,ue,ae={set:Gt,clear:Ut},fe=u.navigator,se=fe&&fe.userAgent||\\"\\",le=M.f,pe=ae.set,ve=u.MutationObserver||u.WebKitMutationObserver,he=u.process,de=u.Promise,ye=\\"process\\"==d(he),me=le(u,\\"queueMicrotask\\"),ge=me&&me.value;ge||(ee=function(){var t,e;for(ye&&(t=he.domain)&&t.exit();ne;){e=ne.fn,ne=ne.next;try{e()}catch(t){throw ne?oe():re=void 0,t}}re=void 0,t&&t.enter()},ye?oe=function(){he.nextTick(ee)}:ve&&!/(iphone|ipod|ipad).*applewebkit/i.test(se)?(ie=!0,ce=document.createTextNode(\\"\\"),new ve(ee).observe(ce,{characterData:!0}),oe=function(){ce.data=ie=!ie}):de&&de.resolve?(ue=de.resolve(void 0),oe=function(){ue.then(ee)}):oe=function(){pe.call(u,ee)});var be,we,je,Pe,Oe,Ee=ge||function(t){var e={fn:t,next:void 0};re&&(re.next=e),ne||(ne=e,oe()),re=e},Se=function(t){var e,n;this.promise=new t(function(t,r){if(void 0!==e||void 0!==n)throw TypeError(\\"Bad Promise constructor\\");e=t,n=r}),this.resolve=bt(e),this.reject=bt(n)},Te={f:function(t){return new Se(t)}},xe=function(t,e){if(k(t),b(e)&&e.constructor===t)return e;var n=Te.f(t);return(0,n.resolve)(e),n.promise},Me=function(t){try{return{error:!1,value:t()}}catch(t){return{error:!0,value:t}}},ke=_.f,Fe=Et(\\"toStringTag\\"),_e=u,Ie=function(t){return\\"function\\"==typeof t?t:void 0},Ae=Et(\\"species\\"),Ce=ae.set,Le=Et(\\"species\\"),Ne=Y.get,De=Y.set,Re=Y.getterFor(\\"Promise\\"),ze=u.Promise,Ke=u.TypeError,We=u.document,qe=u.process,Be=u.fetch,Ge=qe&&qe.versions,Ue=Ge&&Ge.v8||\\"\\",He=Te.f,Ve=He,Ye=\\"process\\"==d(qe),Je=!!(We&&We.createEvent&&u.dispatchEvent),Qe=yt(\\"Promise\\",function(){var t=ze.resolve(1),e=function(){},n=(t.constructor={})[Le]=function(t){t(e,e)};return!((Ye||\\"function\\"==typeof PromiseRejectionEvent)&&t.then(e)instanceof n&&0!==Ue.indexOf(\\"6.6\\")&&-1===se.indexOf(\\"Chrome/66\\"))}),Xe=Qe||!function(t,e){if(!Lt)return!1;var n=!1;try{var r={};r[Ct]=function(){return{next:function(){return{done:n=!0}}}},ze.all(r).catch(function(){})}catch(t){}return n}(),Ze=function(t){var e;return!(!b(t)||\\"function\\"!=typeof(e=t.then))&&e},$e=function(t,e,n){if(!e.notified){e.notified=!0;var r=e.reactions;Ee(function(){for(var o=e.value,i=1==e.state,c=0,u=function(n){var r,c,u,a=i?n.ok:n.fail,f=n.resolve,s=n.reject,l=n.domain;try{a?(i||(2===e.rejection&&rn(t,e),e.rejection=1),!0===a?r=o:(l&&l.enter(),r=a(o),l&&(l.exit(),u=!0)),r===n.promise?s(Ke(\\"Promise-chain cycle\\")):(c=Ze(r))?c.call(r,f,s):f(r)):s(o)}catch(t){l&&!u&&l.exit(),s(t)}};r.length>c;)u(r[c++]);e.reactions=[],e.notified=!1,n&&!e.rejection&&en(t,e)})}},tn=function(t,e,n){var r,o;Je?((r=We.createEvent(\\"Event\\")).promise=e,r.reason=n,r.initEvent(t,!1,!0),u.dispatchEvent(r)):r={promise:e,reason:n},(o=u[\\"on\\"+t])?o(r):\\"unhandledrejection\\"===t&&function(t,e){var n=u.console;n&&n.error&&(1===arguments.length?n.error(t):n.error(t,e))}(\\"Unhandled promise rejection\\",n)},en=function(t,e){Ce.call(u,function(){var n,r=e.value;if(nn(e)&&(n=Me(function(){Ye?qe.emit(\\"unhandledRejection\\",r,t):tn(\\"unhandledrejection\\",t,r)}),e.rejection=Ye||nn(e)?2:1,n.error))throw n.value})},nn=function(t){return 1!==t.rejection&&!t.parent},rn=function(t,e){Ce.call(u,function(){Ye?qe.emit(\\"rejectionHandled\\",t):tn(\\"rejectionhandled\\",t,e.value)})},on=function(t,e,n,r){return function(o){t(e,n,o,r)}},cn=function(t,e,n,r){e.done||(e.done=!0,r&&(e=r),e.value=n,e.state=2,$e(t,e,!0))},un=function t(e,n,r,o){if(!n.done){n.done=!0,o&&(n=o);try{if(e===r)throw Ke(\\"Promise can't be resolved itself\\");var i=Ze(r);i?Ee(function(){var o={done:!1};try{i.call(r,on(t,e,o,n),on(cn,e,o,n))}catch(t){cn(e,o,t,n)}}):(n.value=r,n.state=1,$e(e,n,!1))}catch(t){cn(e,{done:!1},t,n)}}};Qe&&(ze=function(t){!function(t,e,n){if(!(t instanceof ze))throw TypeError(\\"Incorrect Promise invocation\\")}(this),bt(t),be.call(this);var e=Ne(this);try{t(on(un,this,e),on(cn,this,e))}catch(t){cn(this,e,t)}},(be=function(t){De(this,{type:\\"Promise\\",done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=function(t,e,n){for(var r in e)J(t,r,e[r],void 0);return t}(ze.prototype,{then:function(t,e){var n,r,o,i=Re(this),c=He((n=ze,void 0===(o=k(this).constructor)||null==(r=k(o)[Kt])?n:bt(r)));return c.ok=\\"function\\"!=typeof t||t,c.fail=\\"function\\"==typeof e&&e,c.domain=Ye?qe.domain:void 0,i.parent=!0,i.reactions.push(c),0!=i.state&&$e(this,i,!1),c.promise},catch:function(t){return this.then(void 0,t)}}),we=function(){var t=new be,e=Ne(t);this.promise=t,this.resolve=on(un,t,e),this.reject=on(cn,t,e)},Te.f=He=function(t){return t===ze||t===je?new we(t):Ve(t)},\\"function\\"==typeof Be&>({global:!0,enumerable:!0,forced:!0},{fetch:function(t){return xe(ze,Be.apply(u,arguments))}})),gt({global:!0,wrap:!0,forced:Qe},{Promise:ze}),(Pe=ze)&&!P(Pe=Pe.prototype,Fe)&&ke(Pe,Fe,{configurable:!0,value:\\"Promise\\"}),Oe=function(t,e){return arguments.length<2?Ie(_e[t])||Ie(u[t]):_e[t]&&_e[t][e]||u[t]&&u[t][e]}(\\"Promise\\"),f&&Oe&&!Oe[Ae]&&(0,_.f)(Oe,Ae,{configurable:!0,get:function(){return this}}),je=_e.Promise,gt({target:\\"Promise\\",stat:!0,forced:Qe},{reject:function(t){var e=He(this);return e.reject.call(void 0,t),e.promise}}),gt({target:\\"Promise\\",stat:!0,forced:Qe},{resolve:function(t){return xe(this,t)}}),gt({target:\\"Promise\\",stat:!0,forced:Xe},{all:function(t){var e=this,n=He(e),r=n.resolve,o=n.reject,i=Me(function(){var n=bt(e.resolve),i=[],c=0,u=1;At(t,function(t){var a=c++,f=!1;i.push(void 0),u++,n.call(e,t).then(function(t){f||(f=!0,i[a]=t,--u||r(i))},o)}),--u||r(i)});return i.error&&o(i.value),n.promise},race:function(t){var e=this,n=He(e),r=n.reject,o=Me(function(){var o=bt(e.resolve);At(t,function(t){o.call(e,t).then(n.resolve,r)})});return o.error&&r(o.value),n.promise}});class an{constructor(){var t;t=[\\"foo\\",\\"bar\\"],\\"myFields\\"in this?Object.defineProperty(this,\\"myFields\\",{value:t,enumerable:!0,configurable:!0,writable:!0}):this.myFields=t}foo(){try{return this.myFields.find(t=>\\"bar\\"===t)}catch(t){return Promise.reject(t)}}}export{an as MyClass}; +"var t=\\"undefined\\"!=typeof globalThis?globalThis:\\"undefined\\"!=typeof window?window:\\"undefined\\"!=typeof global?global:\\"undefined\\"!=typeof self?self:{};function n(t,n){return t(n={exports:{}},n.exports),n.exports}var e,r,o,i=\\"object\\",c=function(t){return t&&t.Math==Math&&t},u=c(typeof globalThis==i&&globalThis)||c(typeof window==i&&window)||c(typeof self==i&&self)||c(typeof t==i&&t)||Function(\\"return this\\")(),a=function(t){try{return!!t()}catch(t){return!0}},f=!a(function(){return 7!=Object.defineProperty({},\\"a\\",{get:function(){return 7}}).a}),s={}.propertyIsEnumerable,l=Object.getOwnPropertyDescriptor,p={f:l&&!s.call({1:2},1)?function(t){var n=l(this,t);return!!n&&n.enumerable}:s},v=function(t,n){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:n}},h={}.toString,d=function(t){return h.call(t).slice(8,-1)},y=\\"\\".split,m=a(function(){return!Object(\\"z\\").propertyIsEnumerable(0)})?function(t){return\\"String\\"==d(t)?y.call(t,\\"\\"):Object(t)}:Object,g=function(t){return m(function(t){if(null==t)throw TypeError(\\"Can't call method on \\"+t);return t}(t))},b=function(t){return\\"object\\"==typeof t?null!==t:\\"function\\"==typeof t},w=function(t,n){if(!b(t))return t;var e,r;if(n&&\\"function\\"==typeof(e=t.toString)&&!b(r=e.call(t)))return r;if(\\"function\\"==typeof(e=t.valueOf)&&!b(r=e.call(t)))return r;if(!n&&\\"function\\"==typeof(e=t.toString)&&!b(r=e.call(t)))return r;throw TypeError(\\"Can't convert object to primitive value\\")},j={}.hasOwnProperty,P=function(t,n){return j.call(t,n)},O=u.document,E=b(O)&&b(O.createElement),S=function(t){return E?O.createElement(t):{}},T=!f&&!a(function(){return 7!=Object.defineProperty(S(\\"div\\"),\\"a\\",{get:function(){return 7}}).a}),x=Object.getOwnPropertyDescriptor,M={f:f?x:function(t,n){if(t=g(t),n=w(n,!0),T)try{return x(t,n)}catch(t){}if(P(t,n))return v(!p.f.call(t,n),t[n])}},k=function(t){if(!b(t))throw TypeError(String(t)+\\" is not an object\\");return t},_=Object.defineProperty,A={f:f?_:function(t,n,e){if(k(t),n=w(n,!0),k(e),T)try{return _(t,n,e)}catch(t){}if(\\"get\\"in e||\\"set\\"in e)throw TypeError(\\"Accessors not supported\\");return\\"value\\"in e&&(t[n]=e.value),t}},F=f?function(t,n,e){return A.f(t,n,v(1,e))}:function(t,n,e){return t[n]=e,t},I=function(t,n){try{F(u,t,n)}catch(e){u[t]=n}return n},C=n(function(t){var n=u[\\"__core-js_shared__\\"]||I(\\"__core-js_shared__\\",{});(t.exports=function(t,e){return n[t]||(n[t]=void 0!==e?e:{})})(\\"versions\\",[]).push({version:\\"3.1.3\\",mode:\\"global\\",copyright:\\"© 2019 Denis Pushkarev (zloirock.ru)\\"})}),L=C(\\"native-function-to-string\\",Function.toString),N=u.WeakMap,D=\\"function\\"==typeof N&&/native code/.test(L.call(N)),R=0,z=Math.random(),K=function(t){return\\"Symbol(\\".concat(void 0===t?\\"\\":t,\\")_\\",(++R+z).toString(36))},W=C(\\"keys\\"),q={};if(D){var B=new(0,u.WeakMap),G=B.get,U=B.has,H=B.set;e=function(t,n){return H.call(B,t,n),n},r=function(t){return G.call(B,t)||{}},o=function(t){return U.call(B,t)}}else{var V=W.state||(W.state=K(\\"state\\"));q[V]=!0,e=function(t,n){return F(t,V,n),n},r=function(t){return P(t,V)?t[V]:{}},o=function(t){return P(t,V)}}var Y={set:e,get:r,has:o,enforce:function(t){return o(t)?r(t):e(t,{})},getterFor:function(t){return function(n){var e;if(!b(n)||(e=r(n)).type!==t)throw TypeError(\\"Incompatible receiver, \\"+t+\\" required\\");return e}}},J=n(function(t){var n=Y.get,e=Y.enforce,r=String(L).split(\\"toString\\");C(\\"inspectSource\\",function(t){return L.call(t)}),(t.exports=function(t,n,o,i){var c=!!i&&!!i.unsafe,a=!!i&&!!i.enumerable,f=!!i&&!!i.noTargetGet;\\"function\\"==typeof o&&(\\"string\\"!=typeof n||P(o,\\"name\\")||F(o,\\"name\\",n),e(o).source=r.join(\\"string\\"==typeof n?n:\\"\\")),t!==u?(c?!f&&t[n]&&(a=!0):delete t[n],a?t[n]=o:F(t,n,o)):a?t[n]=o:I(n,o)})(Function.prototype,\\"toString\\",function(){return\\"function\\"==typeof this&&n(this).source||L.call(this)})}),Q=Math.ceil,X=Math.floor,Z=function(t){return isNaN(t=+t)?0:(t>0?X:Q)(t)},$=Math.min,tt=function(t){return t>0?$(Z(t),9007199254740991):0},nt=Math.max,et=Math.min,rt=function(t,n,e){for(var r=g(t),o=tt(r.length),i=function(t,n){var r=Z(e);return r<0?nt(r+n,0):et(r,n)}(0,o);o>i;i++)if(i in r&&r[i]===n)return i||0;return-1},ot=[\\"constructor\\",\\"hasOwnProperty\\",\\"isPrototypeOf\\",\\"propertyIsEnumerable\\",\\"toLocaleString\\",\\"toString\\",\\"valueOf\\"].concat(\\"length\\",\\"prototype\\"),it={f:Object.getOwnPropertyNames||function(t){return function(t,n){var e,r=g(t),o=0,i=[];for(e in r)!P(q,e)&&P(r,e)&&i.push(e);for(;n.length>o;)P(r,e=n[o++])&&(~rt(i,e)||i.push(e));return i}(t,ot)}},ct={f:Object.getOwnPropertySymbols},ut=u.Reflect,at=ut&&ut.ownKeys||function(t){var n=it.f(k(t)),e=ct.f;return e?n.concat(e(t)):n},ft=function(t,n){for(var e=at(n),r=A.f,o=M.f,i=0;ia;a++)if((o?l(k(s=t[a])[0],s[1]):l(t[a]))===n)return n;return}c=u.call(t)}for(;!(s=c.next()).done;)if(Dt(c,l,s.value,o)===n)return n}).BREAK=n}),zt=Ot(\\"iterator\\"),Kt=!1;try{var Wt=0,qt={next:function(){return{done:!!Wt++}},return:function(){Kt=!0}};qt[zt]=function(){return this},Array.from(qt,function(){throw 2})}catch(t){}var Bt,Gt,Ut,Ht=Ot(\\"species\\"),Vt=u.document,Yt=Vt&&Vt.documentElement,Jt=u.location,Qt=u.setImmediate,Xt=u.clearImmediate,Zt=u.process,$t=u.MessageChannel,tn=u.Dispatch,nn=0,en={},rn=function(t){if(en.hasOwnProperty(t)){var n=en[t];delete en[t],n()}},on=function(t){return function(){rn(t)}},cn=function(t){rn(t.data)},un=function(t){u.postMessage(t+\\"\\",Jt.protocol+\\"//\\"+Jt.host)};Qt&&Xt||(Qt=function(t){for(var n=[],e=1;arguments.length>e;)n.push(arguments[e++]);return en[++nn]=function(){(\\"function\\"==typeof t?t:Function(t)).apply(void 0,n)},Bt(nn),nn},Xt=function(t){delete en[t]},\\"process\\"==d(Zt)?Bt=function(t){Zt.nextTick(on(t))}:tn&&tn.now?Bt=function(t){tn.now(on(t))}:$t?(Ut=(Gt=new $t).port2,Gt.port1.onmessage=cn,Bt=It(Ut.postMessage,Ut,1)):!u.addEventListener||\\"function\\"!=typeof postMessage||u.importScripts||a(un)?Bt=\\"onreadystatechange\\"in S(\\"script\\")?function(t){Yt.appendChild(S(\\"script\\")).onreadystatechange=function(){Yt.removeChild(this),rn(t)}}:function(t){setTimeout(on(t),0)}:(Bt=un,u.addEventListener(\\"message\\",cn,!1)));var an,fn,sn,ln,pn,vn,hn,dn={set:Qt,clear:Xt},yn=u.navigator,mn=yn&&yn.userAgent||\\"\\",gn=M.f,bn=dn.set,wn=u.MutationObserver||u.WebKitMutationObserver,jn=u.process,Pn=u.Promise,On=\\"process\\"==d(jn),En=gn(u,\\"queueMicrotask\\"),Sn=En&&En.value;Sn||(an=function(){var t,n;for(On&&(t=jn.domain)&&t.exit();fn;){n=fn.fn,fn=fn.next;try{n()}catch(t){throw fn?ln():sn=void 0,t}}sn=void 0,t&&t.enter()},On?ln=function(){jn.nextTick(an)}:wn&&!/(iphone|ipod|ipad).*applewebkit/i.test(mn)?(pn=!0,vn=document.createTextNode(\\"\\"),new wn(an).observe(vn,{characterData:!0}),ln=function(){vn.data=pn=!pn}):Pn&&Pn.resolve?(hn=Pn.resolve(void 0),ln=function(){hn.then(an)}):ln=function(){bn.call(u,an)});var Tn,xn,Mn,kn,_n,An=Sn||function(t){var n={fn:t,next:void 0};sn&&(sn.next=n),fn||(fn=n,ln()),sn=n},Fn=function(t){var n,e;this.promise=new t(function(t,r){if(void 0!==n||void 0!==e)throw TypeError(\\"Bad Promise constructor\\");n=t,e=r}),this.resolve=Mt(n),this.reject=Mt(e)},In={f:function(t){return new Fn(t)}},Cn=function(t,n){if(k(t),b(n)&&n.constructor===t)return n;var e=In.f(t);return(0,e.resolve)(n),e.promise},Ln=function(t){try{return{error:!1,value:t()}}catch(t){return{error:!0,value:t}}},Nn=dn.set,Dn=Ot(\\"species\\"),Rn=Y.get,zn=Y.set,Kn=Y.getterFor(\\"Promise\\"),Wn=u.Promise,qn=u.TypeError,Bn=u.document,Gn=u.process,Un=u.fetch,Hn=Gn&&Gn.versions,Vn=Hn&&Hn.v8||\\"\\",Yn=In.f,Jn=Yn,Qn=\\"process\\"==d(Gn),Xn=!!(Bn&&Bn.createEvent&&u.dispatchEvent),Zn=yt(\\"Promise\\",function(){var t=Wn.resolve(1),n=function(){},e=(t.constructor={})[Dn]=function(t){t(n,n)};return!((Qn||\\"function\\"==typeof PromiseRejectionEvent)&&t.then(n)instanceof e&&0!==Vn.indexOf(\\"6.6\\")&&-1===mn.indexOf(\\"Chrome/66\\"))}),$n=Zn||!function(t,n){if(!Kt)return!1;var e=!1;try{var r={};r[zt]=function(){return{next:function(){return{done:e=!0}}}},Wn.all(r).catch(function(){})}catch(t){}return e}(),te=function(t){var n;return!(!b(t)||\\"function\\"!=typeof(n=t.then))&&n},ne=function(t,n,e){if(!n.notified){n.notified=!0;var r=n.reactions;An(function(){for(var o=n.value,i=1==n.state,c=0,u=function(e){var r,c,u,a=i?e.ok:e.fail,f=e.resolve,s=e.reject,l=e.domain;try{a?(i||(2===n.rejection&&ie(t,n),n.rejection=1),!0===a?r=o:(l&&l.enter(),r=a(o),l&&(l.exit(),u=!0)),r===e.promise?s(qn(\\"Promise-chain cycle\\")):(c=te(r))?c.call(r,f,s):f(r)):s(o)}catch(t){l&&!u&&l.exit(),s(t)}};r.length>c;)u(r[c++]);n.reactions=[],n.notified=!1,e&&!n.rejection&&re(t,n)})}},ee=function(t,n,e){var r,o;Xn?((r=Bn.createEvent(\\"Event\\")).promise=n,r.reason=e,r.initEvent(t,!1,!0),u.dispatchEvent(r)):r={promise:n,reason:e},(o=u[\\"on\\"+t])?o(r):\\"unhandledrejection\\"===t&&function(t,n){var e=u.console;e&&e.error&&(1===arguments.length?e.error(t):e.error(t,n))}(\\"Unhandled promise rejection\\",e)},re=function(t,n){Nn.call(u,function(){var e,r=n.value;if(oe(n)&&(e=Ln(function(){Qn?Gn.emit(\\"unhandledRejection\\",r,t):ee(\\"unhandledrejection\\",t,r)}),n.rejection=Qn||oe(n)?2:1,e.error))throw e.value})},oe=function(t){return 1!==t.rejection&&!t.parent},ie=function(t,n){Nn.call(u,function(){Qn?Gn.emit(\\"rejectionHandled\\",t):ee(\\"rejectionhandled\\",t,n.value)})},ce=function(t,n,e,r){return function(o){t(n,e,o,r)}},ue=function(t,n,e,r){n.done||(n.done=!0,r&&(n=r),n.value=e,n.state=2,ne(t,n,!0))},ae=function t(n,e,r,o){if(!e.done){e.done=!0,o&&(e=o);try{if(n===r)throw qn(\\"Promise can't be resolved itself\\");var i=te(r);i?An(function(){var o={done:!1};try{i.call(r,ce(t,n,o,e),ce(ue,n,o,e))}catch(t){ue(n,o,t,e)}}):(e.value=r,e.state=1,ne(n,e,!1))}catch(t){ue(n,{done:!1},t,e)}}};Zn&&(Wn=function(t){!function(t,n,e){if(!(t instanceof Wn))throw TypeError(\\"Incorrect Promise invocation\\")}(this),Mt(t),Tn.call(this);var n=Rn(this);try{t(ce(ae,this,n),ce(ue,this,n))}catch(t){ue(this,n,t)}},(Tn=function(t){zn(this,{type:\\"Promise\\",done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=function(t,n,e){for(var r in n)J(t,r,n[r],void 0);return t}(Wn.prototype,{then:function(t,n){var e=Kn(this),r=Yn(function(t,n){var e,r=k(t).constructor;return void 0===r||null==(e=k(r)[Ht])?n:Mt(e)}(this,Wn));return r.ok=\\"function\\"!=typeof t||t,r.fail=\\"function\\"==typeof n&&n,r.domain=Qn?Gn.domain:void 0,e.parent=!0,e.reactions.push(r),0!=e.state&&ne(this,e,!1),r.promise},catch:function(t){return this.then(void 0,t)}}),xn=function(){var t=new Tn,n=Rn(t);this.promise=t,this.resolve=ce(ae,t,n),this.reject=ce(ue,t,n)},In.f=Yn=function(t){return t===Wn||t===Mn?new xn(t):Jn(t)},\\"function\\"==typeof Un&>({global:!0,enumerable:!0,forced:!0},{fetch:function(t){return Cn(Wn,Un.apply(u,arguments))}})),gt({global:!0,wrap:!0,forced:Zn},{Promise:Wn}),(kn=Wn)&&!P(kn=kn.prototype,St)&&Et(kn,St,{configurable:!0,value:\\"Promise\\"}),_n=function(t,n){return arguments.length<2?Tt(bt[t])||Tt(u[t]):bt[t]&&bt[t][n]||u[t]&&u[t][n]}(\\"Promise\\"),f&&_n&&!_n[xt]&&(0,A.f)(_n,xt,{configurable:!0,get:function(){return this}}),Mn=bt.Promise,gt({target:\\"Promise\\",stat:!0,forced:Zn},{reject:function(t){var n=Yn(this);return n.reject.call(void 0,t),n.promise}}),gt({target:\\"Promise\\",stat:!0,forced:Zn},{resolve:function(t){return Cn(this,t)}}),gt({target:\\"Promise\\",stat:!0,forced:$n},{all:function(t){var n=this,e=Yn(n),r=e.resolve,o=e.reject,i=Ln(function(){var e=Mt(n.resolve),i=[],c=0,u=1;Rt(t,function(t){var a=c++,f=!1;i.push(void 0),u++,e.call(n,t).then(function(t){f||(f=!0,i[a]=t,--u||r(i))},o)}),--u||r(i)});return i.error&&o(i.value),e.promise},race:function(t){var n=this,e=Yn(n),r=e.reject,o=Ln(function(){var o=Mt(n.resolve);Rt(t,function(t){o.call(n,t).then(e.resolve,r)})});return o.error&&r(o.value),e.promise}});class fe{constructor(){!function(t,n,e){n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e}(this,\\"myFields\\",[\\"foo\\",\\"bar\\"])}foo(){try{return this.myFields.find(t=>\\"bar\\"===t)}catch(t){return Promise.reject(t)}}}export{fe as MyClass}; //# sourceMappingURL=custom-babelrc.mjs.map " `; exports[`fixtures build custom-babelrc with microbundle 5`] = ` -"!function(t,e){\\"object\\"==typeof exports&&\\"undefined\\"!=typeof module?e(exports):\\"function\\"==typeof define&&define.amd?define([\\"exports\\"],e):e((t=t||self).customBabelrc={})}(this,function(t){var e=\\"undefined\\"!=typeof globalThis?globalThis:\\"undefined\\"!=typeof window?window:\\"undefined\\"!=typeof global?global:\\"undefined\\"!=typeof self?self:{};function n(t,e){return t(e={exports:{}},e.exports),e.exports}var r,o,i,c=\\"object\\",u=function(t){return t&&t.Math==Math&&t},a=u(typeof globalThis==c&&globalThis)||u(typeof window==c&&window)||u(typeof self==c&&self)||u(typeof e==c&&e)||Function(\\"return this\\")(),f=function(t){try{return!!t()}catch(t){return!0}},s=!f(function(){return 7!=Object.defineProperty({},\\"a\\",{get:function(){return 7}}).a}),l={}.propertyIsEnumerable,p=Object.getOwnPropertyDescriptor,v={f:p&&!l.call({1:2},1)?function(t){var e=p(this,t);return!!e&&e.enumerable}:l},h=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},d={}.toString,y=function(t){return d.call(t).slice(8,-1)},m=\\"\\".split,g=f(function(){return!Object(\\"z\\").propertyIsEnumerable(0)})?function(t){return\\"String\\"==y(t)?m.call(t,\\"\\"):Object(t)}:Object,b=function(t){return g(function(t){if(null==t)throw TypeError(\\"Can't call method on \\"+t);return t}(t))},w=function(t){return\\"object\\"==typeof t?null!==t:\\"function\\"==typeof t},j=function(t,e){if(!w(t))return t;var n,r;if(e&&\\"function\\"==typeof(n=t.toString)&&!w(r=n.call(t)))return r;if(\\"function\\"==typeof(n=t.valueOf)&&!w(r=n.call(t)))return r;if(!e&&\\"function\\"==typeof(n=t.toString)&&!w(r=n.call(t)))return r;throw TypeError(\\"Can't convert object to primitive value\\")},P={}.hasOwnProperty,O=function(t,e){return P.call(t,e)},E=a.document,S=w(E)&&w(E.createElement),x=function(t){return S?E.createElement(t):{}},T=!s&&!f(function(){return 7!=Object.defineProperty(x(\\"div\\"),\\"a\\",{get:function(){return 7}}).a}),M=Object.getOwnPropertyDescriptor,k={f:s?M:function(t,e){if(t=b(t),e=j(e,!0),T)try{return M(t,e)}catch(t){}if(O(t,e))return h(!v.f.call(t,e),t[e])}},F=function(t){if(!w(t))throw TypeError(String(t)+\\" is not an object\\");return t},_=Object.defineProperty,I={f:s?_:function(t,e,n){if(F(t),e=j(e,!0),F(n),T)try{return _(t,e,n)}catch(t){}if(\\"get\\"in n||\\"set\\"in n)throw TypeError(\\"Accessors not supported\\");return\\"value\\"in n&&(t[e]=n.value),t}},A=s?function(t,e,n){return I.f(t,e,h(1,n))}:function(t,e,n){return t[e]=n,t},C=function(t,e){try{A(a,t,e)}catch(n){a[t]=e}return e},L=n(function(t){var e=a[\\"__core-js_shared__\\"]||C(\\"__core-js_shared__\\",{});(t.exports=function(t,n){return e[t]||(e[t]=void 0!==n?n:{})})(\\"versions\\",[]).push({version:\\"3.1.2\\",mode:\\"global\\",copyright:\\"© 2019 Denis Pushkarev (zloirock.ru)\\"})}),N=L(\\"native-function-to-string\\",Function.toString),D=a.WeakMap,R=\\"function\\"==typeof D&&/native code/.test(N.call(D)),z=0,B=Math.random(),K=function(t){return\\"Symbol(\\".concat(void 0===t?\\"\\":t,\\")_\\",(++z+B).toString(36))},W=L(\\"keys\\"),q={};if(R){var G=new(0,a.WeakMap),U=G.get,H=G.has,V=G.set;r=function(t,e){return V.call(G,t,e),e},o=function(t){return U.call(G,t)||{}},i=function(t){return H.call(G,t)}}else{var Y=W.state||(W.state=K(\\"state\\"));q[Y]=!0,r=function(t,e){return A(t,Y,e),e},o=function(t){return O(t,Y)?t[Y]:{}},i=function(t){return O(t,Y)}}var J={set:r,get:o,has:i,enforce:function(t){return i(t)?o(t):r(t,{})},getterFor:function(t){return function(e){var n;if(!w(e)||(n=o(e)).type!==t)throw TypeError(\\"Incompatible receiver, \\"+t+\\" required\\");return n}}},Q=n(function(t){var e=J.get,n=J.enforce,r=String(N).split(\\"toString\\");L(\\"inspectSource\\",function(t){return N.call(t)}),(t.exports=function(t,e,o,i){var c=!!i&&!!i.unsafe,u=!!i&&!!i.enumerable,f=!!i&&!!i.noTargetGet;\\"function\\"==typeof o&&(\\"string\\"!=typeof e||O(o,\\"name\\")||A(o,\\"name\\",e),n(o).source=r.join(\\"string\\"==typeof e?e:\\"\\")),t!==a?(c?!f&&t[e]&&(u=!0):delete t[e],u?t[e]=o:A(t,e,o)):u?t[e]=o:C(e,o)})(Function.prototype,\\"toString\\",function(){return\\"function\\"==typeof this&&e(this).source||N.call(this)})}),X=Math.ceil,Z=Math.floor,$=function(t){return isNaN(t=+t)?0:(t>0?Z:X)(t)},tt=Math.min,et=function(t){return t>0?tt($(t),9007199254740991):0},nt=Math.max,rt=Math.min,ot=function(t,e,n){for(var r=b(t),o=et(r.length),i=function(t,e){var r=$(n);return r<0?nt(r+e,0):rt(r,e)}(0,o);o>i;i++)if(i in r&&r[i]===e)return i||0;return-1},it=[\\"constructor\\",\\"hasOwnProperty\\",\\"isPrototypeOf\\",\\"propertyIsEnumerable\\",\\"toLocaleString\\",\\"toString\\",\\"valueOf\\"].concat(\\"length\\",\\"prototype\\"),ct={f:Object.getOwnPropertyNames||function(t){return function(t,e){var n,r=b(t),o=0,i=[];for(n in r)!O(q,n)&&O(r,n)&&i.push(n);for(;e.length>o;)O(r,n=e[o++])&&(~ot(i,n)||i.push(n));return i}(t,it)}},ut={f:Object.getOwnPropertySymbols},at=a.Reflect,ft=at&&at.ownKeys||function(t){var e=ct.f(F(t)),n=ut.f;return n?e.concat(n(t)):e},st=function(t,e){for(var n=ft(e),r=I.f,o=k.f,i=0;ia;a++)if((o?l(F(s=t[a])[0],s[1]):l(t[a]))===e)return e;return}c=u.call(t)}for(;!(s=c.next()).done;)if(At(c,l,s.value,o)===e)return e}).BREAK=e}),Lt=St(\\"iterator\\"),Nt=!1;try{var Dt=0;({next:function(){return{done:!!Dt++}},return:function(){Nt=!0}})[Lt]=function(){return this}}catch(t){}var Rt,zt,Bt,Kt=St(\\"species\\"),Wt=a.document,qt=Wt&&Wt.documentElement,Gt=a.location,Ut=a.setImmediate,Ht=a.clearImmediate,Vt=a.process,Yt=a.MessageChannel,Jt=a.Dispatch,Qt=0,Xt={},Zt=function(t){if(Xt.hasOwnProperty(t)){var e=Xt[t];delete Xt[t],e()}},$t=function(t){return function(){Zt(t)}},te=function(t){Zt(t.data)},ee=function(t){a.postMessage(t+\\"\\",Gt.protocol+\\"//\\"+Gt.host)};Ut&&Ht||(Ut=function(t){for(var e=[],n=1;arguments.length>n;)e.push(arguments[n++]);return Xt[++Qt]=function(){(\\"function\\"==typeof t?t:Function(t)).apply(void 0,e)},Rt(Qt),Qt},Ht=function(t){delete Xt[t]},\\"process\\"==y(Vt)?Rt=function(t){Vt.nextTick($t(t))}:Jt&&Jt.now?Rt=function(t){Jt.now($t(t))}:Yt?(Bt=(zt=new Yt).port2,zt.port1.onmessage=te,Rt=kt(Bt.postMessage,Bt,1)):!a.addEventListener||\\"function\\"!=typeof postMessage||a.importScripts||f(ee)?Rt=\\"onreadystatechange\\"in x(\\"script\\")?function(t){qt.appendChild(x(\\"script\\")).onreadystatechange=function(){qt.removeChild(this),Zt(t)}}:function(t){setTimeout($t(t),0)}:(Rt=ee,a.addEventListener(\\"message\\",te,!1)));var ne,re,oe,ie,ce,ue,ae,fe={set:Ut,clear:Ht},se=a.navigator,le=se&&se.userAgent||\\"\\",pe=k.f,ve=fe.set,he=a.MutationObserver||a.WebKitMutationObserver,de=a.process,ye=a.Promise,me=\\"process\\"==y(de),ge=pe(a,\\"queueMicrotask\\"),be=ge&&ge.value;be||(ne=function(){var t,e;for(me&&(t=de.domain)&&t.exit();re;){e=re.fn,re=re.next;try{e()}catch(t){throw re?ie():oe=void 0,t}}oe=void 0,t&&t.enter()},me?ie=function(){de.nextTick(ne)}:he&&!/(iphone|ipod|ipad).*applewebkit/i.test(le)?(ce=!0,ue=document.createTextNode(\\"\\"),new he(ne).observe(ue,{characterData:!0}),ie=function(){ue.data=ce=!ce}):ye&&ye.resolve?(ae=ye.resolve(void 0),ie=function(){ae.then(ne)}):ie=function(){ve.call(a,ne)});var we,je,Pe,Oe,Ee,Se=be||function(t){var e={fn:t,next:void 0};oe&&(oe.next=e),re||(re=e,ie()),oe=e},xe=function(t){var e,n;this.promise=new t(function(t,r){if(void 0!==e||void 0!==n)throw TypeError(\\"Bad Promise constructor\\");e=t,n=r}),this.resolve=wt(e),this.reject=wt(n)},Te={f:function(t){return new xe(t)}},Me=function(t,e){if(F(t),w(e)&&e.constructor===t)return e;var n=Te.f(t);return(0,n.resolve)(e),n.promise},ke=function(t){try{return{error:!1,value:t()}}catch(t){return{error:!0,value:t}}},Fe=I.f,_e=St(\\"toStringTag\\"),Ie=a,Ae=function(t){return\\"function\\"==typeof t?t:void 0},Ce=St(\\"species\\"),Le=fe.set,Ne=St(\\"species\\"),De=J.get,Re=J.set,ze=J.getterFor(\\"Promise\\"),Be=a.Promise,Ke=a.TypeError,We=a.document,qe=a.process,Ge=a.fetch,Ue=qe&&qe.versions,He=Ue&&Ue.v8||\\"\\",Ve=Te.f,Ye=Ve,Je=\\"process\\"==y(qe),Qe=!!(We&&We.createEvent&&a.dispatchEvent),Xe=mt(\\"Promise\\",function(){var t=Be.resolve(1),e=function(){},n=(t.constructor={})[Ne]=function(t){t(e,e)};return!((Je||\\"function\\"==typeof PromiseRejectionEvent)&&t.then(e)instanceof n&&0!==He.indexOf(\\"6.6\\")&&-1===le.indexOf(\\"Chrome/66\\"))}),Ze=Xe||!function(t,e){if(!Nt)return!1;var n=!1;try{var r={};r[Lt]=function(){return{next:function(){return{done:n=!0}}}},Be.all(r).catch(function(){})}catch(t){}return n}(),$e=function(t){var e;return!(!w(t)||\\"function\\"!=typeof(e=t.then))&&e},tn=function(t,e,n){if(!e.notified){e.notified=!0;var r=e.reactions;Se(function(){for(var o=e.value,i=1==e.state,c=0,u=function(n){var r,c,u,a=i?n.ok:n.fail,f=n.resolve,s=n.reject,l=n.domain;try{a?(i||(2===e.rejection&&on(t,e),e.rejection=1),!0===a?r=o:(l&&l.enter(),r=a(o),l&&(l.exit(),u=!0)),r===n.promise?s(Ke(\\"Promise-chain cycle\\")):(c=$e(r))?c.call(r,f,s):f(r)):s(o)}catch(t){l&&!u&&l.exit(),s(t)}};r.length>c;)u(r[c++]);e.reactions=[],e.notified=!1,n&&!e.rejection&&nn(t,e)})}},en=function(t,e,n){var r,o;Qe?((r=We.createEvent(\\"Event\\")).promise=e,r.reason=n,r.initEvent(t,!1,!0),a.dispatchEvent(r)):r={promise:e,reason:n},(o=a[\\"on\\"+t])?o(r):\\"unhandledrejection\\"===t&&function(t,e){var n=a.console;n&&n.error&&(1===arguments.length?n.error(t):n.error(t,e))}(\\"Unhandled promise rejection\\",n)},nn=function(t,e){Le.call(a,function(){var n,r=e.value;if(rn(e)&&(n=ke(function(){Je?qe.emit(\\"unhandledRejection\\",r,t):en(\\"unhandledrejection\\",t,r)}),e.rejection=Je||rn(e)?2:1,n.error))throw n.value})},rn=function(t){return 1!==t.rejection&&!t.parent},on=function(t,e){Le.call(a,function(){Je?qe.emit(\\"rejectionHandled\\",t):en(\\"rejectionhandled\\",t,e.value)})},cn=function(t,e,n,r){return function(o){t(e,n,o,r)}},un=function(t,e,n,r){e.done||(e.done=!0,r&&(e=r),e.value=n,e.state=2,tn(t,e,!0))},an=function t(e,n,r,o){if(!n.done){n.done=!0,o&&(n=o);try{if(e===r)throw Ke(\\"Promise can't be resolved itself\\");var i=$e(r);i?Se(function(){var o={done:!1};try{i.call(r,cn(t,e,o,n),cn(un,e,o,n))}catch(t){un(e,o,t,n)}}):(n.value=r,n.state=1,tn(e,n,!1))}catch(t){un(e,{done:!1},t,n)}}};Xe&&(Be=function(t){!function(t,e,n){if(!(t instanceof Be))throw TypeError(\\"Incorrect Promise invocation\\")}(this),wt(t),we.call(this);var e=De(this);try{t(cn(an,this,e),cn(un,this,e))}catch(t){un(this,e,t)}},(we=function(t){Re(this,{type:\\"Promise\\",done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=function(t,e,n){for(var r in e)Q(t,r,e[r],void 0);return t}(Be.prototype,{then:function(t,e){var n,r,o,i=ze(this),c=Ve((n=Be,void 0===(o=F(this).constructor)||null==(r=F(o)[Kt])?n:wt(r)));return c.ok=\\"function\\"!=typeof t||t,c.fail=\\"function\\"==typeof e&&e,c.domain=Je?qe.domain:void 0,i.parent=!0,i.reactions.push(c),0!=i.state&&tn(this,i,!1),c.promise},catch:function(t){return this.then(void 0,t)}}),je=function(){var t=new we,e=De(t);this.promise=t,this.resolve=cn(an,t,e),this.reject=cn(un,t,e)},Te.f=Ve=function(t){return t===Be||t===Pe?new je(t):Ye(t)},\\"function\\"==typeof Ge&&bt({global:!0,enumerable:!0,forced:!0},{fetch:function(t){return Me(Be,Ge.apply(a,arguments))}})),bt({global:!0,wrap:!0,forced:Xe},{Promise:Be}),(Oe=Be)&&!O(Oe=Oe.prototype,_e)&&Fe(Oe,_e,{configurable:!0,value:\\"Promise\\"}),Ee=function(t,e){return arguments.length<2?Ae(Ie[t])||Ae(a[t]):Ie[t]&&Ie[t][e]||a[t]&&a[t][e]}(\\"Promise\\"),s&&Ee&&!Ee[Ce]&&(0,I.f)(Ee,Ce,{configurable:!0,get:function(){return this}}),Pe=Ie.Promise,bt({target:\\"Promise\\",stat:!0,forced:Xe},{reject:function(t){var e=Ve(this);return e.reject.call(void 0,t),e.promise}}),bt({target:\\"Promise\\",stat:!0,forced:Xe},{resolve:function(t){return Me(this,t)}}),bt({target:\\"Promise\\",stat:!0,forced:Ze},{all:function(t){var e=this,n=Ve(e),r=n.resolve,o=n.reject,i=ke(function(){var n=wt(e.resolve),i=[],c=0,u=1;Ct(t,function(t){var a=c++,f=!1;i.push(void 0),u++,n.call(e,t).then(function(t){f||(f=!0,i[a]=t,--u||r(i))},o)}),--u||r(i)});return i.error&&o(i.value),n.promise},race:function(t){var e=this,n=Ve(e),r=n.reject,o=ke(function(){var o=wt(e.resolve);Ct(t,function(t){o.call(e,t).then(n.resolve,r)})});return o.error&&r(o.value),n.promise}}),t.MyClass=class{constructor(){var t;t=[\\"foo\\",\\"bar\\"],\\"myFields\\"in this?Object.defineProperty(this,\\"myFields\\",{value:t,enumerable:!0,configurable:!0,writable:!0}):this.myFields=t}foo(){try{return this.myFields.find(t=>\\"bar\\"===t)}catch(t){return Promise.reject(t)}}}}); +"!function(t,n){\\"object\\"==typeof exports&&\\"undefined\\"!=typeof module?n(exports):\\"function\\"==typeof define&&define.amd?define([\\"exports\\"],n):n((t=t||self).customBabelrc={})}(this,function(t){var n=\\"undefined\\"!=typeof globalThis?globalThis:\\"undefined\\"!=typeof window?window:\\"undefined\\"!=typeof global?global:\\"undefined\\"!=typeof self?self:{};function e(t,n){return t(n={exports:{}},n.exports),n.exports}var r,o,i,c=\\"object\\",u=function(t){return t&&t.Math==Math&&t},f=u(typeof globalThis==c&&globalThis)||u(typeof window==c&&window)||u(typeof self==c&&self)||u(typeof n==c&&n)||Function(\\"return this\\")(),a=function(t){try{return!!t()}catch(t){return!0}},s=!a(function(){return 7!=Object.defineProperty({},\\"a\\",{get:function(){return 7}}).a}),l={}.propertyIsEnumerable,p=Object.getOwnPropertyDescriptor,v={f:p&&!l.call({1:2},1)?function(t){var n=p(this,t);return!!n&&n.enumerable}:l},h=function(t,n){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:n}},d={}.toString,y=function(t){return d.call(t).slice(8,-1)},m=\\"\\".split,g=a(function(){return!Object(\\"z\\").propertyIsEnumerable(0)})?function(t){return\\"String\\"==y(t)?m.call(t,\\"\\"):Object(t)}:Object,b=function(t){return g(function(t){if(null==t)throw TypeError(\\"Can't call method on \\"+t);return t}(t))},w=function(t){return\\"object\\"==typeof t?null!==t:\\"function\\"==typeof t},j=function(t,n){if(!w(t))return t;var e,r;if(n&&\\"function\\"==typeof(e=t.toString)&&!w(r=e.call(t)))return r;if(\\"function\\"==typeof(e=t.valueOf)&&!w(r=e.call(t)))return r;if(!n&&\\"function\\"==typeof(e=t.toString)&&!w(r=e.call(t)))return r;throw TypeError(\\"Can't convert object to primitive value\\")},P={}.hasOwnProperty,O=function(t,n){return P.call(t,n)},E=f.document,S=w(E)&&w(E.createElement),x=function(t){return S?E.createElement(t):{}},T=!s&&!a(function(){return 7!=Object.defineProperty(x(\\"div\\"),\\"a\\",{get:function(){return 7}}).a}),M=Object.getOwnPropertyDescriptor,k={f:s?M:function(t,n){if(t=b(t),n=j(n,!0),T)try{return M(t,n)}catch(t){}if(O(t,n))return h(!v.f.call(t,n),t[n])}},_=function(t){if(!w(t))throw TypeError(String(t)+\\" is not an object\\");return t},A=Object.defineProperty,F={f:s?A:function(t,n,e){if(_(t),n=j(n,!0),_(e),T)try{return A(t,n,e)}catch(t){}if(\\"get\\"in e||\\"set\\"in e)throw TypeError(\\"Accessors not supported\\");return\\"value\\"in e&&(t[n]=e.value),t}},I=s?function(t,n,e){return F.f(t,n,h(1,e))}:function(t,n,e){return t[n]=e,t},C=function(t,n){try{I(f,t,n)}catch(e){f[t]=n}return n},L=e(function(t){var n=f[\\"__core-js_shared__\\"]||C(\\"__core-js_shared__\\",{});(t.exports=function(t,e){return n[t]||(n[t]=void 0!==e?e:{})})(\\"versions\\",[]).push({version:\\"3.1.3\\",mode:\\"global\\",copyright:\\"© 2019 Denis Pushkarev (zloirock.ru)\\"})}),N=L(\\"native-function-to-string\\",Function.toString),D=f.WeakMap,R=\\"function\\"==typeof D&&/native code/.test(N.call(D)),z=0,B=Math.random(),K=function(t){return\\"Symbol(\\".concat(void 0===t?\\"\\":t,\\")_\\",(++z+B).toString(36))},W=L(\\"keys\\"),q={};if(R){var G=new(0,f.WeakMap),U=G.get,H=G.has,V=G.set;r=function(t,n){return V.call(G,t,n),n},o=function(t){return U.call(G,t)||{}},i=function(t){return H.call(G,t)}}else{var Y=W.state||(W.state=K(\\"state\\"));q[Y]=!0,r=function(t,n){return I(t,Y,n),n},o=function(t){return O(t,Y)?t[Y]:{}},i=function(t){return O(t,Y)}}var J={set:r,get:o,has:i,enforce:function(t){return i(t)?o(t):r(t,{})},getterFor:function(t){return function(n){var e;if(!w(n)||(e=o(n)).type!==t)throw TypeError(\\"Incompatible receiver, \\"+t+\\" required\\");return e}}},Q=e(function(t){var n=J.get,e=J.enforce,r=String(N).split(\\"toString\\");L(\\"inspectSource\\",function(t){return N.call(t)}),(t.exports=function(t,n,o,i){var c=!!i&&!!i.unsafe,u=!!i&&!!i.enumerable,a=!!i&&!!i.noTargetGet;\\"function\\"==typeof o&&(\\"string\\"!=typeof n||O(o,\\"name\\")||I(o,\\"name\\",n),e(o).source=r.join(\\"string\\"==typeof n?n:\\"\\")),t!==f?(c?!a&&t[n]&&(u=!0):delete t[n],u?t[n]=o:I(t,n,o)):u?t[n]=o:C(n,o)})(Function.prototype,\\"toString\\",function(){return\\"function\\"==typeof this&&n(this).source||N.call(this)})}),X=Math.ceil,Z=Math.floor,$=function(t){return isNaN(t=+t)?0:(t>0?Z:X)(t)},tt=Math.min,nt=function(t){return t>0?tt($(t),9007199254740991):0},et=Math.max,rt=Math.min,ot=function(t,n,e){for(var r=b(t),o=nt(r.length),i=function(t,n){var r=$(e);return r<0?et(r+n,0):rt(r,n)}(0,o);o>i;i++)if(i in r&&r[i]===n)return i||0;return-1},it=[\\"constructor\\",\\"hasOwnProperty\\",\\"isPrototypeOf\\",\\"propertyIsEnumerable\\",\\"toLocaleString\\",\\"toString\\",\\"valueOf\\"].concat(\\"length\\",\\"prototype\\"),ct={f:Object.getOwnPropertyNames||function(t){return function(t,n){var e,r=b(t),o=0,i=[];for(e in r)!O(q,e)&&O(r,e)&&i.push(e);for(;n.length>o;)O(r,e=n[o++])&&(~ot(i,e)||i.push(e));return i}(t,it)}},ut={f:Object.getOwnPropertySymbols},ft=f.Reflect,at=ft&&ft.ownKeys||function(t){var n=ct.f(_(t)),e=ut.f;return e?n.concat(e(t)):n},st=function(t,n){for(var e=at(n),r=F.f,o=k.f,i=0;if;f++)if((o?l(_(s=t[f])[0],s[1]):l(t[f]))===n)return n;return}c=u.call(t)}for(;!(s=c.next()).done;)if(Rt(c,l,s.value,o)===n)return n}).BREAK=n}),Bt=Et(\\"iterator\\"),Kt=!1;try{var Wt=0,qt={next:function(){return{done:!!Wt++}},return:function(){Kt=!0}};qt[Bt]=function(){return this},Array.from(qt,function(){throw 2})}catch(t){}var Gt,Ut,Ht,Vt=Et(\\"species\\"),Yt=f.document,Jt=Yt&&Yt.documentElement,Qt=f.location,Xt=f.setImmediate,Zt=f.clearImmediate,$t=f.process,tn=f.MessageChannel,nn=f.Dispatch,en=0,rn={},on=function(t){if(rn.hasOwnProperty(t)){var n=rn[t];delete rn[t],n()}},cn=function(t){return function(){on(t)}},un=function(t){on(t.data)},fn=function(t){f.postMessage(t+\\"\\",Qt.protocol+\\"//\\"+Qt.host)};Xt&&Zt||(Xt=function(t){for(var n=[],e=1;arguments.length>e;)n.push(arguments[e++]);return rn[++en]=function(){(\\"function\\"==typeof t?t:Function(t)).apply(void 0,n)},Gt(en),en},Zt=function(t){delete rn[t]},\\"process\\"==y($t)?Gt=function(t){$t.nextTick(cn(t))}:nn&&nn.now?Gt=function(t){nn.now(cn(t))}:tn?(Ht=(Ut=new tn).port2,Ut.port1.onmessage=un,Gt=Ct(Ht.postMessage,Ht,1)):!f.addEventListener||\\"function\\"!=typeof postMessage||f.importScripts||a(fn)?Gt=\\"onreadystatechange\\"in x(\\"script\\")?function(t){Jt.appendChild(x(\\"script\\")).onreadystatechange=function(){Jt.removeChild(this),on(t)}}:function(t){setTimeout(cn(t),0)}:(Gt=fn,f.addEventListener(\\"message\\",un,!1)));var an,sn,ln,pn,vn,hn,dn,yn={set:Xt,clear:Zt},mn=f.navigator,gn=mn&&mn.userAgent||\\"\\",bn=k.f,wn=yn.set,jn=f.MutationObserver||f.WebKitMutationObserver,Pn=f.process,On=f.Promise,En=\\"process\\"==y(Pn),Sn=bn(f,\\"queueMicrotask\\"),xn=Sn&&Sn.value;xn||(an=function(){var t,n;for(En&&(t=Pn.domain)&&t.exit();sn;){n=sn.fn,sn=sn.next;try{n()}catch(t){throw sn?pn():ln=void 0,t}}ln=void 0,t&&t.enter()},En?pn=function(){Pn.nextTick(an)}:jn&&!/(iphone|ipod|ipad).*applewebkit/i.test(gn)?(vn=!0,hn=document.createTextNode(\\"\\"),new jn(an).observe(hn,{characterData:!0}),pn=function(){hn.data=vn=!vn}):On&&On.resolve?(dn=On.resolve(void 0),pn=function(){dn.then(an)}):pn=function(){wn.call(f,an)});var Tn,Mn,kn,_n,An,Fn=xn||function(t){var n={fn:t,next:void 0};ln&&(ln.next=n),sn||(sn=n,pn()),ln=n},In=function(t){var n,e;this.promise=new t(function(t,r){if(void 0!==n||void 0!==e)throw TypeError(\\"Bad Promise constructor\\");n=t,e=r}),this.resolve=kt(n),this.reject=kt(e)},Cn={f:function(t){return new In(t)}},Ln=function(t,n){if(_(t),w(n)&&n.constructor===t)return n;var e=Cn.f(t);return(0,e.resolve)(n),e.promise},Nn=function(t){try{return{error:!1,value:t()}}catch(t){return{error:!0,value:t}}},Dn=yn.set,Rn=Et(\\"species\\"),zn=J.get,Bn=J.set,Kn=J.getterFor(\\"Promise\\"),Wn=f.Promise,qn=f.TypeError,Gn=f.document,Un=f.process,Hn=f.fetch,Vn=Un&&Un.versions,Yn=Vn&&Vn.v8||\\"\\",Jn=Cn.f,Qn=Jn,Xn=\\"process\\"==y(Un),Zn=!!(Gn&&Gn.createEvent&&f.dispatchEvent),$n=mt(\\"Promise\\",function(){var t=Wn.resolve(1),n=function(){},e=(t.constructor={})[Rn]=function(t){t(n,n)};return!((Xn||\\"function\\"==typeof PromiseRejectionEvent)&&t.then(n)instanceof e&&0!==Yn.indexOf(\\"6.6\\")&&-1===gn.indexOf(\\"Chrome/66\\"))}),te=$n||!function(t,n){if(!Kt)return!1;var e=!1;try{var r={};r[Bt]=function(){return{next:function(){return{done:e=!0}}}},Wn.all(r).catch(function(){})}catch(t){}return e}(),ne=function(t){var n;return!(!w(t)||\\"function\\"!=typeof(n=t.then))&&n},ee=function(t,n,e){if(!n.notified){n.notified=!0;var r=n.reactions;Fn(function(){for(var o=n.value,i=1==n.state,c=0,u=function(e){var r,c,u,f=i?e.ok:e.fail,a=e.resolve,s=e.reject,l=e.domain;try{f?(i||(2===n.rejection&&ce(t,n),n.rejection=1),!0===f?r=o:(l&&l.enter(),r=f(o),l&&(l.exit(),u=!0)),r===e.promise?s(qn(\\"Promise-chain cycle\\")):(c=ne(r))?c.call(r,a,s):a(r)):s(o)}catch(t){l&&!u&&l.exit(),s(t)}};r.length>c;)u(r[c++]);n.reactions=[],n.notified=!1,e&&!n.rejection&&oe(t,n)})}},re=function(t,n,e){var r,o;Zn?((r=Gn.createEvent(\\"Event\\")).promise=n,r.reason=e,r.initEvent(t,!1,!0),f.dispatchEvent(r)):r={promise:n,reason:e},(o=f[\\"on\\"+t])?o(r):\\"unhandledrejection\\"===t&&function(t,n){var e=f.console;e&&e.error&&(1===arguments.length?e.error(t):e.error(t,n))}(\\"Unhandled promise rejection\\",e)},oe=function(t,n){Dn.call(f,function(){var e,r=n.value;if(ie(n)&&(e=Nn(function(){Xn?Un.emit(\\"unhandledRejection\\",r,t):re(\\"unhandledrejection\\",t,r)}),n.rejection=Xn||ie(n)?2:1,e.error))throw e.value})},ie=function(t){return 1!==t.rejection&&!t.parent},ce=function(t,n){Dn.call(f,function(){Xn?Un.emit(\\"rejectionHandled\\",t):re(\\"rejectionhandled\\",t,n.value)})},ue=function(t,n,e,r){return function(o){t(n,e,o,r)}},fe=function(t,n,e,r){n.done||(n.done=!0,r&&(n=r),n.value=e,n.state=2,ee(t,n,!0))},ae=function t(n,e,r,o){if(!e.done){e.done=!0,o&&(e=o);try{if(n===r)throw qn(\\"Promise can't be resolved itself\\");var i=ne(r);i?Fn(function(){var o={done:!1};try{i.call(r,ue(t,n,o,e),ue(fe,n,o,e))}catch(t){fe(n,o,t,e)}}):(e.value=r,e.state=1,ee(n,e,!1))}catch(t){fe(n,{done:!1},t,e)}}};$n&&(Wn=function(t){!function(t,n,e){if(!(t instanceof Wn))throw TypeError(\\"Incorrect Promise invocation\\")}(this),kt(t),Tn.call(this);var n=zn(this);try{t(ue(ae,this,n),ue(fe,this,n))}catch(t){fe(this,n,t)}},(Tn=function(t){Bn(this,{type:\\"Promise\\",done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=function(t,n,e){for(var r in n)Q(t,r,n[r],void 0);return t}(Wn.prototype,{then:function(t,n){var e=Kn(this),r=Jn(function(t,n){var e,r=_(t).constructor;return void 0===r||null==(e=_(r)[Vt])?n:kt(e)}(this,Wn));return r.ok=\\"function\\"!=typeof t||t,r.fail=\\"function\\"==typeof n&&n,r.domain=Xn?Un.domain:void 0,e.parent=!0,e.reactions.push(r),0!=e.state&&ee(this,e,!1),r.promise},catch:function(t){return this.then(void 0,t)}}),Mn=function(){var t=new Tn,n=zn(t);this.promise=t,this.resolve=ue(ae,t,n),this.reject=ue(fe,t,n)},Cn.f=Jn=function(t){return t===Wn||t===kn?new Mn(t):Qn(t)},\\"function\\"==typeof Hn&&bt({global:!0,enumerable:!0,forced:!0},{fetch:function(t){return Ln(Wn,Hn.apply(f,arguments))}})),bt({global:!0,wrap:!0,forced:$n},{Promise:Wn}),(_n=Wn)&&!O(_n=_n.prototype,xt)&&St(_n,xt,{configurable:!0,value:\\"Promise\\"}),An=function(t,n){return arguments.length<2?Tt(wt[t])||Tt(f[t]):wt[t]&&wt[t][n]||f[t]&&f[t][n]}(\\"Promise\\"),s&&An&&!An[Mt]&&(0,F.f)(An,Mt,{configurable:!0,get:function(){return this}}),kn=wt.Promise,bt({target:\\"Promise\\",stat:!0,forced:$n},{reject:function(t){var n=Jn(this);return n.reject.call(void 0,t),n.promise}}),bt({target:\\"Promise\\",stat:!0,forced:$n},{resolve:function(t){return Ln(this,t)}}),bt({target:\\"Promise\\",stat:!0,forced:te},{all:function(t){var n=this,e=Jn(n),r=e.resolve,o=e.reject,i=Nn(function(){var e=kt(n.resolve),i=[],c=0,u=1;zt(t,function(t){var f=c++,a=!1;i.push(void 0),u++,e.call(n,t).then(function(t){a||(a=!0,i[f]=t,--u||r(i))},o)}),--u||r(i)});return i.error&&o(i.value),e.promise},race:function(t){var n=this,e=Jn(n),r=e.reject,o=Nn(function(){var o=kt(n.resolve);zt(t,function(t){o.call(n,t).then(e.resolve,r)})});return o.error&&r(o.value),e.promise}}),t.MyClass=class{constructor(){!function(t,n,e){n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e}(this,\\"myFields\\",[\\"foo\\",\\"bar\\"])}foo(){try{return this.myFields.find(t=>\\"bar\\"===t)}catch(t){return Promise.reject(t)}}}}); //# sourceMappingURL=custom-babelrc.umd.js.map " `; @@ -1102,30 +1271,48 @@ esnext-ts Build \\"esnextTs\\" to dist: -878 B: esnext-ts.js.gz -786 B: esnext-ts.js.br -877 B: esnext-ts.mjs.gz -786 B: esnext-ts.mjs.br -938 B: esnext-ts.umd.js.gz -841 B: esnext-ts.umd.js.br" +1036 B: esnext-ts.js.gz +941 B: esnext-ts.js.br +1036 B: esnext-ts.mjs.gz +939 B: esnext-ts.mjs.br +1095 B: esnext-ts.umd.js.gz +1000 B: esnext-ts.umd.js.br" `; exports[`fixtures build esnext-ts with microbundle 2`] = `7`; exports[`fixtures build esnext-ts with microbundle 3`] = ` -"var n=function(){function n(){}return n.prototype.then=function(r,e){var o=new n,i=this.s;if(i){var u=1&i?r:e;if(u){try{t(o,1,u(this.v))}catch(n){t(o,2,n)}return o}return this}return this.o=function(n){try{var i=n.v;1&n.s?t(o,1,r?r(i):i):e?t(o,1,e(i)):t(o,2,i)}catch(n){t(o,2,n)}},o},n}();function t(r,e,o){if(!r.s){if(o instanceof n){if(!o.s)return void(o.o=t.bind(null,r,e));1&e&&(e=o.s),o=o.v}if(o&&o.then)return void o.then(t.bind(null,r,e),t.bind(null,r,2));r.s=e,r.v=o;var i=r.o;i&&i(r)}}function r(t){return t instanceof n&&1&t.s}var e=\\"undefined\\"!=typeof Symbol?Symbol.iterator||(Symbol.iterator=Symbol(\\"Symbol.iterator\\")):\\"@@iterator\\",o=\\"undefined\\"!=typeof Symbol?Symbol.asyncIterator||(Symbol.asyncIterator=Symbol(\\"Symbol.asyncIterator\\")):\\"@@asyncIterator\\",i=function(){try{var i=[],u=function(i,u,f){if(\\"function\\"==typeof i[o]){var c=function(n){s.next().then(a).then(void 0,h)},a=function(n){n.done?t(l,1):Promise.resolve(u(n.value)).then(c).then(void 0,h)},h=function(n){t(l,2,s.return?s.return().then(function(){return n}):n)},l=new n,s=i[asyncIteratorSymbol]();return s.next().then(a).then(void 0,h),l}return Promise.resolve(function(o,i,u){if(\\"function\\"==typeof o[e]){var f,c,a,h=o[e]();if(function e(o){try{for(;!(f=h.next()).done;)if((o=i(f.value))&&o.then){if(!r(o))return void o.then(e,a||(a=t.bind(null,c=new n,2)));o=o.v}c?t(c,1,o):c=o}catch(n){t(c||(c=new Pact),2,n)}}(),h.return){var l=function(n){try{f.done||h.return()}catch(n){}return n};if(c&&c.then)return c.then(l,function(n){throw l(n)});l()}return c}if(!(\\"length\\"in o))throw new TypeError(\\"Object is not iterable\\");for(var s=[],v=0;v2?e-2:0),l=2;l2?e-2:0),l=2;l2?e-2:0),l=2;l2?e-2:0),l=2;l2?t-2:0),o=2;o2?t-2:0),o=2;o; +" +`; + +exports[`fixtures build jsx with microbundle 7`] = ` +"Used script: microbundle + +Directory tree: + +jsx + dist + jsx.js + jsx.js.map + jsx.mjs + jsx.mjs.map + jsx.umd.js + jsx.umd.js.map + index.js + package.json + + +Build \\"jsx\\" to dist: +268 B: jsx.js.gz +222 B: jsx.js.br +268 B: jsx.mjs.gz +223 B: jsx.mjs.br +343 B: jsx.umd.js.gz +288 B: jsx.umd.js.br" +`; + +exports[`fixtures build jsx with microbundle 8`] = `6`; + +exports[`fixtures build jsx with microbundle 9`] = ` +"var n=function(n,r){for(var e=arguments.length,t=new Array(e>2?e-2:0),l=2;l2?e-2:0),l=2;l2?t-2:0),o=2;o total + value, 0); +} diff --git a/test/fixtures/basic-no-compress/package.json b/test/fixtures/basic-no-compress/package.json index a233732..87f5c95 100644 --- a/test/fixtures/basic-no-compress/package.json +++ b/test/fixtures/basic-no-compress/package.json @@ -1,6 +1,6 @@ { "name": "basic-no-compress", "scripts": { - "build": "microbundle --compress=false" + "build": "microbundle --no-compress" } } From f0e56e2cba66559124872719fb1535d815438377 Mon Sep 17 00:00:00 2001 From: Leah Date: Fri, 7 Jun 2019 19:23:05 +0200 Subject: [PATCH 07/13] fix typescript async --- babel.config.js | 1 + src/lib/babel-custom.js | 11 +++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/babel.config.js b/babel.config.js index 7119f5d..d3922a5 100644 --- a/babel.config.js +++ b/babel.config.js @@ -8,6 +8,7 @@ module.exports = { targets: { node: 'current', }, + exclude: ['transform-async-to-generator', 'transform-regenerator'], }, ], ], diff --git a/src/lib/babel-custom.js b/src/lib/babel-custom.js index 958ef93..0f0ec6b 100644 --- a/src/lib/babel-custom.js +++ b/src/lib/babel-custom.js @@ -73,6 +73,10 @@ export default babelPlugin.custom(babelCore => { name: '@babel/plugin-proposal-class-properties', loose: true, }, + { + name: '@babel/plugin-transform-regenerator', + async: false, + }, ].filter(Boolean), ); @@ -100,7 +104,10 @@ export default babelPlugin.custom(babelCore => { { modules: false, exclude: merge( - ['transform-async-to-generator'], + [ + 'transform-async-to-generator', + 'transform-regenerator', + ], preset.options.exclude || [], ), }, @@ -122,7 +129,7 @@ export default babelPlugin.custom(babelCore => { targets: customOptions.targets, modules: false, loose: true, - exclude: ['transform-async-to-generator'], + exclude: ['transform-async-to-generator', 'transform-regenerator'], }, ]); } From c0a20dbe9cb0563dc0f0ef244968fab5b03227ad Mon Sep 17 00:00:00 2001 From: Leah Date: Fri, 7 Jun 2019 19:23:18 +0200 Subject: [PATCH 08/13] updates, fixes a useless Promise.resolve --- package.json | 22 ++++---- test/__snapshots__/index.test.js.snap | 75 ++++----------------------- 2 files changed, 20 insertions(+), 77 deletions(-) diff --git a/package.json b/package.json index a4f7570..7ab9b4e 100644 --- a/package.json +++ b/package.json @@ -50,8 +50,8 @@ "@babel/polyfill": "^7.4.4", "@babel/preset-flow": "^7.0.0", "asyncro": "^3.0.0", - "autoprefixer": "^9.5.1", - "babel-plugin-transform-async-to-promises": "^0.8.11", + "autoprefixer": "^9.6.0", + "babel-plugin-transform-async-to-promises": "^0.8.12", "babel-plugin-transform-replace-expressions": "^0.2.0", "brotli-size": "^0.1.0", "camelcase": "^5.3.1", @@ -63,21 +63,21 @@ "lodash.merge": "^4.6.1", "module-details-from-path": "^1.0.3", "pretty-bytes": "^5.2.0", - "rollup": "^1.12.4", - "rollup-plugin-alias": "^1.5.1", + "rollup": "^1.15.1", + "rollup-plugin-alias": "^1.5.2", "rollup-plugin-babel": "^4.3.2", "rollup-plugin-bundle-size": "^1.0.1", "rollup-plugin-commonjs": "^10.0.0", "rollup-plugin-es3": "^1.1.0", "rollup-plugin-json": "^4.0.0", - "rollup-plugin-node-resolve": "^5.0.0", + "rollup-plugin-node-resolve": "^5.0.1", "rollup-plugin-postcss": "^2.0.3", "rollup-plugin-terser": "^5.0.0", "rollup-plugin-typescript2": "^0.21.1", - "sade": "^1.4.0", + "sade": "^1.5.0", "tiny-glob": "^0.2.6", - "tslib": "^1.9.0", - "typescript": "^3.4.5" + "tslib": "^1.10.0", + "typescript": "^3.5.1" }, "devDependencies": { "@babel/cli": "^7.4.4", @@ -95,10 +95,10 @@ "eslint-plugin-prettier": "^3.1.0", "esm": "^3.2.22", "fs-extra": "^8.0.1", - "husky": "^2.3.0", + "husky": "^2.4.0", "jest": "^24.8.0", - "lint-staged": "^8.1.7", - "prettier": "^1.17.1", + "lint-staged": "^8.2.0", + "prettier": "^1.18.2", "regenerator-runtime": "^0.13.2", "rimraf": "^2.6.3", "shell-quote": "^1.6.1", diff --git a/test/__snapshots__/index.test.js.snap b/test/__snapshots__/index.test.js.snap index 7d10954..9b7e416 100644 --- a/test/__snapshots__/index.test.js.snap +++ b/test/__snapshots__/index.test.js.snap @@ -65,30 +65,30 @@ async-iife-ts Build \\"asyncIifeTs\\" to dist: -100 B: async-iife-ts.js.gz -78 B: async-iife-ts.js.br -100 B: async-iife-ts.mjs.gz -78 B: async-iife-ts.mjs.br -142 B: async-iife-ts.umd.js.gz -105 B: async-iife-ts.umd.js.br" +70 B: async-iife-ts.js.gz +55 B: async-iife-ts.js.br +70 B: async-iife-ts.mjs.gz +55 B: async-iife-ts.mjs.br +125 B: async-iife-ts.umd.js.gz +95 B: async-iife-ts.umd.js.br" `; exports[`fixtures build async-iife-ts with microbundle 2`] = `7`; exports[`fixtures build async-iife-ts with microbundle 3`] = ` -"!function(){try{console.log(\\"foo\\"),Promise.resolve()}catch(o){return Promise.reject(o)}}(); +"try{console.log(\\"foo\\")}catch(o){Promise.reject(o)} //# sourceMappingURL=async-iife-ts.js.map " `; exports[`fixtures build async-iife-ts with microbundle 4`] = ` -"!function(){try{console.log(\\"foo\\"),Promise.resolve()}catch(o){return Promise.reject(o)}}(); +"try{console.log(\\"foo\\")}catch(o){Promise.reject(o)} //# sourceMappingURL=async-iife-ts.mjs.map " `; exports[`fixtures build async-iife-ts with microbundle 5`] = ` -"!function(e){\\"function\\"==typeof define&&define.amd?define(e):e()}(function(){!function(){try{console.log(\\"foo\\"),Promise.resolve()}catch(e){return Promise.reject(e)}}()}); +"!function(e){\\"function\\"==typeof define&&define.amd?define(e):e()}(function(){try{console.log(\\"foo\\")}catch(e){Promise.reject(e)}}); //# sourceMappingURL=async-iife-ts.umd.js.map " `; @@ -1374,63 +1374,6 @@ return function(){function t(){}return t.prototype.render=function(){return n(\\ " `; -exports[`fixtures build jsx with microbundle 6`] = ` -"export default function foo(): Promise; -" -`; - -exports[`fixtures build jsx with microbundle 7`] = ` -"Used script: microbundle - -Directory tree: - -jsx - dist - jsx.js - jsx.js.map - jsx.mjs - jsx.mjs.map - jsx.umd.js - jsx.umd.js.map - index.js - package.json - - -Build \\"jsx\\" to dist: -268 B: jsx.js.gz -222 B: jsx.js.br -268 B: jsx.mjs.gz -223 B: jsx.mjs.br -343 B: jsx.umd.js.gz -288 B: jsx.umd.js.br" -`; - -exports[`fixtures build jsx with microbundle 8`] = `6`; - -exports[`fixtures build jsx with microbundle 9`] = ` -"var n=function(n,r){for(var e=arguments.length,t=new Array(e>2?e-2:0),l=2;l2?e-2:0),l=2;l2?t-2:0),o=2;o Date: Mon, 10 Dec 2018 18:04:15 +0100 Subject: [PATCH 09/13] feat: add support for Babel macros --- package.json | 1 + src/lib/babel-custom.js | 3 +++ 2 files changed, 4 insertions(+) diff --git a/package.json b/package.json index 7ab9b4e..a762d71 100644 --- a/package.json +++ b/package.json @@ -51,6 +51,7 @@ "@babel/preset-flow": "^7.0.0", "asyncro": "^3.0.0", "autoprefixer": "^9.6.0", + "babel-plugin-macros": "^2.4.2", "babel-plugin-transform-async-to-promises": "^0.8.12", "babel-plugin-transform-replace-expressions": "^0.2.0", "brotli-size": "^0.1.0", diff --git a/src/lib/babel-custom.js b/src/lib/babel-custom.js index 0f0ec6b..81ab746 100644 --- a/src/lib/babel-custom.js +++ b/src/lib/babel-custom.js @@ -77,6 +77,9 @@ export default babelPlugin.custom(babelCore => { name: '@babel/plugin-transform-regenerator', async: false, }, + { + name: 'babel-plugin-macros', + }, ].filter(Boolean), ); From 83907055825942d1630dd5d257fca48521f7dc74 Mon Sep 17 00:00:00 2001 From: Federico Zivolo Date: Fri, 4 Jan 2019 14:29:11 +0100 Subject: [PATCH 10/13] test: sample macro test --- test/__snapshots__/index.test.js.snap | 48 +++++++++++++++++++++++++++ test/fixtures/macro/package.json | 3 ++ test/fixtures/macro/src/index.js | 5 +++ test/fixtures/macro/src/macro.js | 20 +++++++++++ 4 files changed, 76 insertions(+) create mode 100644 test/fixtures/macro/package.json create mode 100644 test/fixtures/macro/src/index.js create mode 100644 test/fixtures/macro/src/macro.js diff --git a/test/__snapshots__/index.test.js.snap b/test/__snapshots__/index.test.js.snap index 9b7e416..4a7a6ac 100644 --- a/test/__snapshots__/index.test.js.snap +++ b/test/__snapshots__/index.test.js.snap @@ -1374,6 +1374,54 @@ return function(){function t(){}return t.prototype.render=function(){return n(\\ " `; +exports[`fixtures build macro with microbundle 1`] = ` +"Used script: microbundle + +Directory tree: + +macro + dist + macro-lib.js + macro-lib.js.map + macro-lib.mjs + macro-lib.mjs.map + macro-lib.umd.js + macro-lib.umd.js.map + package.json + src + index.js + macro.js + + +Build \\"macroLib\\" to dist: +49 B: macro-lib.js.gz +33 B: macro-lib.js.br +48 B: macro-lib.mjs.gz +32 B: macro-lib.mjs.br +157 B: macro-lib.umd.js.gz +125 B: macro-lib.umd.js.br" +`; + +exports[`fixtures build macro with microbundle 2`] = `6`; + +exports[`fixtures build macro with microbundle 3`] = ` +"module.exports=\\"name-macro\\"; +//# sourceMappingURL=macro-lib.js.map +" +`; + +exports[`fixtures build macro with microbundle 4`] = ` +"export default\\"name-macro\\"; +//# sourceMappingURL=macro-lib.mjs.map +" +`; + +exports[`fixtures build macro with microbundle 5`] = ` +"!function(e,n){\\"object\\"==typeof exports&&\\"undefined\\"!=typeof module?module.exports=\\"name-macro\\":\\"function\\"==typeof define&&define.amd?define(function(){return\\"name-macro\\"}):(e=e||self).macroLib=\\"name-macro\\"}(this); +//# sourceMappingURL=macro-lib.umd.js.map +" +`; + exports[`fixtures build name-custom-amd with microbundle 1`] = ` "Used script: microbundle diff --git a/test/fixtures/macro/package.json b/test/fixtures/macro/package.json new file mode 100644 index 0000000..e9df4bd --- /dev/null +++ b/test/fixtures/macro/package.json @@ -0,0 +1,3 @@ +{ + "name": "macro-lib" +} diff --git a/test/fixtures/macro/src/index.js b/test/fixtures/macro/src/index.js new file mode 100644 index 0000000..31ff4b4 --- /dev/null +++ b/test/fixtures/macro/src/index.js @@ -0,0 +1,5 @@ +import { macro } from './macro'; + +const name = macro(); + +export default name; diff --git a/test/fixtures/macro/src/macro.js b/test/fixtures/macro/src/macro.js new file mode 100644 index 0000000..77c75a7 --- /dev/null +++ b/test/fixtures/macro/src/macro.js @@ -0,0 +1,20 @@ +import { createMacro } from 'babel-plugin-macros'; + +function myMacro({ references, state, babel }) { + const { types: t } = babel; + + references.default.forEach(referencePath => { + const parentPath = referencePath.findParent(t.isCallExpression); + let variableName = referencePath.findParent(t.isVariableDeclarator).node.id + .name; + if ( + parentPath.node.arguments.length > 0 && + parentPath.node.arguments[0] !== '' + ) { + variableName = parentPath.node.arguments[0].value; + } + parentPath.replaceWith(t.stringLiteral(`${variableName}-macro`)); + }); +} + +export const macro = createMacro(myMacro); From 89d44cd051a0c17f11b75848467120ac4d90b00f Mon Sep 17 00:00:00 2001 From: Leah Date: Wed, 12 Jun 2019 00:20:01 +0200 Subject: [PATCH 11/13] fix: babel-custom was slightly to very broken --- src/lib/babel-custom.js | 68 ++++++++++-------------- test/__snapshots__/index.test.js.snap | 18 +++---- test/fixtures/basic-babelrc/src/index.js | 1 + 3 files changed, 38 insertions(+), 49 deletions(-) diff --git a/src/lib/babel-custom.js b/src/lib/babel-custom.js index 81ab746..4bd5852 100644 --- a/src/lib/babel-custom.js +++ b/src/lib/babel-custom.js @@ -83,48 +83,36 @@ export default babelPlugin.custom(babelCore => { ].filter(Boolean), ); - let babelOptions = { - presets: [], - plugins: [], - }; - if (config.hasFilesystemConfig()) { - babelOptions = config.options; + const babelOptions = config.options || {}; - if (babelOptions.presets) { - babelOptions.presets = babelOptions.presets.map(preset => { - // When preset-env is configured we want to make sure we override some settings. - // We want to make sure microbundle is still fast & creates small bundles - if (preset.file.request === '@babel/preset-env') { - preset = createConfigItem( - [ - preset.file.resolved, - merge( - { - loose: true, - targets: customOptions.targets, - }, - preset.options, - { - modules: false, - exclude: merge( - [ - 'transform-async-to-generator', - 'transform-regenerator', - ], - preset.options.exclude || [], - ), - }, - ), - ], - { - type: `preset`, - }, - ); - } + const envIdx = (babelOptions.presets || []).findIndex(preset => + preset.file.request.includes('@babel/preset-env'), + ); - return preset; - }); - } + if (envIdx !== -1) { + const preset = babelOptions.presets[envIdx]; + babelOptions.presets[envIdx] = createConfigItem( + [ + preset.file.resolved, + merge( + { + loose: true, + targets: customOptions.targets, + }, + preset.options, + { + modules: false, + exclude: merge( + ['transform-async-to-generator', 'transform-regenerator'], + preset.options.exclude || [], + ), + }, + ), + ], + { + type: `preset`, + }, + ); } else { babelOptions.presets = createConfigItems('preset', [ { diff --git a/test/__snapshots__/index.test.js.snap b/test/__snapshots__/index.test.js.snap index 4a7a6ac..6d54600 100644 --- a/test/__snapshots__/index.test.js.snap +++ b/test/__snapshots__/index.test.js.snap @@ -225,30 +225,30 @@ basic-babelrc Build \\"basicBabelrc\\" to dist: -94 B: basic-babelrc.js.gz -75 B: basic-babelrc.js.br -94 B: basic-babelrc.mjs.gz -75 B: basic-babelrc.mjs.br -139 B: basic-babelrc.umd.js.gz -102 B: basic-babelrc.umd.js.br" +122 B: basic-babelrc.js.gz +91 B: basic-babelrc.js.br +122 B: basic-babelrc.mjs.gz +91 B: basic-babelrc.mjs.br +158 B: basic-babelrc.umd.js.gz +121 B: basic-babelrc.umd.js.br" `; exports[`fixtures build basic-babelrc with microbundle 2`] = `6`; exports[`fixtures build basic-babelrc with microbundle 3`] = ` -"!function(r=function(r){throw new Error(\\"required!\\")}()){!0===r||function(r){throw new Error(\\"Falsey!\\")}()}(!0); +"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.js.map " `; exports[`fixtures build basic-babelrc with microbundle 4`] = ` -"!function(r=function(r){throw new Error(\\"required!\\")}()){!0===r||function(r){throw new Error(\\"Falsey!\\")}()}(!0); +"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.mjs.map " `; exports[`fixtures build basic-babelrc with microbundle 5`] = ` -"!function(n){\\"function\\"==typeof define&&define.amd?define(n):n()}(function(){!function(n=function(n){throw new Error(\\"required!\\")}()){!0===n||function(n){throw new Error(\\"Falsey!\\")}()}(!0)}); +"!function(n){\\"function\\"==typeof define&&define.amd?define(n):n()}(function(){function n(n){return void 0===n&&(n=function(n){throw new Error(\\"required!\\")}()),!0===n||function(n){throw new Error(\\"Falsey!\\")}()}n(!0),n(!1)}); //# sourceMappingURL=basic-babelrc.umd.js.map " `; diff --git a/test/fixtures/basic-babelrc/src/index.js b/test/fixtures/basic-babelrc/src/index.js index 6035ba9..8f463a7 100644 --- a/test/fixtures/basic-babelrc/src/index.js +++ b/test/fixtures/basic-babelrc/src/index.js @@ -3,3 +3,4 @@ function test(param = throw new Error('required!')) { } test(true); +test(false); From 042a80e34ae986c7db37737e196e25dbacadb97b Mon Sep 17 00:00:00 2001 From: Leah Date: Wed, 12 Jun 2019 00:20:20 +0200 Subject: [PATCH 12/13] fix: make the macro work --- test/fixtures/macro/src/macro.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/fixtures/macro/src/macro.js b/test/fixtures/macro/src/macro.js index 77c75a7..1af20f8 100644 --- a/test/fixtures/macro/src/macro.js +++ b/test/fixtures/macro/src/macro.js @@ -3,7 +3,7 @@ import { createMacro } from 'babel-plugin-macros'; function myMacro({ references, state, babel }) { const { types: t } = babel; - references.default.forEach(referencePath => { + references.macro.forEach(referencePath => { const parentPath = referencePath.findParent(t.isCallExpression); let variableName = referencePath.findParent(t.isVariableDeclarator).node.id .name; @@ -17,4 +17,4 @@ function myMacro({ references, state, babel }) { }); } -export const macro = createMacro(myMacro); +module.exports = createMacro(myMacro); From d32a50fb8736c93499649abab08291edf204c39e Mon Sep 17 00:00:00 2001 From: Leah Date: Wed, 12 Jun 2019 01:09:36 +0200 Subject: [PATCH 13/13] v0.12.0-next.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a762d71..5f88df7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "microbundle", - "version": "0.12.0-next.0", + "version": "0.12.0-next.1", "description": "Zero-configuration bundler for tiny JS libs, powered by Rollup.", "main": "dist/microbundle.js", "source": "src/index.js",