From 5561b695817d5be8dafb290b4fb0d6979f648d53 Mon Sep 17 00:00:00 2001 From: isidrok Date: Mon, 10 Jun 2019 21:13:54 +0200 Subject: [PATCH 01/11] test: augmentChunkHash plugin hook tests --- test/hooks/index.js | 105 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 105 insertions(+) diff --git a/test/hooks/index.js b/test/hooks/index.js index 292c75bf6b8..4a7fe83a490 100644 --- a/test/hooks/index.js +++ b/test/hooks/index.js @@ -1328,4 +1328,109 @@ module.exports = input; ]); }); }); + it('supports augmentChunkHash hook', () => { + let augmentChunkHashCalls = 0; + return rollup + .rollup({ + input: 'input', + plugins: [ + loader({ + input: `alert('hello')` + }), + { + augmentChunkHash(update) { + augmentChunkHashCalls++; + assert(this.meta); + assert(this.meta.rollupVersion); + } + } + ] + }) + .then(bundle => + bundle.generate({ + format: 'esm', + dir: 'dist', + entryFileNames: '[name]-[hash].js' + }) + ) + .then(output => { + assert.equal(augmentChunkHashCalls, 1); + }); + }); + it('augments the chunk hash when the update function is called within the augmentChunkHash hook', () => { + const inputCode = `alert('hello')`; + const outputOptions = { + format: 'esm', + dir: 'dist', + entryFileNames: '[name]-[hash].js' + }; + function bundleWithoutAugment() { + return rollup + .rollup({ + input: 'input', + plugins: [ + loader({ + input: inputCode + }) + ] + }) + .then(bundle => bundle.generate(outputOptions)) + .then(({ output }) => { + return output[0].fileName; + }); + } + function bundleWithAugment() { + return rollup + .rollup({ + input: 'input', + plugins: [ + loader({ + input: inputCode + }), + { + augmentChunkHash(update) { + update('foo'); + } + } + ] + }) + .then(bundle => bundle.generate(outputOptions)) + .then(({ output }) => { + return output[0].fileName; + }); + } + return Promise.all([bundleWithoutAugment(), bundleWithAugment()]).then(([base, augmented]) => { + assert.notEqual(base, augmented); + }); + }); + it('propagates hash updates of augmentChunkHash to all dependents', () => { + return rollup + .rollup({ + input: 'input', + plugins: [ + loader({ + input: `console.log('input');import('other');`, + other: `console.log('other');` + }), + { + augmentChunkHash(update) { + update('foo'); + } + } + ] + }) + .then(bundle => + bundle.generate({ + format: 'esm', + dir: 'dist', + entryFileNames: '[name]-[hash].js', + chunkFileNames: '[name]-[hash].js' + }) + ) + .then(({ output }) => { + const importedFileName = output[0].dynamicImports[0]; + const otherFileName = output[1].fileName; + assert.equal(otherFileName, importedFileName); + }); + }); }); From 55bbad463a5bf94c870db10a90f2f53c2f356efd Mon Sep 17 00:00:00 2001 From: isidrok Date: Mon, 10 Jun 2019 21:16:17 +0200 Subject: [PATCH 02/11] feat: augmentChunkHash plugin hook Hook to extend chunk hashes callable from within plugins in order to take in to account implicit dependencies such as plugin options or version when creating the chunk hash --- src/Chunk.ts | 5 ++--- src/rollup/types.d.ts | 1 + 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Chunk.ts b/src/Chunk.ts index 2803e1f536e..02518d6107e 100644 --- a/src/Chunk.ts +++ b/src/Chunk.ts @@ -98,9 +98,7 @@ function getGlobalName( graph.warn({ code: 'MISSING_GLOBAL_NAME', guess: module.variableName, - message: `No name was provided for external module '${ - module.id - }' in output.globals – guessing '${module.variableName}'`, + message: `No name was provided for external module '${module.id}' in output.globals – guessing '${module.variableName}'`, source: module.id }); return module.variableName; @@ -338,6 +336,7 @@ export default class Chunk { }) .join(',') ); + this.graph.pluginDriver.hookSeqSync('augmentChunkHash', [hash.update.bind(hash)]); return (this.renderedHash = hash.digest('hex')); } diff --git a/src/rollup/types.d.ts b/src/rollup/types.d.ts index e352d7be88b..2621ee0424b 100644 --- a/src/rollup/types.d.ts +++ b/src/rollup/types.d.ts @@ -276,6 +276,7 @@ interface OnWriteOptions extends OutputOptions { } export interface PluginHooks { + augmentChunkHash: (this: PluginContext, update: Function) => void; buildEnd: (this: PluginContext, err?: Error) => Promise | void; buildStart: (this: PluginContext, options: InputOptions) => Promise | void; generateBundle: ( From 16574028fbdda94e794745da55df85fa507d3774 Mon Sep 17 00:00:00 2001 From: isidrok Date: Wed, 12 Jun 2019 19:42:30 +0200 Subject: [PATCH 03/11] test: independent hashing in augmentChunkHash tests --- test/hooks/index.js | 72 +++++++++++++++++++++++++++++++++++++-------- 1 file changed, 60 insertions(+), 12 deletions(-) diff --git a/test/hooks/index.js b/test/hooks/index.js index 4a7fe83a490..c64b1f0bb9f 100644 --- a/test/hooks/index.js +++ b/test/hooks/index.js @@ -1364,6 +1364,11 @@ module.exports = input; dir: 'dist', entryFileNames: '[name]-[hash].js' }; + function getFileName(bundle) { + return bundle.generate(outputOptions).then(({ output }) => { + return output[0].fileName; + }); + } function bundleWithoutAugment() { return rollup .rollup({ @@ -1374,10 +1379,7 @@ module.exports = input; }) ] }) - .then(bundle => bundle.generate(outputOptions)) - .then(({ output }) => { - return output[0].fileName; - }); + .then(getFileName); } function bundleWithAugment() { return rollup @@ -1388,16 +1390,13 @@ module.exports = input; input: inputCode }), { - augmentChunkHash(update) { - update('foo'); + augmentChunkHash() { + return 'foo'; } } ] }) - .then(bundle => bundle.generate(outputOptions)) - .then(({ output }) => { - return output[0].fileName; - }); + .then(getFileName); } return Promise.all([bundleWithoutAugment(), bundleWithAugment()]).then(([base, augmented]) => { assert.notEqual(base, augmented); @@ -1413,8 +1412,8 @@ module.exports = input; other: `console.log('other');` }), { - augmentChunkHash(update) { - update('foo'); + augmentChunkHash() { + return Promise.resolve('foo'); } } ] @@ -1433,4 +1432,53 @@ module.exports = input; assert.equal(otherFileName, importedFileName); }); }); + it('augmentChunkHash only takes effect for chunks whose call got a return value', () => { + const outputOptions = { + format: 'esm', + dir: 'dist', + entryFileNames: '[name]-[hash].js' + }; + const input = ['input', 'other']; + const inputCode = { + input: `console.log('input');`, + other: `console.log('other');` + }; + function getFileNamesForChunks(bundle) { + return bundle.generate(outputOptions).then(({ output }) => { + return output.reduce((result, chunk) => { + result[chunk.name] = chunk.fileName; + return result; + }, {}); + }); + } + function bundleWithoutAugment() { + return rollup + .rollup({ + input, + plugins: [loader(inputCode)] + }) + .then(getFileNamesForChunks); + } + function bundleWithAugment() { + return rollup + .rollup({ + input, + plugins: [ + loader(inputCode), + { + augmentChunkHash(chunk) { + if (chunk.name === 'input') { + return 'foo'; + } + } + } + ] + }) + .then(getFileNamesForChunks); + } + return Promise.all([bundleWithoutAugment(), bundleWithAugment()]).then(([base, augmented]) => { + assert.notEqual(base.input, augmented.input); + assert.equal(base.other, augmented.other); + }); + }); }); From 49a1670a664ffd2858b9591778192089c3e29c7c Mon Sep 17 00:00:00 2001 From: isidrok Date: Wed, 12 Jun 2019 19:43:48 +0200 Subject: [PATCH 04/11] feat: pass reduced chunk info to ugmentChunkHash hook and hash chunks independenly --- src/Chunk.ts | 6 ++- src/rollup/index.ts | 109 ++++++++++++++++++++++++++++-------------- src/rollup/types.d.ts | 9 ++-- 3 files changed, 83 insertions(+), 41 deletions(-) diff --git a/src/Chunk.ts b/src/Chunk.ts index 279dbfead99..340c9e7ca77 100644 --- a/src/Chunk.ts +++ b/src/Chunk.ts @@ -124,6 +124,7 @@ export default class Chunk { return chunk; } + augmentedHash?: string; entryModules: Module[] = []; execIndex: number; exportMode = 'named'; @@ -325,6 +326,9 @@ export default class Chunk { if (this.renderedHash) return this.renderedHash; if (!this.renderedSource) return ''; const hash = sha256(); + if (this.augmentedHash) { + hash.update(this.augmentedHash); + } hash.update(this.renderedSource.toString()); hash.update( this.getExportNames() @@ -336,7 +340,6 @@ export default class Chunk { }) .join(',') ); - this.graph.pluginDriver.hookSeqSync('augmentChunkHash', [hash.update.bind(hash)]); return (this.renderedHash = hash.digest('hex')); } @@ -800,7 +803,6 @@ export default class Chunk { private computeContentHashWithDependencies(addons: Addons, options: OutputOptions): string { const hash = sha256(); - hash.update( [addons.intro, addons.outro, addons.banner, addons.footer].map(addon => addon || '').join(':') ); diff --git a/src/rollup/index.ts b/src/rollup/index.ts index 1aeeca2321b..9fbabb366e5 100644 --- a/src/rollup/index.ts +++ b/src/rollup/index.ts @@ -22,6 +22,7 @@ import { OutputOptions, Plugin, PluginContext, + PreRenderedChunk, RollupBuild, RollupCache, RollupOutput, @@ -211,45 +212,81 @@ export default function rollup(rawInputOptions: GenericConfigObject): Promise 0, - isEntry: facadeModule !== null && facadeModule.isEntryPoint, - map: undefined, - modules: chunk.renderedModules, - get name() { - return chunk.getChunkName(); - } - } as OutputChunk; - } - return Promise.all( chunks.map(chunk => { - const outputChunk = outputBundle[chunk.id] as OutputChunk; - return chunk.render(outputOptions, addons, outputChunk).then(rendered => { - outputChunk.code = rendered.code; - outputChunk.map = rendered.map; - - return graph.pluginDriver.hookParallel('ongenerate', [ - { bundle: outputChunk, ...outputOptions }, - outputChunk - ]); - }); + const facadeModule = chunk.facadeModule; + const chunkInfo = { + dynamicImports: chunk.getDynamicImportIds(), + exports: chunk.getExportNames(), + facadeModuleId: facadeModule && facadeModule.id, + imports: chunk.getImportIds(), + isDynamicEntry: + facadeModule !== null && facadeModule.dynamicallyImportedBy.length > 0, + isEntry: facadeModule !== null && facadeModule.isEntryPoint, + modules: chunk.renderedModules, + get name() { + return chunk.getChunkName(); + } + } as PreRenderedChunk; + return graph.pluginDriver + .hookReduceValue( + 'augmentChunkHash', + '', + [chunkInfo], + (hashForChunk, pluginHash) => { + if (pluginHash) { + hashForChunk += pluginHash; + } + return hashForChunk; + } + ) + .then(hashForChunk => { + if (hashForChunk) { + chunk.augmentedHash = hashForChunk; + } + }); }) - ).then(() => {}); + ).then(() => { + assignChunkIds(chunks, inputOptions, outputOptions, inputBase, addons); + + // assign to outputBundle + for (let i = 0; i < chunks.length; i++) { + const chunk = chunks[i]; + const facadeModule = chunk.facadeModule; + + outputBundle[chunk.id] = { + code: undefined as any, + dynamicImports: chunk.getDynamicImportIds(), + exports: chunk.getExportNames(), + facadeModuleId: facadeModule && facadeModule.id, + fileName: chunk.id, + imports: chunk.getImportIds(), + isDynamicEntry: + facadeModule !== null && facadeModule.dynamicallyImportedBy.length > 0, + isEntry: facadeModule !== null && facadeModule.isEntryPoint, + map: undefined, + modules: chunk.renderedModules, + get name() { + return chunk.getChunkName(); + } + } as OutputChunk; + } + + return Promise.all( + chunks.map(chunk => { + const outputChunk = outputBundle[chunk.id] as OutputChunk; + return chunk.render(outputOptions, addons, outputChunk).then(rendered => { + outputChunk.code = rendered.code; + outputChunk.map = rendered.map; + + return graph.pluginDriver.hookParallel('ongenerate', [ + { bundle: outputChunk, ...outputOptions }, + outputChunk + ]); + }); + }) + ).then(() => {}); + }); }) .catch(error => graph.pluginDriver.hookParallel('renderError', [error]).then(() => { diff --git a/src/rollup/types.d.ts b/src/rollup/types.d.ts index 2621ee0424b..15e54febee5 100644 --- a/src/rollup/types.d.ts +++ b/src/rollup/types.d.ts @@ -276,7 +276,7 @@ interface OnWriteOptions extends OutputOptions { } export interface PluginHooks { - augmentChunkHash: (this: PluginContext, update: Function) => void; + augmentChunkHash: (this: PluginContext, chunk: PreOutputChunk) => void; buildEnd: (this: PluginContext, err?: Error) => Promise | void; buildStart: (this: PluginContext, options: InputOptions) => Promise | void; generateBundle: ( @@ -447,11 +447,10 @@ export interface RenderedModule { renderedLength: number; } -export interface RenderedChunk { +export interface PreRenderedChunk { dynamicImports: string[]; exports: string[]; facadeModuleId: string | null; - fileName: string; imports: string[]; isDynamicEntry: boolean; isEntry: boolean; @@ -461,6 +460,10 @@ export interface RenderedChunk { name: string; } +export interface RenderedChunk extends PreRenderedChunk { + fileName: string; +} + export interface OutputChunk extends RenderedChunk { code: string; map?: SourceMap; From 35053bdf5c5aacb92d695ed18c67125f7ba8df60 Mon Sep 17 00:00:00 2001 From: isidrok Date: Mon, 12 Aug 2019 17:46:47 +0200 Subject: [PATCH 05/11] augmentChunkHash remove redundant test --- test/hooks/index.js | 50 --------------------------------------------- 1 file changed, 50 deletions(-) diff --git a/test/hooks/index.js b/test/hooks/index.js index 0fe000c4cf4..1ecff4f0602 100644 --- a/test/hooks/index.js +++ b/test/hooks/index.js @@ -1044,56 +1044,6 @@ describe('hooks', () => { }); }); - it('augmentChunkHash only takes effect for chunks whose call got a return value', () => { - const outputOptions = { - format: 'esm', - dir: 'dist', - entryFileNames: '[name]-[hash].js' - }; - const input = ['input', 'other']; - const inputCode = { - input: `console.log('input');`, - other: `console.log('other');` - }; - function getFileNamesForChunks(bundle) { - return bundle.generate(outputOptions).then(({ output }) => { - return output.reduce((result, chunk) => { - result[chunk.name] = chunk.fileName; - return result; - }, {}); - }); - } - function bundleWithoutAugment() { - return rollup - .rollup({ - input, - plugins: [loader(inputCode)] - }) - .then(getFileNamesForChunks); - } - function bundleWithAugment() { - return rollup - .rollup({ - input, - plugins: [ - loader(inputCode), - { - augmentChunkHash(chunk) { - if (chunk.name === 'input') { - return 'foo'; - } - } - } - ] - }) - .then(getFileNamesForChunks); - } - return Promise.all([bundleWithoutAugment(), bundleWithAugment()]).then(([base, augmented]) => { - assert.notEqual(base.input, augmented.input); - assert.equal(base.other, augmented.other); - }); - }); - describe('deprecated', () => { it('passes bundle & output object to ongenerate & onwrite hooks, with deprecation warnings', () => { let deprecationCnt = 0; From 237254ce94d3dcf23ec52a2dfb8b693a62cf171f Mon Sep 17 00:00:00 2001 From: isidrok Date: Mon, 12 Aug 2019 17:55:52 +0200 Subject: [PATCH 06/11] augmentChunkHash fix typings --- src/rollup/types.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rollup/types.d.ts b/src/rollup/types.d.ts index 532cf4b9e6b..cb83753cc10 100644 --- a/src/rollup/types.d.ts +++ b/src/rollup/types.d.ts @@ -327,7 +327,7 @@ interface OnWriteOptions extends OutputOptions { } export interface PluginHooks { - augmentChunkHash: (this: PluginContext, chunk: PreOutputChunk) => void; + augmentChunkHash: (this: PluginContext, chunk: PreRenderedChunk) => void; buildEnd: (this: PluginContext, err?: Error) => Promise | void; buildStart: (this: PluginContext, options: InputOptions) => Promise | void; generateBundle: ( From b9ad5d16ac0ba2111a503d0b8549f388717c012e Mon Sep 17 00:00:00 2001 From: isidrok Date: Mon, 12 Aug 2019 21:19:05 +0200 Subject: [PATCH 07/11] move augmentChungHash to chunk --- bin/rollup | 1566 ----------------- bin/rollup.map | 1 - docs/05-plugin-development.md | 34 +- src/Chunk.ts | 36 +- src/rollup/index.ts | 34 - src/rollup/types.d.ts | 2 +- .../samples/augment-chunk-hash/_config.js | 6 +- .../samples/augment-chunk-hash/main.js | 7 +- 8 files changed, 58 insertions(+), 1628 deletions(-) delete mode 100755 bin/rollup delete mode 100644 bin/rollup.map diff --git a/bin/rollup b/bin/rollup deleted file mode 100755 index af473273221..00000000000 --- a/bin/rollup +++ /dev/null @@ -1,1566 +0,0 @@ -#!/usr/bin/env node -'use strict'; - -function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } - -var fs = require('fs'); -var fs__default = _interopDefault(fs); -var path = require('path'); -var path__default = _interopDefault(path); -var module$1 = _interopDefault(require('module')); -var rollup = require('../dist/rollup.js'); -var rollup__default = _interopDefault(rollup); -var assert = _interopDefault(require('assert')); -var events = _interopDefault(require('events')); - -var help = "rollup version __VERSION__\n=====================================\n\nUsage: rollup [options] \n\nBasic options:\n\n-c, --config Use this config file (if argument is used but value\n is unspecified, defaults to rollup.config.js)\n-d, --dir Directory for chunks (if absent, prints to stdout)\n-e, --external Comma-separate list of module IDs to exclude\n-f, --format Type of output (amd, cjs, esm, iife, umd)\n-g, --globals Comma-separate list of `moduleID:Global` pairs\n-h, --help Show this help message\n-i, --input Input (alternative to )\n-m, --sourcemap Generate sourcemap (`-m inline` for inline map)\n-n, --name Name for UMD export\n-o, --file Single output file (if absent, prints to stdout)\n-v, --version Show version number\n-w, --watch Watch files in bundle and rebuild on changes\n--amd.id ID for AMD module (default is anonymous)\n--amd.define Function to use in place of `define`\n--assetFileNames Name pattern for emitted assets\n--banner Code to insert at top of bundle (outside wrapper)\n--chunkFileNames Name pattern for emitted secondary chunks\n--compact Minify wrapper code\n--context Specify top-level `this` value\n--dynamicImportFunction Rename the dynamic `import()` function\n--entryFileNames Name pattern for emitted entry chunks\n--environment Settings passed to config file (see example)\n--no-esModule Do not add __esModule property\n--exports Specify export mode (auto, default, named, none)\n--extend Extend global variable defined by --name\n--footer Code to insert at end of bundle (outside wrapper)\n--no-freeze Do not freeze namespace objects\n--no-indent Don't indent result\n--no-interop Do not include interop block\n--inlineDynamicImports Create single bundle when using dynamic imports\n--intro Code to insert at top of bundle (inside wrapper)\n--namespaceToStringTag Create proper `.toString` methods for namespaces\n--noConflict Generate a noConflict method for UMD globals\n--no-strict Don't emit `\"use strict\";` in the generated modules\n--outro Code to insert at end of bundle (inside wrapper)\n--preferConst Use `const` instead of `var` for exports\n--preserveModules Preserve module structure\n--preserveSymlinks Do not follow symlinks when resolving files\n--shimMissingExports Create shim variables for missing exports\n--silent Don't print warnings\n--sourcemapExcludeSources Do not include source code in source maps\n--sourcemapFile Specify bundle position for source maps\n--strictDeprecations Throw errors for deprecated features\n--no-treeshake Disable tree-shaking optimisations\n--no-treeshake.annotations Ignore pure call annotations\n--no-treeshake.propertyReadSideEffects Ignore property access side-effects\n--treeshake.pureExternalModules Assume side-effect free externals\n\nExamples:\n\n# use settings in config file\nrollup -c\n\n# in config file, process.env.INCLUDE_DEPS === 'true'\n# and process.env.BUILD === 'production'\nrollup -c --environment INCLUDE_DEPS,BUILD:production\n\n# create CommonJS bundle.js from src/main.js\nrollup --format=cjs --file=bundle.js -- src/main.js\n\n# create self-executing IIFE using `window.jQuery`\n# and `window._` as external globals\nrollup -f iife --globals jquery:jQuery,lodash:_ \\\n -i src/app.js -o build/app.js -m build/app.js.map\n\nNotes:\n\n* When piping to stdout, only inline sourcemaps are permitted\n\nFor more information visit https://rollupjs.org\n"; - -var minimist = function (args, opts) { - if (!opts) - opts = {}; - var flags = { bools: {}, strings: {}, unknownFn: null }; - if (typeof opts['unknown'] === 'function') { - flags.unknownFn = opts['unknown']; - } - if (typeof opts['boolean'] === 'boolean' && opts['boolean']) { - flags.allBools = true; - } - else { - [].concat(opts['boolean']).filter(Boolean).forEach(function (key) { - flags.bools[key] = true; - }); - } - var aliases = {}; - Object.keys(opts.alias || {}).forEach(function (key) { - aliases[key] = [].concat(opts.alias[key]); - aliases[key].forEach(function (x) { - aliases[x] = [key].concat(aliases[key].filter(function (y) { - return x !== y; - })); - }); - }); - [].concat(opts.string).filter(Boolean).forEach(function (key) { - flags.strings[key] = true; - if (aliases[key]) { - flags.strings[aliases[key]] = true; - } - }); - var defaults = opts['default'] || {}; - var argv = { _: [] }; - Object.keys(flags.bools).forEach(function (key) { - setArg(key, defaults[key] === undefined ? false : defaults[key]); - }); - var notFlags = []; - if (args.indexOf('--') !== -1) { - notFlags = args.slice(args.indexOf('--') + 1); - args = args.slice(0, args.indexOf('--')); - } - function argDefined(key, arg) { - return (flags.allBools && /^--[^=]+$/.test(arg)) || - flags.strings[key] || flags.bools[key] || aliases[key]; - } - function setArg(key, val, arg) { - if (arg && flags.unknownFn && !argDefined(key, arg)) { - if (flags.unknownFn(arg) === false) - return; - } - var value = !flags.strings[key] && isNumber(val) - ? Number(val) : val; - setKey(argv, key.split('.'), value); - (aliases[key] || []).forEach(function (x) { - setKey(argv, x.split('.'), value); - }); - } - function setKey(obj, keys, value) { - var o = obj; - keys.slice(0, -1).forEach(function (key) { - if (o[key] === undefined) - o[key] = {}; - o = o[key]; - }); - var key = keys[keys.length - 1]; - if (o[key] === undefined || flags.bools[key] || typeof o[key] === 'boolean') { - o[key] = value; - } - else if (Array.isArray(o[key])) { - o[key].push(value); - } - else { - o[key] = [o[key], value]; - } - } - function aliasIsBoolean(key) { - return aliases[key].some(function (x) { - return flags.bools[x]; - }); - } - for (var i = 0; i < args.length; i++) { - var arg = args[i]; - if (/^--.+=/.test(arg)) { - // Using [\s\S] instead of . because js doesn't support the - // 'dotall' regex modifier. See: - // http://stackoverflow.com/a/1068308/13216 - var m = arg.match(/^--([^=]+)=([\s\S]*)$/); - var key = m[1]; - var value = m[2]; - if (flags.bools[key]) { - value = value !== 'false'; - } - setArg(key, value, arg); - } - else if (/^--no-.+/.test(arg)) { - var key = arg.match(/^--no-(.+)/)[1]; - setArg(key, false, arg); - } - else if (/^--.+/.test(arg)) { - var key = arg.match(/^--(.+)/)[1]; - var next = args[i + 1]; - if (next !== undefined && !/^-/.test(next) - && !flags.bools[key] - && !flags.allBools - && (aliases[key] ? !aliasIsBoolean(key) : true)) { - setArg(key, next, arg); - i++; - } - else if (/^(true|false)$/.test(next)) { - setArg(key, next === 'true', arg); - i++; - } - else { - setArg(key, flags.strings[key] ? '' : true, arg); - } - } - else if (/^-[^-]+/.test(arg)) { - var letters = arg.slice(1, -1).split(''); - var broken = false; - for (var j = 0; j < letters.length; j++) { - var next = arg.slice(j + 2); - if (next === '-') { - setArg(letters[j], next, arg); - continue; - } - if (/[A-Za-z]/.test(letters[j]) && /=/.test(next)) { - setArg(letters[j], next.split('=')[1], arg); - broken = true; - break; - } - if (/[A-Za-z]/.test(letters[j]) - && /-?\d+(\.\d*)?(e-?\d+)?$/.test(next)) { - setArg(letters[j], next, arg); - broken = true; - break; - } - if (letters[j + 1] && letters[j + 1].match(/\W/)) { - setArg(letters[j], arg.slice(j + 2), arg); - broken = true; - break; - } - else { - setArg(letters[j], flags.strings[letters[j]] ? '' : true, arg); - } - } - var key = arg.slice(-1)[0]; - if (!broken && key !== '-') { - if (args[i + 1] && !/^(-|--)[^-]/.test(args[i + 1]) - && !flags.bools[key] - && (aliases[key] ? !aliasIsBoolean(key) : true)) { - setArg(key, args[i + 1], arg); - i++; - } - else if (args[i + 1] && /true|false/.test(args[i + 1])) { - setArg(key, args[i + 1] === 'true', arg); - i++; - } - else { - setArg(key, flags.strings[key] ? '' : true, arg); - } - } - } - else { - if (!flags.unknownFn || flags.unknownFn(arg) !== false) { - argv._.push(flags.strings['_'] || !isNumber(arg) ? arg : Number(arg)); - } - if (opts.stopEarly) { - argv._.push.apply(argv._, args.slice(i + 1)); - break; - } - } - } - Object.keys(defaults).forEach(function (key) { - if (!hasKey(argv, key.split('.'))) { - setKey(argv, key.split('.'), defaults[key]); - (aliases[key] || []).forEach(function (x) { - setKey(argv, x.split('.'), defaults[key]); - }); - } - }); - if (opts['--']) { - argv['--'] = new Array(); - notFlags.forEach(function (key) { - argv['--'].push(key); - }); - } - else { - notFlags.forEach(function (key) { - argv._.push(key); - }); - } - return argv; -}; -function hasKey(obj, keys) { - var o = obj; - keys.slice(0, -1).forEach(function (key) { - o = (o[key] || {}); - }); - var key = keys[keys.length - 1]; - return key in o; -} -function isNumber(x) { - if (typeof x === 'number') - return true; - if (/^0x[0-9a-f]+$/i.test(x)) - return true; - return /^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x); -} - -var version = "1.17.0"; - -const createGetOption = (config, command) => (name, defaultValue) => command[name] !== undefined - ? command[name] - : config[name] !== undefined - ? config[name] - : defaultValue; -const normalizeObjectOptionValue = (optionValue) => { - if (!optionValue) { - return optionValue; - } - if (typeof optionValue !== 'object') { - return {}; - } - return optionValue; -}; -const getObjectOption = (config, command, name) => { - const commandOption = normalizeObjectOptionValue(command[name]); - const configOption = normalizeObjectOptionValue(config[name]); - if (commandOption !== undefined) { - return commandOption && configOption ? Object.assign({}, configOption, commandOption) : commandOption; - } - return configOption; -}; -const defaultOnWarn = warning => { - if (typeof warning === 'string') { - console.warn(warning); - } - else { - console.warn(warning.message); - } -}; -const getOnWarn = (config, defaultOnWarnHandler = defaultOnWarn) => config.onwarn - ? warning => config.onwarn(warning, defaultOnWarnHandler) - : defaultOnWarnHandler; -const getExternal = (config, command) => { - const configExternal = config.external; - return typeof configExternal === 'function' - ? (id, ...rest) => configExternal(id, ...rest) || command.external.indexOf(id) !== -1 - : (typeof config.external === 'string' - ? [configExternal] - : Array.isArray(configExternal) - ? configExternal - : []).concat(command.external); -}; -const commandAliases = { - c: 'config', - d: 'dir', - e: 'external', - f: 'format', - g: 'globals', - h: 'help', - i: 'input', - m: 'sourcemap', - n: 'name', - o: 'file', - v: 'version', - w: 'watch' -}; -function mergeOptions({ config = {}, command: rawCommandOptions = {}, defaultOnWarnHandler }) { - const command = getCommandOptions(rawCommandOptions); - const inputOptions = getInputOptions(config, command, defaultOnWarnHandler); - if (command.output) { - Object.assign(command, command.output); - } - const output = config.output; - const normalizedOutputOptions = Array.isArray(output) ? output : output ? [output] : []; - if (normalizedOutputOptions.length === 0) - normalizedOutputOptions.push({}); - const outputOptions = normalizedOutputOptions.map(singleOutputOptions => getOutputOptions(singleOutputOptions, command)); - const unknownOptionErrors = []; - const validInputOptions = Object.keys(inputOptions); - addUnknownOptionErrors(unknownOptionErrors, Object.keys(config), validInputOptions, 'input option', /^output$/); - const validOutputOptions = Object.keys(outputOptions[0]); - addUnknownOptionErrors(unknownOptionErrors, outputOptions.reduce((allKeys, options) => allKeys.concat(Object.keys(options)), []), validOutputOptions, 'output option'); - const validCliOutputOptions = validOutputOptions.filter(option => option !== 'sourcemapPathTransform'); - addUnknownOptionErrors(unknownOptionErrors, Object.keys(command), validInputOptions.concat(validCliOutputOptions, Object.keys(commandAliases), 'config', 'environment', 'silent'), 'CLI flag', /^_|output|(config.*)$/); - return { - inputOptions, - optionError: unknownOptionErrors.length > 0 ? unknownOptionErrors.join('\n') : null, - outputOptions - }; -} -function addUnknownOptionErrors(errors, options, validOptions, optionType, ignoredKeys = /$./) { - const unknownOptions = options.filter(key => validOptions.indexOf(key) === -1 && !ignoredKeys.test(key)); - if (unknownOptions.length > 0) - errors.push(`Unknown ${optionType}: ${unknownOptions.join(', ')}. Allowed options: ${validOptions.sort().join(', ')}`); -} -function getCommandOptions(rawCommandOptions) { - const external = rawCommandOptions.external && typeof rawCommandOptions.external === 'string' - ? rawCommandOptions.external.split(',') - : []; - return Object.assign({}, rawCommandOptions, { external, globals: typeof rawCommandOptions.globals === 'string' - ? rawCommandOptions.globals.split(',').reduce((globals, globalDefinition) => { - const [id, variableName] = globalDefinition.split(':'); - globals[id] = variableName; - if (external.indexOf(id) === -1) { - external.push(id); - } - return globals; - }, Object.create(null)) - : undefined }); -} -function getInputOptions(config, command = { external: [], globals: undefined }, defaultOnWarnHandler) { - const getOption = createGetOption(config, command); - const inputOptions = { - acorn: config.acorn, - acornInjectPlugins: config.acornInjectPlugins, - cache: getOption('cache'), - chunkGroupingSize: getOption('chunkGroupingSize', 5000), - context: config.context, - experimentalCacheExpiry: getOption('experimentalCacheExpiry', 10), - experimentalOptimizeChunks: getOption('experimentalOptimizeChunks'), - experimentalTopLevelAwait: getOption('experimentalTopLevelAwait'), - external: getExternal(config, command), - inlineDynamicImports: getOption('inlineDynamicImports', false), - input: getOption('input', []), - manualChunks: getOption('manualChunks'), - moduleContext: config.moduleContext, - onwarn: getOnWarn(config, defaultOnWarnHandler), - perf: getOption('perf', false), - plugins: config.plugins, - preserveModules: getOption('preserveModules'), - preserveSymlinks: getOption('preserveSymlinks'), - shimMissingExports: getOption('shimMissingExports'), - strictDeprecations: getOption('strictDeprecations', false), - treeshake: getObjectOption(config, command, 'treeshake'), - watch: config.watch - }; - // support rollup({ cache: prevBuildObject }) - if (inputOptions.cache && inputOptions.cache.cache) - inputOptions.cache = inputOptions.cache.cache; - return inputOptions; -} -function getOutputOptions(config, command = {}) { - const getOption = createGetOption(config, command); - let format = getOption('format'); - // Handle format aliases - switch (format) { - case 'esm': - case 'module': - format = 'es'; - break; - case 'commonjs': - format = 'cjs'; - } - return { - amd: Object.assign({}, config.amd, command.amd), - assetFileNames: getOption('assetFileNames'), - banner: getOption('banner'), - chunkFileNames: getOption('chunkFileNames'), - compact: getOption('compact', false), - dir: getOption('dir'), - dynamicImportFunction: getOption('dynamicImportFunction'), - entryFileNames: getOption('entryFileNames'), - esModule: getOption('esModule', true), - exports: getOption('exports'), - extend: getOption('extend'), - file: getOption('file'), - footer: getOption('footer'), - format: format === 'esm' ? 'es' : format, - freeze: getOption('freeze', true), - globals: getOption('globals'), - indent: getOption('indent', true), - interop: getOption('interop', true), - intro: getOption('intro'), - name: getOption('name'), - namespaceToStringTag: getOption('namespaceToStringTag', false), - noConflict: getOption('noConflict'), - outro: getOption('outro'), - paths: getOption('paths'), - preferConst: getOption('preferConst'), - sourcemap: getOption('sourcemap'), - sourcemapExcludeSources: getOption('sourcemapExcludeSources'), - sourcemapFile: getOption('sourcemapFile'), - sourcemapPathTransform: getOption('sourcemapPathTransform'), - strict: getOption('strict', true) - }; -} - -var modules = {}; -var getModule = function (dir) { - var rootPath = dir ? path__default.resolve(dir) : process.cwd(); - var rootName = path__default.join(rootPath, '@root'); - var root = modules[rootName]; - if (!root) { - root = new module$1(rootName); - root.filename = rootName; - root.paths = module$1._nodeModulePaths(rootPath); - modules[rootName] = root; - } - return root; -}; -var requireRelative = function (requested, relativeTo) { - var root = getModule(relativeTo); - return root.require(requested); -}; -requireRelative.resolve = function (requested, relativeTo) { - var root = getModule(relativeTo); - return module$1._resolveFilename(requested, root); -}; -var requireRelative_1 = requireRelative; - -const absolutePath = /^(?:\/|(?:[A-Za-z]:)?[\\|/])/; -function isAbsolute(path) { - return absolutePath.test(path); -} - -function getAliasName(id) { - const base = path.basename(id); - return base.substr(0, base.length - path.extname(id).length); -} -function relativeId(id) { - if (typeof process === 'undefined' || !isAbsolute(id)) - return id; - return path.relative(process.cwd(), id); -} - -const tc = { - enabled: process.env.FORCE_COLOR || - process.platform === "win32" || - (process.stdout.isTTY && process.env.TERM && process.env.TERM !== "dumb") -}; -const Styles = (tc.Styles = {}); -const defineProp = Object.defineProperty; -const init = (style, open, close, re) => { - let i, len = 1, seq = [(Styles[style] = { open, close, re })]; - const fn = s => { - if (tc.enabled) { - for (i = 0, s += ""; i < len; i++) { - style = seq[i]; - s = - (open = style.open) + - (~s.indexOf((close = style.close), 4) // skip first \x1b[ - ? s.replace(style.re, open) - : s) + - close; - } - len = 1; - } - return s; - }; - defineProp(tc, style, { - get: () => { - for (let k in Styles) - defineProp(fn, k, { - get: () => ((seq[len++] = Styles[k]), fn) - }); - delete tc[style]; - return (tc[style] = fn); - }, - configurable: true - }); -}; -init("reset", "\x1b[0m", "\x1b[0m", /\x1b\[0m/g); -init("bold", "\x1b[1m", "\x1b[22m", /\x1b\[22m/g); -init("dim", "\x1b[2m", "\x1b[22m", /\x1b\[22m/g); -init("italic", "\x1b[3m", "\x1b[23m", /\x1b\[23m/g); -init("underline", "\x1b[4m", "\x1b[24m", /\x1b\[24m/g); -init("inverse", "\x1b[7m", "\x1b[27m", /\x1b\[27m/g); -init("hidden", "\x1b[8m", "\x1b[28m", /\x1b\[28m/g); -init("strikethrough", "\x1b[9m", "\x1b[29m", /\x1b\[29m/g); -init("black", "\x1b[30m", "\x1b[39m", /\x1b\[39m/g); -init("red", "\x1b[31m", "\x1b[39m", /\x1b\[39m/g); -init("green", "\x1b[32m", "\x1b[39m", /\x1b\[39m/g); -init("yellow", "\x1b[33m", "\x1b[39m", /\x1b\[39m/g); -init("blue", "\x1b[34m", "\x1b[39m", /\x1b\[39m/g); -init("magenta", "\x1b[35m", "\x1b[39m", /\x1b\[39m/g); -init("cyan", "\x1b[36m", "\x1b[39m", /\x1b\[39m/g); -init("white", "\x1b[37m", "\x1b[39m", /\x1b\[39m/g); -init("gray", "\x1b[90m", "\x1b[39m", /\x1b\[39m/g); -init("bgBlack", "\x1b[40m", "\x1b[49m", /\x1b\[49m/g); -init("bgRed", "\x1b[41m", "\x1b[49m", /\x1b\[49m/g); -init("bgGreen", "\x1b[42m", "\x1b[49m", /\x1b\[49m/g); -init("bgYellow", "\x1b[43m", "\x1b[49m", /\x1b\[49m/g); -init("bgBlue", "\x1b[44m", "\x1b[49m", /\x1b\[49m/g); -init("bgMagenta", "\x1b[45m", "\x1b[49m", /\x1b\[49m/g); -init("bgCyan", "\x1b[46m", "\x1b[49m", /\x1b\[49m/g); -init("bgWhite", "\x1b[47m", "\x1b[49m", /\x1b\[49m/g); -var turbocolor = tc; - -// log to stderr to keep `rollup main.js > bundle.js` from breaking -const stderr = console.error.bind(console); -function handleError(err, recover = false) { - let description = err.message || err; - if (err.name) - description = `${err.name}: ${description}`; - const message = (err.plugin - ? `(plugin ${err.plugin}) ${description}` - : description) || err; - stderr(turbocolor.bold.red(`[!] ${turbocolor.bold(message.toString())}`)); - if (err.url) { - stderr(turbocolor.cyan(err.url)); - } - if (err.loc) { - stderr(`${relativeId((err.loc.file || err.id))} (${err.loc.line}:${err.loc.column})`); - } - else if (err.id) { - stderr(relativeId(err.id)); - } - if (err.frame) { - stderr(turbocolor.dim(err.frame)); - } - if (err.stack) { - stderr(turbocolor.dim(err.stack)); - } - stderr(''); - if (!recover) - process.exit(1); -} - -function batchWarnings() { - let allWarnings = new Map(); - let count = 0; - return { - get count() { - return count; - }, - add: (warning) => { - if (typeof warning === 'string') { - warning = { code: 'UNKNOWN', message: warning }; - } - if (warning.code in immediateHandlers) { - immediateHandlers[warning.code](warning); - return; - } - if (!allWarnings.has(warning.code)) - allWarnings.set(warning.code, []); - allWarnings.get(warning.code).push(warning); - count += 1; - }, - flush: () => { - if (count === 0) - return; - const codes = Array.from(allWarnings.keys()).sort((a, b) => { - if (deferredHandlers[a] && deferredHandlers[b]) { - return deferredHandlers[a].priority - deferredHandlers[b].priority; - } - if (deferredHandlers[a]) - return -1; - if (deferredHandlers[b]) - return 1; - return (allWarnings.get(b).length - - allWarnings.get(a).length); - }); - codes.forEach(code => { - const handler = deferredHandlers[code]; - const warnings = allWarnings.get(code); - if (handler) { - handler.fn(warnings); - } - else { - warnings.forEach(warning => { - title(warning.message); - if (warning.url) - info(warning.url); - const id = (warning.loc && warning.loc.file) || warning.id; - if (id) { - const loc = warning.loc - ? `${relativeId(id)}: (${warning.loc.line}:${warning.loc.column})` - : relativeId(id); - stderr(turbocolor.bold(relativeId(loc))); - } - if (warning.frame) - info(warning.frame); - }); - } - }); - allWarnings = new Map(); - count = 0; - } - }; -} -const immediateHandlers = { - UNKNOWN_OPTION: warning => { - title(`You have passed an unrecognized option`); - stderr(warning.message); - }, - MISSING_NODE_BUILTINS: warning => { - title(`Missing shims for Node.js built-ins`); - const detail = warning.modules.length === 1 - ? `'${warning.modules[0]}'` - : `${warning.modules - .slice(0, -1) - .map((name) => `'${name}'`) - .join(', ')} and '${warning.modules.slice(-1)}'`; - stderr(`Creating a browser bundle that depends on ${detail}. You might need to include https://www.npmjs.com/package/rollup-plugin-node-builtins`); - }, - MIXED_EXPORTS: () => { - title('Mixing named and default exports'); - stderr(`Consumers of your bundle will have to use bundle['default'] to access the default export, which may not be what you want. Use \`output.exports: 'named'\` to disable this warning`); - }, - EMPTY_BUNDLE: () => { - title(`Generated an empty bundle`); - } -}; -// TODO select sensible priorities -const deferredHandlers = { - UNUSED_EXTERNAL_IMPORT: { - fn: warnings => { - title('Unused external imports'); - warnings.forEach(warning => { - stderr(`${warning.names} imported from external module '${warning.source}' but never used`); - }); - }, - priority: 1 - }, - UNRESOLVED_IMPORT: { - fn: warnings => { - title('Unresolved dependencies'); - info('https://rollupjs.org/guide/en/#warning-treating-module-as-external-dependency'); - const dependencies = new Map(); - warnings.forEach(warning => { - if (!dependencies.has(warning.source)) - dependencies.set(warning.source, []); - dependencies.get(warning.source).push(warning.importer); - }); - Array.from(dependencies.keys()).forEach(dependency => { - const importers = dependencies.get(dependency); - stderr(`${turbocolor.bold(dependency)} (imported by ${importers.join(', ')})`); - }); - }, - priority: 1 - }, - MISSING_EXPORT: { - fn: warnings => { - title('Missing exports'); - info('https://rollupjs.org/guide/en/#error-name-is-not-exported-by-module-'); - warnings.forEach(warning => { - stderr(turbocolor.bold(warning.importer)); - stderr(`${warning.missing} is not exported by ${warning.exporter}`); - stderr(turbocolor.gray(warning.frame)); - }); - }, - priority: 1 - }, - THIS_IS_UNDEFINED: { - fn: warnings => { - title('`this` has been rewritten to `undefined`'); - info('https://rollupjs.org/guide/en/#error-this-is-undefined'); - showTruncatedWarnings(warnings); - }, - priority: 1 - }, - EVAL: { - fn: warnings => { - title('Use of eval is strongly discouraged'); - info('https://rollupjs.org/guide/en/#avoiding-eval'); - showTruncatedWarnings(warnings); - }, - priority: 1 - }, - NON_EXISTENT_EXPORT: { - fn: warnings => { - title(`Import of non-existent ${warnings.length > 1 ? 'exports' : 'export'}`); - showTruncatedWarnings(warnings); - }, - priority: 1 - }, - NAMESPACE_CONFLICT: { - fn: warnings => { - title(`Conflicting re-exports`); - warnings.forEach(warning => { - stderr(`${turbocolor.bold(relativeId(warning.reexporter))} re-exports '${warning.name}' from both ${relativeId(warning.sources[0])} and ${relativeId(warning.sources[1])} (will be ignored)`); - }); - }, - priority: 1 - }, - MISSING_GLOBAL_NAME: { - fn: warnings => { - title(`Missing global variable ${warnings.length > 1 ? 'names' : 'name'}`); - stderr(`Use output.globals to specify browser global variable names corresponding to external modules`); - warnings.forEach(warning => { - stderr(`${turbocolor.bold(warning.source)} (guessing '${warning.guess}')`); - }); - }, - priority: 1 - }, - SOURCEMAP_BROKEN: { - fn: warnings => { - title(`Broken sourcemap`); - info('https://rollupjs.org/guide/en/#warning-sourcemap-is-likely-to-be-incorrect'); - const plugins = Array.from(new Set(warnings.map(w => w.plugin).filter(Boolean))); - const detail = plugins.length === 0 - ? '' - : plugins.length > 1 - ? ` (such as ${plugins - .slice(0, -1) - .map(p => `'${p}'`) - .join(', ')} and '${plugins.slice(-1)}')` - : ` (such as '${plugins[0]}')`; - stderr(`Plugins that transform code${detail} should generate accompanying sourcemaps`); - }, - priority: 1 - }, - PLUGIN_WARNING: { - fn: warnings => { - const nestedByPlugin = nest(warnings, 'plugin'); - nestedByPlugin.forEach(({ key: plugin, items }) => { - const nestedByMessage = nest(items, 'message'); - let lastUrl; - nestedByMessage.forEach(({ key: message, items }) => { - title(`Plugin ${plugin}: ${message}`); - items.forEach(warning => { - if (warning.url !== lastUrl) - info((lastUrl = warning.url)); - if (warning.id) { - let loc = relativeId(warning.id); - if (warning.loc) { - loc += `: (${warning.loc.line}:${warning.loc.column})`; - } - stderr(turbocolor.bold(loc)); - } - if (warning.frame) - info(warning.frame); - }); - }); - }); - }, - priority: 1 - } -}; -function title(str) { - stderr(`${turbocolor.bold.yellow('(!)')} ${turbocolor.bold.yellow(str)}`); -} -function info(url) { - stderr(turbocolor.gray(url)); -} -function nest(array, prop) { - const nested = []; - const lookup = new Map(); - array.forEach(item => { - const key = item[prop]; - if (!lookup.has(key)) { - lookup.set(key, { - items: [], - key - }); - nested.push(lookup.get(key)); - } - lookup.get(key).items.push(item); - }); - return nested; -} -function showTruncatedWarnings(warnings) { - const nestedByModule = nest(warnings, 'id'); - const sliced = nestedByModule.length > 5 ? nestedByModule.slice(0, 3) : nestedByModule; - sliced.forEach(({ key: id, items }) => { - stderr(turbocolor.bold(relativeId(id))); - stderr(turbocolor.gray(items[0].frame)); - if (items.length > 1) { - stderr(`...and ${items.length - 1} other ${items.length > 2 ? 'occurrences' : 'occurrence'}`); - } - }); - if (nestedByModule.length > sliced.length) { - stderr(`\n...and ${nestedByModule.length - sliced.length} other files`); - } -} - -var parseMs = milliseconds => { - if (typeof milliseconds !== 'number') { - throw new TypeError('Expected a number'); - } - const roundTowardsZero = milliseconds > 0 ? Math.floor : Math.ceil; - return { - days: roundTowardsZero(milliseconds / 86400000), - hours: roundTowardsZero(milliseconds / 3600000) % 24, - minutes: roundTowardsZero(milliseconds / 60000) % 60, - seconds: roundTowardsZero(milliseconds / 1000) % 60, - milliseconds: roundTowardsZero(milliseconds) % 1000, - microseconds: roundTowardsZero(milliseconds * 1000) % 1000, - nanoseconds: roundTowardsZero(milliseconds * 1e6) % 1000 - }; -}; - -const pluralize = (word, count) => count === 1 ? word : word + 's'; -var prettyMs = (milliseconds, options = {}) => { - if (!Number.isFinite(milliseconds)) { - throw new TypeError('Expected a finite number'); - } - if (options.compact) { - options.secondsDecimalDigits = 0; - options.millisecondsDecimalDigits = 0; - } - const result = []; - const add = (value, long, short, valueString) => { - if (value === 0) { - return; - } - const postfix = options.verbose ? ' ' + pluralize(long, value) : short; - result.push((valueString || value) + postfix); - }; - const secondsDecimalDigits = typeof options.secondsDecimalDigits === 'number' ? - options.secondsDecimalDigits : - 1; - if (secondsDecimalDigits < 1) { - const difference = 1000 - (milliseconds % 1000); - if (difference < 500) { - milliseconds += difference; - } - } - const parsed = parseMs(milliseconds); - add(Math.trunc(parsed.days / 365), 'year', 'y'); - add(parsed.days % 365, 'day', 'd'); - add(parsed.hours, 'hour', 'h'); - add(parsed.minutes, 'minute', 'm'); - if (options.separateMilliseconds || - options.formatSubMilliseconds || - milliseconds < 1000) { - add(parsed.seconds, 'second', 's'); - if (options.formatSubMilliseconds) { - add(parsed.milliseconds, 'millisecond', 'ms'); - add(parsed.microseconds, 'microsecond', 'µs'); - add(parsed.nanoseconds, 'nanosecond', 'ns'); - } - else { - const millisecondsAndBelow = parsed.milliseconds + - (parsed.microseconds / 1000) + - (parsed.nanoseconds / 1e6); - const millisecondsDecimalDigits = typeof options.millisecondsDecimalDigits === 'number' ? - options.millisecondsDecimalDigits : - 0; - const millisecondsString = millisecondsDecimalDigits ? - millisecondsAndBelow.toFixed(millisecondsDecimalDigits) : - Math.ceil(millisecondsAndBelow); - add(parseFloat(millisecondsString, 10), 'millisecond', 'ms', millisecondsString); - } - } - else { - const seconds = (milliseconds / 1000) % 60; - const secondsDecimalDigits = typeof options.secondsDecimalDigits === 'number' ? - options.secondsDecimalDigits : - 1; - const secondsFixed = seconds.toFixed(secondsDecimalDigits); - const secondsString = options.keepDecimalsOnWholeSeconds ? - secondsFixed : - secondsFixed.replace(/\.0+$/, ''); - add(parseFloat(secondsString, 10), 'second', 's', secondsString); - } - if (result.length === 0) { - return '0' + (options.verbose ? ' milliseconds' : 'ms'); - } - if (options.compact) { - return '~' + result[0]; - } - if (typeof options.unitCount === 'number') { - return '~' + result.slice(0, Math.max(options.unitCount, 1)).join(' '); - } - return result.join(' '); -}; - -let SOURCEMAPPING_URL = 'sourceMa'; -SOURCEMAPPING_URL += 'ppingURL'; -var SOURCEMAPPING_URL$1 = SOURCEMAPPING_URL; - -const UNITS = [ - 'B', - 'kB', - 'MB', - 'GB', - 'TB', - 'PB', - 'EB', - 'ZB', - 'YB' -]; -/* -Formats the given number using `Number#toLocaleString`. -- If locale is a string, the value is expected to be a locale-key (for example: `de`). -- If locale is true, the system default locale is used for translation. -- If no value for locale is specified, the number is returned unmodified. -*/ -const toLocaleString = (number, locale) => { - let result = number; - if (typeof locale === 'string') { - result = number.toLocaleString(locale); - } - else if (locale === true) { - result = number.toLocaleString(); - } - return result; -}; -var prettyBytes = (number, options) => { - if (!Number.isFinite(number)) { - throw new TypeError(`Expected a finite number, got ${typeof number}: ${number}`); - } - options = Object.assign({}, options); - if (options.signed && number === 0) { - return ' 0 B'; - } - const isNegative = number < 0; - const prefix = isNegative ? '-' : (options.signed ? '+' : ''); - if (isNegative) { - number = -number; - } - if (number < 1) { - const numberString = toLocaleString(number, options.locale); - return prefix + numberString + ' B'; - } - const exponent = Math.min(Math.floor(Math.log10(number) / 3), UNITS.length - 1); - // eslint-disable-next-line unicorn/prefer-exponentiation-operator - number = Number((number / Math.pow(1000, exponent)).toPrecision(3)); - const numberString = toLocaleString(number, options.locale); - const unit = UNITS[exponent]; - return prefix + numberString + ' ' + unit; -}; - -function printTimings(timings) { - Object.keys(timings).forEach(label => { - const color = label[0] === '#' ? (label[1] !== '#' ? turbocolor.underline : turbocolor.bold) : (text) => text; - const [time, memory, total] = timings[label]; - const row = `${label}: ${time.toFixed(0)}ms, ${prettyBytes(memory)} / ${prettyBytes(total)}`; - console.info(color(row)); - }); -} - -function build(inputOptions, outputOptions, warnings, silent = false) { - const useStdout = !outputOptions[0].file && !outputOptions[0].dir; - const start = Date.now(); - const files = useStdout - ? ['stdout'] - : outputOptions.map(t => relativeId(t.file || t.dir)); - if (!silent) { - let inputFiles = undefined; - if (typeof inputOptions.input === 'string') { - inputFiles = inputOptions.input; - } - else if (inputOptions.input instanceof Array) { - inputFiles = inputOptions.input.join(', '); - } - else if (typeof inputOptions.input === 'object' && inputOptions.input !== null) { - inputFiles = Object.keys(inputOptions.input) - .map(name => inputOptions.input[name]) - .join(', '); - } - stderr(turbocolor.cyan(`\n${turbocolor.bold(inputFiles)} → ${turbocolor.bold(files.join(', '))}...`)); - } - return rollup.rollup(inputOptions) - .then((bundle) => { - if (useStdout) { - const output = outputOptions[0]; - if (output.sourcemap && output.sourcemap !== 'inline') { - handleError({ - code: 'MISSING_OUTPUT_OPTION', - message: 'You must specify a --file (-o) option when creating a file with a sourcemap' - }); - } - return bundle.generate(output).then(({ output: outputs }) => { - for (const file of outputs) { - let source; - if (file.isAsset) { - source = file.source; - } - else { - source = file.code; - if (output.sourcemap === 'inline') { - source += `\n//# ${SOURCEMAPPING_URL$1}=${file - .map.toUrl()}\n`; - } - } - if (outputs.length > 1) - process.stdout.write('\n' + turbocolor.cyan(turbocolor.bold('//→ ' + file.fileName + ':')) + '\n'); - process.stdout.write(source); - } - }); - } - return Promise.all(outputOptions.map(output => bundle.write(output))).then(() => bundle); - }) - .then((bundle) => { - if (!silent) { - warnings.flush(); - stderr(turbocolor.green(`created ${turbocolor.bold(files.join(', '))} in ${turbocolor.bold(prettyMs(Date.now() - start))}`)); - if (bundle && bundle.getTimings) { - printTimings(bundle.getTimings()); - } - } - }) - .catch((err) => { - if (warnings.count > 0) - warnings.flush(); - handleError(err); - }); -} - -function loadConfigFile(configFile, commandOptions = {}) { - const silent = commandOptions.silent || false; - const warnings = batchWarnings(); - return rollup__default - .rollup({ - external: (id) => (id[0] !== '.' && !path__default.isAbsolute(id)) || id.slice(-5, id.length) === '.json', - input: configFile, - onwarn: warnings.add, - treeshake: false - }) - .then((bundle) => { - if (!silent && warnings.count > 0) { - stderr(turbocolor.bold(`loaded ${relativeId(configFile)} with warnings`)); - warnings.flush(); - } - return bundle.generate({ - exports: 'named', - format: 'cjs' - }); - }) - .then(({ output: [{ code }] }) => { - // temporarily override require - const defaultLoader = require.extensions['.js']; - require.extensions['.js'] = (module, filename) => { - if (filename === configFile) { - module._compile(code, filename); - } - else { - defaultLoader(module, filename); - } - }; - delete require.cache[configFile]; - return Promise.resolve(require(configFile)) - .then(configFileContent => { - if (configFileContent.default) - configFileContent = configFileContent.default; - if (typeof configFileContent === 'function') { - return configFileContent(commandOptions); - } - return configFileContent; - }) - .then(configs => { - if (Object.keys(configs).length === 0) { - handleError({ - code: 'MISSING_CONFIG', - message: 'Config file must export an options object, or an array of options objects', - url: 'https://rollupjs.org/guide/en/#configuration-files' - }); - } - require.extensions['.js'] = defaultLoader; - return Array.isArray(configs) ? configs : [configs]; - }); - }); -} - -var timeZone = date => { - const offset = (date || new Date()).getTimezoneOffset(); - const absOffset = Math.abs(offset); - const hours = Math.floor(absOffset / 60); - const minutes = absOffset % 60; - const minutesOut = minutes > 0 ? ':' + ('0' + minutes).slice(-2) : ''; - return (offset < 0 ? '+' : '-') + hours + minutesOut; -}; - -const dateTime = options => { - options = Object.assign({ - date: new Date(), - local: true, - showTimeZone: false, - showMilliseconds: false - }, options); - let { date } = options; - if (options.local) { - // Offset the date so it will return the correct value when getting the ISO string - date = new Date(date.getTime() - (date.getTimezoneOffset() * 60000)); - } - let end = ''; - if (options.showTimeZone) { - end = ' UTC' + (options.local ? timeZone(date) : ''); - } - if (options.showMilliseconds && date.getUTCMilliseconds() > 0) { - end = ` ${date.getUTCMilliseconds()}ms${end}`; - } - return date - .toISOString() - .replace(/T/, ' ') - .replace(/\..+/, end); -}; -var dateTime_1 = dateTime; -// TODO: Remove this for the next major release -var default_1 = dateTime; -dateTime_1.default = default_1; - -function createCommonjsModule(fn, module) { - return module = { exports: {} }, fn(module, module.exports), module.exports; -} - -var signals = createCommonjsModule(function (module) { - // This is not the set of all possible signals. - // - // It IS, however, the set of all signals that trigger - // an exit on either Linux or BSD systems. Linux is a - // superset of the signal names supported on BSD, and - // the unknown signals just fail to register, so we can - // catch that easily enough. - // - // Don't bother with SIGKILL. It's uncatchable, which - // means that we can't fire any callbacks anyway. - // - // If a user does happen to register a handler on a non- - // fatal signal like SIGWINCH or something, and then - // exit, it'll end up firing `process.emit('exit')`, so - // the handler will be fired anyway. - // - // SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised - // artificially, inherently leave the process in a - // state from which it is not safe to try and enter JS - // listeners. - module.exports = [ - 'SIGABRT', - 'SIGALRM', - 'SIGHUP', - 'SIGINT', - 'SIGTERM' - ]; - if (process.platform !== 'win32') { - module.exports.push('SIGVTALRM', 'SIGXCPU', 'SIGXFSZ', 'SIGUSR2', 'SIGTRAP', 'SIGSYS', 'SIGQUIT', 'SIGIOT' - // should detect profiler and enable/disable accordingly. - // see #21 - // 'SIGPROF' - ); - } - if (process.platform === 'linux') { - module.exports.push('SIGIO', 'SIGPOLL', 'SIGPWR', 'SIGSTKFLT', 'SIGUNUSED'); - } -}); - -// Note: since nyc uses this module to output coverage, any lines -// that are in the direct sync flow of nyc's outputCoverage are -// ignored, since we can never get coverage for them. -var signals$1 = signals; -var EE = events; -/* istanbul ignore if */ -if (typeof EE !== 'function') { - EE = EE.EventEmitter; -} -var emitter; -if (process.__signal_exit_emitter__) { - emitter = process.__signal_exit_emitter__; -} -else { - emitter = process.__signal_exit_emitter__ = new EE(); - emitter.count = 0; - emitter.emitted = {}; -} -// Because this emitter is a global, we have to check to see if a -// previous version of this library failed to enable infinite listeners. -// I know what you're about to say. But literally everything about -// signal-exit is a compromise with evil. Get used to it. -if (!emitter.infinite) { - emitter.setMaxListeners(Infinity); - emitter.infinite = true; -} -var signalExit = function (cb, opts) { - assert.equal(typeof cb, 'function', 'a callback must be provided for exit handler'); - if (loaded === false) { - load(); - } - var ev = 'exit'; - if (opts && opts.alwaysLast) { - ev = 'afterexit'; - } - var remove = function () { - emitter.removeListener(ev, cb); - if (emitter.listeners('exit').length === 0 && - emitter.listeners('afterexit').length === 0) { - unload(); - } - }; - emitter.on(ev, cb); - return remove; -}; -var unload_1 = unload; -function unload() { - if (!loaded) { - return; - } - loaded = false; - signals$1.forEach(function (sig) { - try { - process.removeListener(sig, sigListeners[sig]); - } - catch (er) { } - }); - process.emit = originalProcessEmit; - process.reallyExit = originalProcessReallyExit; - emitter.count -= 1; -} -function emit(event, code, signal) { - if (emitter.emitted[event]) { - return; - } - emitter.emitted[event] = true; - emitter.emit(event, code, signal); -} -// { : , ... } -var sigListeners = {}; -signals$1.forEach(function (sig) { - sigListeners[sig] = function listener() { - // If there are no other listeners, an exit is coming! - // Simplest way: remove us and then re-send the signal. - // We know that this will kill the process, so we can - // safely emit now. - var listeners = process.listeners(sig); - if (listeners.length === emitter.count) { - unload(); - emit('exit', null, sig); - /* istanbul ignore next */ - emit('afterexit', null, sig); - /* istanbul ignore next */ - process.kill(process.pid, sig); - } - }; -}); -var signals_1 = function () { - return signals$1; -}; -var load_1 = load; -var loaded = false; -function load() { - if (loaded) { - return; - } - loaded = true; - // This is the number of onSignalExit's that are in play. - // It's important so that we can count the correct number of - // listeners on signals, and don't wait for the other one to - // handle it instead of us. - emitter.count += 1; - signals$1 = signals$1.filter(function (sig) { - try { - process.on(sig, sigListeners[sig]); - return true; - } - catch (er) { - return false; - } - }); - process.emit = processEmit; - process.reallyExit = processReallyExit; -} -var originalProcessReallyExit = process.reallyExit; -function processReallyExit(code) { - process.exitCode = code || 0; - emit('exit', process.exitCode, null); - /* istanbul ignore next */ - emit('afterexit', process.exitCode, null); - /* istanbul ignore next */ - originalProcessReallyExit.call(process, process.exitCode); -} -var originalProcessEmit = process.emit; -function processEmit(ev, arg) { - if (ev === 'exit') { - if (arg !== undefined) { - process.exitCode = arg; - } - var ret = originalProcessEmit.apply(this, arguments); - emit('exit', process.exitCode, null); - /* istanbul ignore next */ - emit('afterexit', process.exitCode, null); - return ret; - } - else { - return originalProcessEmit.apply(this, arguments); - } -} -signalExit.unload = unload_1; -signalExit.signals = signals_1; -signalExit.load = load_1; - -const CLEAR_SCREEN = '\u001Bc'; -function getResetScreen(clearScreen) { - if (clearScreen) { - return (heading) => stderr(CLEAR_SCREEN + heading); - } - let firstRun = true; - return (heading) => { - if (firstRun) { - stderr(heading); - firstRun = false; - } - }; -} - -function watch(configFile, configs, command, silent = false) { - const isTTY = Boolean(process.stderr.isTTY); - const warnings = batchWarnings(); - const initialConfigs = processConfigs(configs); - const clearScreen = initialConfigs.every(config => config.watch.clearScreen !== false); - const resetScreen = getResetScreen(isTTY && clearScreen); - let watcher; - let configWatcher; - function processConfigs(configs) { - return configs.map(options => { - const merged = mergeOptions({ - command, - config: options, - defaultOnWarnHandler: warnings.add - }); - const result = Object.assign({}, merged.inputOptions, { output: merged.outputOptions }); - if (!result.watch) - result.watch = {}; - if (merged.optionError) - merged.inputOptions.onwarn({ - code: 'UNKNOWN_OPTION', - message: merged.optionError - }); - return result; - }); - } - function start(configs) { - watcher = rollup.watch(configs); - watcher.on('event', (event) => { - switch (event.code) { - case 'FATAL': - handleError(event.error, true); - process.exit(1); - break; - case 'ERROR': - warnings.flush(); - handleError(event.error, true); - break; - case 'START': - if (!silent) { - resetScreen(turbocolor.underline(`rollup v${rollup.VERSION}`)); - } - break; - case 'BUNDLE_START': - if (!silent) { - let input = event.input; - if (typeof input !== 'string') { - input = Array.isArray(input) - ? input.join(', ') - : Object.keys(input) - .map(key => input[key]) - .join(', '); - } - stderr(turbocolor.cyan(`bundles ${turbocolor.bold(input)} → ${turbocolor.bold(event.output.map(relativeId).join(', '))}...`)); - } - break; - case 'BUNDLE_END': - warnings.flush(); - if (!silent) - stderr(turbocolor.green(`created ${turbocolor.bold(event.output.map(relativeId).join(', '))} in ${turbocolor.bold(prettyMs(event.duration))}`)); - if (event.result && event.result.getTimings) { - printTimings(event.result.getTimings()); - } - break; - case 'END': - if (!silent && isTTY) { - stderr(`\n[${dateTime_1()}] waiting for changes...`); - } - } - }); - } - // catch ctrl+c, kill, and uncaught errors - const removeOnExit = signalExit(close); - process.on('uncaughtException', close); - // only listen to stdin if it is a pipe - if (!process.stdin.isTTY) { - process.stdin.on('end', close); // in case we ever support stdin! - } - function close(err) { - removeOnExit(); - process.removeListener('uncaughtException', close); - // removing a non-existent listener is a no-op - process.stdin.removeListener('end', close); - if (watcher) - watcher.close(); - if (configWatcher) - configWatcher.close(); - if (err) { - console.error(err); - process.exit(1); - } - } - try { - start(initialConfigs); - } - catch (err) { - close(err); - return; - } - if (configFile && !configFile.startsWith('node:')) { - let restarting = false; - let aborted = false; - let configFileData = fs__default.readFileSync(configFile, 'utf-8'); - const restart = () => { - const newConfigFileData = fs__default.readFileSync(configFile, 'utf-8'); - if (newConfigFileData === configFileData) - return; - configFileData = newConfigFileData; - if (restarting) { - aborted = true; - return; - } - restarting = true; - loadConfigFile(configFile, command) - .then((_configs) => { - restarting = false; - if (aborted) { - aborted = false; - restart(); - } - else { - watcher.close(); - start(initialConfigs); - } - }) - .catch((err) => { - handleError(err, true); - }); - }; - configWatcher = fs__default.watch(configFile, (event) => { - if (event === 'change') - restart(); - }); - } -} - -function runRollup(command) { - let inputSource; - if (command._.length > 0) { - if (command.input) { - handleError({ - code: 'DUPLICATE_IMPORT_OPTIONS', - message: 'use --input, or pass input path as argument' - }); - } - inputSource = command._; - } - else if (typeof command.input === 'string') { - inputSource = [command.input]; - } - else { - inputSource = command.input; - } - if (inputSource && inputSource.length > 0) { - if (inputSource.some((input) => input.indexOf('=') !== -1)) { - command.input = {}; - inputSource.forEach((input) => { - const equalsIndex = input.indexOf('='); - const value = input.substr(equalsIndex + 1); - let key = input.substr(0, equalsIndex); - if (!key) - key = getAliasName(input); - command.input[key] = value; - }); - } - else { - command.input = inputSource; - } - } - if (command.environment) { - const environment = Array.isArray(command.environment) - ? command.environment - : [command.environment]; - environment.forEach((arg) => { - arg.split(',').forEach((pair) => { - const [key, value] = pair.split(':'); - if (value) { - process.env[key] = value; - } - else { - process.env[key] = String(true); - } - }); - }); - } - let configFile = command.config === true ? 'rollup.config.js' : command.config; - if (configFile) { - if (configFile.slice(0, 5) === 'node:') { - const pkgName = configFile.slice(5); - try { - configFile = requireRelative_1.resolve(`rollup-config-${pkgName}`, process.cwd()); - } - catch (err) { - try { - configFile = requireRelative_1.resolve(pkgName, process.cwd()); - } - catch (err) { - if (err.code === 'MODULE_NOT_FOUND') { - handleError({ - code: 'MISSING_EXTERNAL_CONFIG', - message: `Could not resolve config file ${configFile}` - }); - } - throw err; - } - } - } - else { - // find real path of config so it matches what Node provides to callbacks in require.extensions - configFile = fs.realpathSync(configFile); - } - if (command.watch) - process.env.ROLLUP_WATCH = 'true'; - loadConfigFile(configFile, command) - .then(configs => execute(configFile, configs, command)) - .catch(handleError); - } - else { - return execute(configFile, [{ input: null }], command); - } -} -function execute(configFile, configs, command) { - if (command.watch) { - watch(configFile, configs, command, command.silent); - } - else { - let promise = Promise.resolve(); - for (const config of configs) { - promise = promise.then(() => { - const warnings = batchWarnings(); - const { inputOptions, outputOptions, optionError } = mergeOptions({ - command, - config, - defaultOnWarnHandler: warnings.add - }); - if (optionError) - inputOptions.onwarn({ code: 'UNKNOWN_OPTION', message: optionError }); - return build(inputOptions, outputOptions, warnings, command.silent); - }); - } - return promise; - } -} - -const command = minimist(process.argv.slice(2), { - alias: commandAliases -}); -if (command.help || (process.argv.length <= 2 && process.stdin.isTTY)) { - console.log(`\n${help.replace('__VERSION__', version)}\n`); -} -else if (command.version) { - console.log(`rollup v${version}`); -} -else { - try { - require('source-map-support').install(); - } - catch (err) { - // do nothing - } - runRollup(command); -} -//# sourceMappingURL=rollup.map diff --git a/bin/rollup.map b/bin/rollup.map deleted file mode 100644 index c8e99ae4141..00000000000 --- a/bin/rollup.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"rollup","sources":["../node_modules/minimist/index.js","../src/utils/mergeOptions.ts","../node_modules/require-relative/index.js","../src/utils/path.ts","../src/utils/relativeId.ts","../node_modules/turbocolor/index.js","src/logging.ts","src/run/batchWarnings.ts","../node_modules/parse-ms/index.js","../node_modules/pretty-ms/index.js","src/sourceMappingUrl.ts","../node_modules/pretty-bytes/index.js","src/run/timings.ts","src/run/build.ts","src/run/loadConfigFile.ts","../node_modules/time-zone/index.js","../node_modules/date-time/index.js","../node_modules/signal-exit/signals.js","../node_modules/signal-exit/index.js","src/run/resetScreen.ts","src/run/watch.ts","src/run/index.ts","src/index.ts"],"sourcesContent":["module.exports = function (args, opts) {\n if (!opts) opts = {};\n \n var flags = { bools : {}, strings : {}, unknownFn: null };\n\n if (typeof opts['unknown'] === 'function') {\n flags.unknownFn = opts['unknown'];\n }\n\n if (typeof opts['boolean'] === 'boolean' && opts['boolean']) {\n flags.allBools = true;\n } else {\n [].concat(opts['boolean']).filter(Boolean).forEach(function (key) {\n flags.bools[key] = true;\n });\n }\n \n var aliases = {};\n Object.keys(opts.alias || {}).forEach(function (key) {\n aliases[key] = [].concat(opts.alias[key]);\n aliases[key].forEach(function (x) {\n aliases[x] = [key].concat(aliases[key].filter(function (y) {\n return x !== y;\n }));\n });\n });\n\n [].concat(opts.string).filter(Boolean).forEach(function (key) {\n flags.strings[key] = true;\n if (aliases[key]) {\n flags.strings[aliases[key]] = true;\n }\n });\n\n var defaults = opts['default'] || {};\n \n var argv = { _ : [] };\n Object.keys(flags.bools).forEach(function (key) {\n setArg(key, defaults[key] === undefined ? false : defaults[key]);\n });\n \n var notFlags = [];\n\n if (args.indexOf('--') !== -1) {\n notFlags = args.slice(args.indexOf('--')+1);\n args = args.slice(0, args.indexOf('--'));\n }\n\n function argDefined(key, arg) {\n return (flags.allBools && /^--[^=]+$/.test(arg)) ||\n flags.strings[key] || flags.bools[key] || aliases[key];\n }\n\n function setArg (key, val, arg) {\n if (arg && flags.unknownFn && !argDefined(key, arg)) {\n if (flags.unknownFn(arg) === false) return;\n }\n\n var value = !flags.strings[key] && isNumber(val)\n ? Number(val) : val\n ;\n setKey(argv, key.split('.'), value);\n \n (aliases[key] || []).forEach(function (x) {\n setKey(argv, x.split('.'), value);\n });\n }\n\n function setKey (obj, keys, value) {\n var o = obj;\n keys.slice(0,-1).forEach(function (key) {\n if (o[key] === undefined) o[key] = {};\n o = o[key];\n });\n\n var key = keys[keys.length - 1];\n if (o[key] === undefined || flags.bools[key] || typeof o[key] === 'boolean') {\n o[key] = value;\n }\n else if (Array.isArray(o[key])) {\n o[key].push(value);\n }\n else {\n o[key] = [ o[key], value ];\n }\n }\n \n function aliasIsBoolean(key) {\n return aliases[key].some(function (x) {\n return flags.bools[x];\n });\n }\n\n for (var i = 0; i < args.length; i++) {\n var arg = args[i];\n \n if (/^--.+=/.test(arg)) {\n // Using [\\s\\S] instead of . because js doesn't support the\n // 'dotall' regex modifier. See:\n // http://stackoverflow.com/a/1068308/13216\n var m = arg.match(/^--([^=]+)=([\\s\\S]*)$/);\n var key = m[1];\n var value = m[2];\n if (flags.bools[key]) {\n value = value !== 'false';\n }\n setArg(key, value, arg);\n }\n else if (/^--no-.+/.test(arg)) {\n var key = arg.match(/^--no-(.+)/)[1];\n setArg(key, false, arg);\n }\n else if (/^--.+/.test(arg)) {\n var key = arg.match(/^--(.+)/)[1];\n var next = args[i + 1];\n if (next !== undefined && !/^-/.test(next)\n && !flags.bools[key]\n && !flags.allBools\n && (aliases[key] ? !aliasIsBoolean(key) : true)) {\n setArg(key, next, arg);\n i++;\n }\n else if (/^(true|false)$/.test(next)) {\n setArg(key, next === 'true', arg);\n i++;\n }\n else {\n setArg(key, flags.strings[key] ? '' : true, arg);\n }\n }\n else if (/^-[^-]+/.test(arg)) {\n var letters = arg.slice(1,-1).split('');\n \n var broken = false;\n for (var j = 0; j < letters.length; j++) {\n var next = arg.slice(j+2);\n \n if (next === '-') {\n setArg(letters[j], next, arg)\n continue;\n }\n \n if (/[A-Za-z]/.test(letters[j]) && /=/.test(next)) {\n setArg(letters[j], next.split('=')[1], arg);\n broken = true;\n break;\n }\n \n if (/[A-Za-z]/.test(letters[j])\n && /-?\\d+(\\.\\d*)?(e-?\\d+)?$/.test(next)) {\n setArg(letters[j], next, arg);\n broken = true;\n break;\n }\n \n if (letters[j+1] && letters[j+1].match(/\\W/)) {\n setArg(letters[j], arg.slice(j+2), arg);\n broken = true;\n break;\n }\n else {\n setArg(letters[j], flags.strings[letters[j]] ? '' : true, arg);\n }\n }\n \n var key = arg.slice(-1)[0];\n if (!broken && key !== '-') {\n if (args[i+1] && !/^(-|--)[^-]/.test(args[i+1])\n && !flags.bools[key]\n && (aliases[key] ? !aliasIsBoolean(key) : true)) {\n setArg(key, args[i+1], arg);\n i++;\n }\n else if (args[i+1] && /true|false/.test(args[i+1])) {\n setArg(key, args[i+1] === 'true', arg);\n i++;\n }\n else {\n setArg(key, flags.strings[key] ? '' : true, arg);\n }\n }\n }\n else {\n if (!flags.unknownFn || flags.unknownFn(arg) !== false) {\n argv._.push(\n flags.strings['_'] || !isNumber(arg) ? arg : Number(arg)\n );\n }\n if (opts.stopEarly) {\n argv._.push.apply(argv._, args.slice(i + 1));\n break;\n }\n }\n }\n \n Object.keys(defaults).forEach(function (key) {\n if (!hasKey(argv, key.split('.'))) {\n setKey(argv, key.split('.'), defaults[key]);\n \n (aliases[key] || []).forEach(function (x) {\n setKey(argv, x.split('.'), defaults[key]);\n });\n }\n });\n \n if (opts['--']) {\n argv['--'] = new Array();\n notFlags.forEach(function(key) {\n argv['--'].push(key);\n });\n }\n else {\n notFlags.forEach(function(key) {\n argv._.push(key);\n });\n }\n\n return argv;\n};\n\nfunction hasKey (obj, keys) {\n var o = obj;\n keys.slice(0,-1).forEach(function (key) {\n o = (o[key] || {});\n });\n\n var key = keys[keys.length - 1];\n return key in o;\n}\n\nfunction isNumber (x) {\n if (typeof x === 'number') return true;\n if (/^0x[0-9a-f]+$/i.test(x)) return true;\n return /^[-+]?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(e[-+]?\\d+)?$/.test(x);\n}\n\n","import {\n\tInputOptions,\n\tOutputOptions,\n\tWarningHandler,\n\tWarningHandlerWithDefault\n} from '../rollup/types';\n\nexport interface GenericConfigObject {\n\t[key: string]: unknown;\n}\n\nexport interface CommandConfigObject {\n\texternal: string[];\n\tglobals: { [id: string]: string } | undefined;\n\t[key: string]: unknown;\n}\n\nconst createGetOption = (config: GenericConfigObject, command: GenericConfigObject) => (\n\tname: string,\n\tdefaultValue?: unknown\n): any =>\n\tcommand[name] !== undefined\n\t\t? command[name]\n\t\t: config[name] !== undefined\n\t\t? config[name]\n\t\t: defaultValue;\n\nconst normalizeObjectOptionValue = (optionValue: any) => {\n\tif (!optionValue) {\n\t\treturn optionValue;\n\t}\n\tif (typeof optionValue !== 'object') {\n\t\treturn {};\n\t}\n\treturn optionValue;\n};\n\nconst getObjectOption = (\n\tconfig: GenericConfigObject,\n\tcommand: GenericConfigObject,\n\tname: string\n) => {\n\tconst commandOption = normalizeObjectOptionValue(command[name]);\n\tconst configOption = normalizeObjectOptionValue(config[name]);\n\tif (commandOption !== undefined) {\n\t\treturn commandOption && configOption ? { ...configOption, ...commandOption } : commandOption;\n\t}\n\treturn configOption;\n};\n\nconst defaultOnWarn: WarningHandler = warning => {\n\tif (typeof warning === 'string') {\n\t\tconsole.warn(warning);\n\t} else {\n\t\tconsole.warn(warning.message);\n\t}\n};\n\nconst getOnWarn = (\n\tconfig: GenericConfigObject,\n\tdefaultOnWarnHandler: WarningHandler = defaultOnWarn\n): WarningHandler =>\n\tconfig.onwarn\n\t\t? warning => (config.onwarn as WarningHandlerWithDefault)(warning, defaultOnWarnHandler)\n\t\t: defaultOnWarnHandler;\n\nconst getExternal = (config: GenericConfigObject, command: CommandConfigObject) => {\n\tconst configExternal = config.external;\n\treturn typeof configExternal === 'function'\n\t\t? (id: string, ...rest: string[]) =>\n\t\t\t\tconfigExternal(id, ...rest) || command.external.indexOf(id) !== -1\n\t\t: (typeof config.external === 'string'\n\t\t\t\t? [configExternal]\n\t\t\t\t: Array.isArray(configExternal)\n\t\t\t\t? configExternal\n\t\t\t\t: []\n\t\t ).concat(command.external);\n};\n\nexport const commandAliases: { [key: string]: string } = {\n\tc: 'config',\n\td: 'dir',\n\te: 'external',\n\tf: 'format',\n\tg: 'globals',\n\th: 'help',\n\ti: 'input',\n\tm: 'sourcemap',\n\tn: 'name',\n\to: 'file',\n\tv: 'version',\n\tw: 'watch'\n};\n\nexport default function mergeOptions({\n\tconfig = {},\n\tcommand: rawCommandOptions = {},\n\tdefaultOnWarnHandler\n}: {\n\tcommand?: GenericConfigObject;\n\tconfig: GenericConfigObject;\n\tdefaultOnWarnHandler?: WarningHandler;\n}): {\n\tinputOptions: InputOptions;\n\toptionError: string | null;\n\toutputOptions: any;\n} {\n\tconst command = getCommandOptions(rawCommandOptions);\n\tconst inputOptions = getInputOptions(config, command, defaultOnWarnHandler as WarningHandler);\n\n\tif (command.output) {\n\t\tObject.assign(command, command.output);\n\t}\n\n\tconst output = config.output;\n\tconst normalizedOutputOptions = Array.isArray(output) ? output : output ? [output] : [];\n\tif (normalizedOutputOptions.length === 0) normalizedOutputOptions.push({});\n\tconst outputOptions = normalizedOutputOptions.map(singleOutputOptions =>\n\t\tgetOutputOptions(singleOutputOptions, command)\n\t);\n\n\tconst unknownOptionErrors: string[] = [];\n\tconst validInputOptions = Object.keys(inputOptions);\n\taddUnknownOptionErrors(\n\t\tunknownOptionErrors,\n\t\tObject.keys(config),\n\t\tvalidInputOptions,\n\t\t'input option',\n\t\t/^output$/\n\t);\n\n\tconst validOutputOptions = Object.keys(outputOptions[0]);\n\taddUnknownOptionErrors(\n\t\tunknownOptionErrors,\n\t\toutputOptions.reduce((allKeys, options) => allKeys.concat(Object.keys(options)), []),\n\t\tvalidOutputOptions,\n\t\t'output option'\n\t);\n\n\tconst validCliOutputOptions = validOutputOptions.filter(\n\t\toption => option !== 'sourcemapPathTransform'\n\t);\n\taddUnknownOptionErrors(\n\t\tunknownOptionErrors,\n\t\tObject.keys(command),\n\t\tvalidInputOptions.concat(\n\t\t\tvalidCliOutputOptions,\n\t\t\tObject.keys(commandAliases),\n\t\t\t'config',\n\t\t\t'environment',\n\t\t\t'silent'\n\t\t),\n\t\t'CLI flag',\n\t\t/^_|output|(config.*)$/\n\t);\n\n\treturn {\n\t\tinputOptions,\n\t\toptionError: unknownOptionErrors.length > 0 ? unknownOptionErrors.join('\\n') : null,\n\t\toutputOptions\n\t};\n}\n\nfunction addUnknownOptionErrors(\n\terrors: string[],\n\toptions: string[],\n\tvalidOptions: string[],\n\toptionType: string,\n\tignoredKeys: RegExp = /$./\n) {\n\tconst unknownOptions = options.filter(\n\t\tkey => validOptions.indexOf(key) === -1 && !ignoredKeys.test(key)\n\t);\n\tif (unknownOptions.length > 0)\n\t\terrors.push(\n\t\t\t`Unknown ${optionType}: ${unknownOptions.join(\n\t\t\t\t', '\n\t\t\t)}. Allowed options: ${validOptions.sort().join(', ')}`\n\t\t);\n}\n\nfunction getCommandOptions(rawCommandOptions: GenericConfigObject): CommandConfigObject {\n\tconst external =\n\t\trawCommandOptions.external && typeof rawCommandOptions.external === 'string'\n\t\t\t? rawCommandOptions.external.split(',')\n\t\t\t: [];\n\treturn {\n\t\t...rawCommandOptions,\n\t\texternal,\n\t\tglobals:\n\t\t\ttypeof rawCommandOptions.globals === 'string'\n\t\t\t\t? rawCommandOptions.globals.split(',').reduce((globals, globalDefinition) => {\n\t\t\t\t\t\tconst [id, variableName] = globalDefinition.split(':');\n\t\t\t\t\t\tglobals[id] = variableName;\n\t\t\t\t\t\tif (external.indexOf(id) === -1) {\n\t\t\t\t\t\t\texternal.push(id);\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn globals;\n\t\t\t\t }, Object.create(null))\n\t\t\t\t: undefined\n\t};\n}\n\nfunction getInputOptions(\n\tconfig: GenericConfigObject,\n\tcommand: CommandConfigObject = { external: [], globals: undefined },\n\tdefaultOnWarnHandler: WarningHandler\n): InputOptions {\n\tconst getOption = createGetOption(config, command);\n\n\tconst inputOptions: InputOptions = {\n\t\tacorn: config.acorn,\n\t\tacornInjectPlugins: config.acornInjectPlugins as any,\n\t\tcache: getOption('cache'),\n\t\tchunkGroupingSize: getOption('chunkGroupingSize', 5000),\n\t\tcontext: config.context as any,\n\t\texperimentalCacheExpiry: getOption('experimentalCacheExpiry', 10),\n\t\texperimentalOptimizeChunks: getOption('experimentalOptimizeChunks'),\n\t\texperimentalTopLevelAwait: getOption('experimentalTopLevelAwait'),\n\t\texternal: getExternal(config, command) as any,\n\t\tinlineDynamicImports: getOption('inlineDynamicImports', false),\n\t\tinput: getOption('input', []),\n\t\tmanualChunks: getOption('manualChunks'),\n\t\tmoduleContext: config.moduleContext as any,\n\t\tonwarn: getOnWarn(config, defaultOnWarnHandler),\n\t\tperf: getOption('perf', false),\n\t\tplugins: config.plugins as any,\n\t\tpreserveModules: getOption('preserveModules'),\n\t\tpreserveSymlinks: getOption('preserveSymlinks'),\n\t\tshimMissingExports: getOption('shimMissingExports'),\n\t\tstrictDeprecations: getOption('strictDeprecations', false),\n\t\ttreeshake: getObjectOption(config, command, 'treeshake'),\n\t\twatch: config.watch as any\n\t};\n\n\t// support rollup({ cache: prevBuildObject })\n\tif (inputOptions.cache && (inputOptions.cache as any).cache)\n\t\tinputOptions.cache = (inputOptions.cache as any).cache;\n\n\treturn inputOptions;\n}\n\nfunction getOutputOptions(\n\tconfig: GenericConfigObject,\n\tcommand: GenericConfigObject = {}\n): OutputOptions {\n\tconst getOption = createGetOption(config, command);\n\tlet format = getOption('format');\n\n\t// Handle format aliases\n\tswitch (format) {\n\t\tcase 'esm':\n\t\tcase 'module':\n\t\t\tformat = 'es';\n\t\t\tbreak;\n\t\tcase 'commonjs':\n\t\t\tformat = 'cjs';\n\t}\n\n\treturn {\n\t\tamd: { ...config.amd, ...command.amd } as any,\n\t\tassetFileNames: getOption('assetFileNames'),\n\t\tbanner: getOption('banner'),\n\t\tchunkFileNames: getOption('chunkFileNames'),\n\t\tcompact: getOption('compact', false),\n\t\tdir: getOption('dir'),\n\t\tdynamicImportFunction: getOption('dynamicImportFunction'),\n\t\tentryFileNames: getOption('entryFileNames'),\n\t\tesModule: getOption('esModule', true),\n\t\texports: getOption('exports'),\n\t\textend: getOption('extend'),\n\t\tfile: getOption('file'),\n\t\tfooter: getOption('footer'),\n\t\tformat: format === 'esm' ? 'es' : format,\n\t\tfreeze: getOption('freeze', true),\n\t\tglobals: getOption('globals'),\n\t\tindent: getOption('indent', true),\n\t\tinterop: getOption('interop', true),\n\t\tintro: getOption('intro'),\n\t\tname: getOption('name'),\n\t\tnamespaceToStringTag: getOption('namespaceToStringTag', false),\n\t\tnoConflict: getOption('noConflict'),\n\t\toutro: getOption('outro'),\n\t\tpaths: getOption('paths'),\n\t\tpreferConst: getOption('preferConst'),\n\t\tsourcemap: getOption('sourcemap'),\n\t\tsourcemapExcludeSources: getOption('sourcemapExcludeSources'),\n\t\tsourcemapFile: getOption('sourcemapFile'),\n\t\tsourcemapPathTransform: getOption('sourcemapPathTransform'),\n\t\tstrict: getOption('strict', true)\n\t};\n}\n","/*\nrelative require\n*/'use strict';\n\nvar path = require('path');\nvar Module = require('module');\n\nvar modules = {};\n\nvar getModule = function(dir) {\n var rootPath = dir ? path.resolve(dir) : process.cwd();\n var rootName = path.join(rootPath, '@root');\n var root = modules[rootName];\n if (!root) {\n root = new Module(rootName);\n root.filename = rootName;\n root.paths = Module._nodeModulePaths(rootPath);\n modules[rootName] = root;\n }\n return root;\n};\n\nvar requireRelative = function(requested, relativeTo) {\n var root = getModule(relativeTo);\n return root.require(requested);\n};\n\nrequireRelative.resolve = function(requested, relativeTo) {\n var root = getModule(relativeTo);\n return Module._resolveFilename(requested, root);\n};\n\nmodule.exports = requireRelative;\n","const absolutePath = /^(?:\\/|(?:[A-Za-z]:)?[\\\\|/])/;\nconst relativePath = /^\\.?\\.\\//;\n\nexport function isAbsolute(path: string) {\n\treturn absolutePath.test(path);\n}\n\nexport function isRelative(path: string) {\n\treturn relativePath.test(path);\n}\n\nexport function normalize(path: string) {\n\tif (path.indexOf('\\\\') == -1) return path;\n\treturn path.replace(/\\\\/g, '/');\n}\n\nexport { basename, dirname, extname, relative, resolve } from 'path';\n","import { basename, extname, isAbsolute, relative } from './path';\n\nexport function getAliasName(id: string) {\n\tconst base = basename(id);\n\treturn base.substr(0, base.length - extname(id).length);\n}\n\nexport default function relativeId(id: string) {\n\tif (typeof process === 'undefined' || !isAbsolute(id)) return id;\n\treturn relative(process.cwd(), id);\n}\n\nexport function isPlainName(name: string) {\n\t// not starting with \"./\", \"/\". \"../\"\n\treturn !(\n\t\tname[0] === '/' ||\n\t\t(name[1] === '.' && (name[2] === '/' || (name[2] === '.' && name[3] === '/')))\n\t);\n}\n","\"use strict\"\n\nconst tc = {\n enabled:\n process.env.FORCE_COLOR ||\n process.platform === \"win32\" ||\n (process.stdout.isTTY && process.env.TERM && process.env.TERM !== \"dumb\")\n}\nconst Styles = (tc.Styles = {})\nconst defineProp = Object.defineProperty\n\nconst init = (style, open, close, re) => {\n let i,\n len = 1,\n seq = [(Styles[style] = { open, close, re })]\n\n const fn = s => {\n if (tc.enabled) {\n for (i = 0, s += \"\"; i < len; i++) {\n style = seq[i]\n s =\n (open = style.open) +\n (~s.indexOf((close = style.close), 4) // skip first \\x1b[\n ? s.replace(style.re, open)\n : s) +\n close\n }\n len = 1\n }\n return s\n }\n\n defineProp(tc, style, {\n get: () => {\n for (let k in Styles)\n defineProp(fn, k, {\n get: () => ((seq[len++] = Styles[k]), fn)\n })\n delete tc[style]\n return (tc[style] = fn)\n },\n configurable: true\n })\n}\n\ninit(\"reset\", \"\\x1b[0m\", \"\\x1b[0m\", /\\x1b\\[0m/g)\ninit(\"bold\", \"\\x1b[1m\", \"\\x1b[22m\", /\\x1b\\[22m/g)\ninit(\"dim\", \"\\x1b[2m\", \"\\x1b[22m\", /\\x1b\\[22m/g)\ninit(\"italic\", \"\\x1b[3m\", \"\\x1b[23m\", /\\x1b\\[23m/g)\ninit(\"underline\", \"\\x1b[4m\", \"\\x1b[24m\", /\\x1b\\[24m/g)\ninit(\"inverse\", \"\\x1b[7m\", \"\\x1b[27m\", /\\x1b\\[27m/g)\ninit(\"hidden\", \"\\x1b[8m\", \"\\x1b[28m\", /\\x1b\\[28m/g)\ninit(\"strikethrough\", \"\\x1b[9m\", \"\\x1b[29m\", /\\x1b\\[29m/g)\ninit(\"black\", \"\\x1b[30m\", \"\\x1b[39m\", /\\x1b\\[39m/g)\ninit(\"red\", \"\\x1b[31m\", \"\\x1b[39m\", /\\x1b\\[39m/g)\ninit(\"green\", \"\\x1b[32m\", \"\\x1b[39m\", /\\x1b\\[39m/g)\ninit(\"yellow\", \"\\x1b[33m\", \"\\x1b[39m\", /\\x1b\\[39m/g)\ninit(\"blue\", \"\\x1b[34m\", \"\\x1b[39m\", /\\x1b\\[39m/g)\ninit(\"magenta\", \"\\x1b[35m\", \"\\x1b[39m\", /\\x1b\\[39m/g)\ninit(\"cyan\", \"\\x1b[36m\", \"\\x1b[39m\", /\\x1b\\[39m/g)\ninit(\"white\", \"\\x1b[37m\", \"\\x1b[39m\", /\\x1b\\[39m/g)\ninit(\"gray\", \"\\x1b[90m\", \"\\x1b[39m\", /\\x1b\\[39m/g)\ninit(\"bgBlack\", \"\\x1b[40m\", \"\\x1b[49m\", /\\x1b\\[49m/g)\ninit(\"bgRed\", \"\\x1b[41m\", \"\\x1b[49m\", /\\x1b\\[49m/g)\ninit(\"bgGreen\", \"\\x1b[42m\", \"\\x1b[49m\", /\\x1b\\[49m/g)\ninit(\"bgYellow\", \"\\x1b[43m\", \"\\x1b[49m\", /\\x1b\\[49m/g)\ninit(\"bgBlue\", \"\\x1b[44m\", \"\\x1b[49m\", /\\x1b\\[49m/g)\ninit(\"bgMagenta\", \"\\x1b[45m\", \"\\x1b[49m\", /\\x1b\\[49m/g)\ninit(\"bgCyan\", \"\\x1b[46m\", \"\\x1b[49m\", /\\x1b\\[49m/g)\ninit(\"bgWhite\", \"\\x1b[47m\", \"\\x1b[49m\", /\\x1b\\[49m/g)\n\nmodule.exports = tc\n","import tc from 'turbocolor';\nimport { RollupError } from '../../src/rollup/types';\nimport relativeId from '../../src/utils/relativeId';\n\n// log to stderr to keep `rollup main.js > bundle.js` from breaking\nexport const stderr = console.error.bind(console);\n\nexport function handleError(err: RollupError, recover = false) {\n\tlet description = err.message || err;\n\tif (err.name) description = `${err.name}: ${description}`;\n\tconst message =\n\t\t((err as { plugin?: string }).plugin\n\t\t\t? `(plugin ${(err as { plugin?: string }).plugin}) ${description}`\n\t\t\t: description) || err;\n\n\tstderr(tc.bold.red(`[!] ${tc.bold(message.toString())}`));\n\n\tif (err.url) {\n\t\tstderr(tc.cyan(err.url));\n\t}\n\n\tif (err.loc) {\n\t\tstderr(`${relativeId((err.loc.file || err.id) as string)} (${err.loc.line}:${err.loc.column})`);\n\t} else if (err.id) {\n\t\tstderr(relativeId(err.id));\n\t}\n\n\tif (err.frame) {\n\t\tstderr(tc.dim(err.frame));\n\t}\n\n\tif (err.stack) {\n\t\tstderr(tc.dim(err.stack));\n\t}\n\n\tstderr('');\n\n\tif (!recover) process.exit(1);\n}\n","import tc from 'turbocolor';\nimport { RollupWarning } from '../../../src/rollup/types';\nimport relativeId from '../../../src/utils/relativeId';\nimport { stderr } from '../logging';\n\nexport interface BatchWarnings {\n\tadd: (warning: string | RollupWarning) => void;\n\treadonly count: number;\n\tflush: () => void;\n}\n\nexport default function batchWarnings() {\n\tlet allWarnings = new Map();\n\tlet count = 0;\n\n\treturn {\n\t\tget count() {\n\t\t\treturn count;\n\t\t},\n\n\t\tadd: (warning: string | RollupWarning) => {\n\t\t\tif (typeof warning === 'string') {\n\t\t\t\twarning = { code: 'UNKNOWN', message: warning };\n\t\t\t}\n\n\t\t\tif ((warning.code as string) in immediateHandlers) {\n\t\t\t\timmediateHandlers[warning.code as string](warning);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (!allWarnings.has(warning.code as string)) allWarnings.set(warning.code as string, []);\n\t\t\t(allWarnings.get(warning.code as string) as RollupWarning[]).push(warning);\n\n\t\t\tcount += 1;\n\t\t},\n\n\t\tflush: () => {\n\t\t\tif (count === 0) return;\n\n\t\t\tconst codes = Array.from(allWarnings.keys()).sort((a, b) => {\n\t\t\t\tif (deferredHandlers[a] && deferredHandlers[b]) {\n\t\t\t\t\treturn deferredHandlers[a].priority - deferredHandlers[b].priority;\n\t\t\t\t}\n\n\t\t\t\tif (deferredHandlers[a]) return -1;\n\t\t\t\tif (deferredHandlers[b]) return 1;\n\t\t\t\treturn (\n\t\t\t\t\t(allWarnings.get(b) as RollupWarning[]).length -\n\t\t\t\t\t(allWarnings.get(a) as RollupWarning[]).length\n\t\t\t\t);\n\t\t\t});\n\n\t\t\tcodes.forEach(code => {\n\t\t\t\tconst handler = deferredHandlers[code];\n\t\t\t\tconst warnings = allWarnings.get(code);\n\n\t\t\t\tif (handler) {\n\t\t\t\t\thandler.fn(warnings as RollupWarning[]);\n\t\t\t\t} else {\n\t\t\t\t\t(warnings as RollupWarning[]).forEach(warning => {\n\t\t\t\t\t\ttitle(warning.message);\n\n\t\t\t\t\t\tif (warning.url) info(warning.url);\n\n\t\t\t\t\t\tconst id = (warning.loc && warning.loc.file) || warning.id;\n\t\t\t\t\t\tif (id) {\n\t\t\t\t\t\t\tconst loc = warning.loc\n\t\t\t\t\t\t\t\t? `${relativeId(id)}: (${warning.loc.line}:${warning.loc.column})`\n\t\t\t\t\t\t\t\t: relativeId(id);\n\n\t\t\t\t\t\t\tstderr(tc.bold(relativeId(loc)));\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (warning.frame) info(warning.frame);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tallWarnings = new Map();\n\t\t\tcount = 0;\n\t\t}\n\t};\n}\n\nconst immediateHandlers: {\n\t[code: string]: (warning: RollupWarning) => void;\n} = {\n\tUNKNOWN_OPTION: warning => {\n\t\ttitle(`You have passed an unrecognized option`);\n\t\tstderr(warning.message);\n\t},\n\n\tMISSING_NODE_BUILTINS: warning => {\n\t\ttitle(`Missing shims for Node.js built-ins`);\n\n\t\tconst detail =\n\t\t\t(warning.modules as string[]).length === 1\n\t\t\t\t? `'${(warning.modules as string[])[0]}'`\n\t\t\t\t: `${(warning.modules as string[])\n\t\t\t\t\t\t.slice(0, -1)\n\t\t\t\t\t\t.map((name: string) => `'${name}'`)\n\t\t\t\t\t\t.join(', ')} and '${(warning.modules as string[]).slice(-1)}'`;\n\t\tstderr(\n\t\t\t`Creating a browser bundle that depends on ${detail}. You might need to include https://www.npmjs.com/package/rollup-plugin-node-builtins`\n\t\t);\n\t},\n\n\tMIXED_EXPORTS: () => {\n\t\ttitle('Mixing named and default exports');\n\t\tstderr(\n\t\t\t`Consumers of your bundle will have to use bundle['default'] to access the default export, which may not be what you want. Use \\`output.exports: 'named'\\` to disable this warning`\n\t\t);\n\t},\n\n\tEMPTY_BUNDLE: () => {\n\t\ttitle(`Generated an empty bundle`);\n\t}\n};\n\n// TODO select sensible priorities\nconst deferredHandlers: {\n\t[code: string]: {\n\t\tfn: (warnings: RollupWarning[]) => void;\n\t\tpriority: number;\n\t};\n} = {\n\tUNUSED_EXTERNAL_IMPORT: {\n\t\tfn: warnings => {\n\t\t\ttitle('Unused external imports');\n\t\t\twarnings.forEach(warning => {\n\t\t\t\tstderr(`${warning.names} imported from external module '${warning.source}' but never used`);\n\t\t\t});\n\t\t},\n\t\tpriority: 1\n\t},\n\n\tUNRESOLVED_IMPORT: {\n\t\tfn: warnings => {\n\t\t\ttitle('Unresolved dependencies');\n\t\t\tinfo('https://rollupjs.org/guide/en/#warning-treating-module-as-external-dependency');\n\n\t\t\tconst dependencies = new Map();\n\t\t\twarnings.forEach(warning => {\n\t\t\t\tif (!dependencies.has(warning.source)) dependencies.set(warning.source, []);\n\t\t\t\tdependencies.get(warning.source).push(warning.importer);\n\t\t\t});\n\n\t\t\tArray.from(dependencies.keys()).forEach(dependency => {\n\t\t\t\tconst importers = dependencies.get(dependency);\n\t\t\t\tstderr(`${tc.bold(dependency)} (imported by ${importers.join(', ')})`);\n\t\t\t});\n\t\t},\n\t\tpriority: 1\n\t},\n\n\tMISSING_EXPORT: {\n\t\tfn: warnings => {\n\t\t\ttitle('Missing exports');\n\t\t\tinfo('https://rollupjs.org/guide/en/#error-name-is-not-exported-by-module-');\n\n\t\t\twarnings.forEach(warning => {\n\t\t\t\tstderr(tc.bold(warning.importer as string));\n\t\t\t\tstderr(`${warning.missing} is not exported by ${warning.exporter}`);\n\t\t\t\tstderr(tc.gray(warning.frame as string));\n\t\t\t});\n\t\t},\n\t\tpriority: 1\n\t},\n\n\tTHIS_IS_UNDEFINED: {\n\t\tfn: warnings => {\n\t\t\ttitle('`this` has been rewritten to `undefined`');\n\t\t\tinfo('https://rollupjs.org/guide/en/#error-this-is-undefined');\n\t\t\tshowTruncatedWarnings(warnings);\n\t\t},\n\t\tpriority: 1\n\t},\n\n\tEVAL: {\n\t\tfn: warnings => {\n\t\t\ttitle('Use of eval is strongly discouraged');\n\t\t\tinfo('https://rollupjs.org/guide/en/#avoiding-eval');\n\t\t\tshowTruncatedWarnings(warnings);\n\t\t},\n\t\tpriority: 1\n\t},\n\n\tNON_EXISTENT_EXPORT: {\n\t\tfn: warnings => {\n\t\t\ttitle(`Import of non-existent ${warnings.length > 1 ? 'exports' : 'export'}`);\n\t\t\tshowTruncatedWarnings(warnings);\n\t\t},\n\t\tpriority: 1\n\t},\n\n\tNAMESPACE_CONFLICT: {\n\t\tfn: warnings => {\n\t\t\ttitle(`Conflicting re-exports`);\n\t\t\twarnings.forEach(warning => {\n\t\t\t\tstderr(\n\t\t\t\t\t`${tc.bold(relativeId(warning.reexporter as string))} re-exports '${\n\t\t\t\t\t\twarning.name\n\t\t\t\t\t}' from both ${relativeId((warning.sources as string[])[0])} and ${relativeId(\n\t\t\t\t\t\t(warning.sources as string[])[1]\n\t\t\t\t\t)} (will be ignored)`\n\t\t\t\t);\n\t\t\t});\n\t\t},\n\t\tpriority: 1\n\t},\n\n\tMISSING_GLOBAL_NAME: {\n\t\tfn: warnings => {\n\t\t\ttitle(`Missing global variable ${warnings.length > 1 ? 'names' : 'name'}`);\n\t\t\tstderr(\n\t\t\t\t`Use output.globals to specify browser global variable names corresponding to external modules`\n\t\t\t);\n\t\t\twarnings.forEach(warning => {\n\t\t\t\tstderr(`${tc.bold(warning.source as string)} (guessing '${warning.guess}')`);\n\t\t\t});\n\t\t},\n\t\tpriority: 1\n\t},\n\n\tSOURCEMAP_BROKEN: {\n\t\tfn: warnings => {\n\t\t\ttitle(`Broken sourcemap`);\n\t\t\tinfo('https://rollupjs.org/guide/en/#warning-sourcemap-is-likely-to-be-incorrect');\n\n\t\t\tconst plugins = Array.from(new Set(warnings.map(w => w.plugin).filter(Boolean)));\n\t\t\tconst detail =\n\t\t\t\tplugins.length === 0\n\t\t\t\t\t? ''\n\t\t\t\t\t: plugins.length > 1\n\t\t\t\t\t? ` (such as ${plugins\n\t\t\t\t\t\t\t.slice(0, -1)\n\t\t\t\t\t\t\t.map(p => `'${p}'`)\n\t\t\t\t\t\t\t.join(', ')} and '${plugins.slice(-1)}')`\n\t\t\t\t\t: ` (such as '${plugins[0]}')`;\n\n\t\t\tstderr(`Plugins that transform code${detail} should generate accompanying sourcemaps`);\n\t\t},\n\t\tpriority: 1\n\t},\n\n\tPLUGIN_WARNING: {\n\t\tfn: warnings => {\n\t\t\tconst nestedByPlugin = nest(warnings, 'plugin');\n\n\t\t\tnestedByPlugin.forEach(({ key: plugin, items }) => {\n\t\t\t\tconst nestedByMessage = nest(items, 'message');\n\n\t\t\t\tlet lastUrl: string;\n\n\t\t\t\tnestedByMessage.forEach(({ key: message, items }) => {\n\t\t\t\t\ttitle(`Plugin ${plugin}: ${message}`);\n\t\t\t\t\titems.forEach(warning => {\n\t\t\t\t\t\tif (warning.url !== lastUrl) info((lastUrl = warning.url as string));\n\n\t\t\t\t\t\tif (warning.id) {\n\t\t\t\t\t\t\tlet loc = relativeId(warning.id);\n\t\t\t\t\t\t\tif (warning.loc) {\n\t\t\t\t\t\t\t\tloc += `: (${warning.loc.line}:${warning.loc.column})`;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tstderr(tc.bold(loc));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (warning.frame) info(warning.frame);\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t});\n\t\t},\n\t\tpriority: 1\n\t}\n};\n\nfunction title(str: string) {\n\tstderr(`${tc.bold.yellow('(!)')} ${tc.bold.yellow(str)}`);\n}\n\nfunction info(url: string) {\n\tstderr(tc.gray(url));\n}\n\nfunction nest(array: T[], prop: string) {\n\tconst nested: { items: T[]; key: string }[] = [];\n\tconst lookup = new Map();\n\n\tarray.forEach(item => {\n\t\tconst key = (item as any)[prop];\n\t\tif (!lookup.has(key)) {\n\t\t\tlookup.set(key, {\n\t\t\t\titems: [],\n\t\t\t\tkey\n\t\t\t});\n\n\t\t\tnested.push(lookup.get(key) as { items: T[]; key: string });\n\t\t}\n\n\t\t(lookup.get(key) as { items: T[]; key: string }).items.push(item);\n\t});\n\n\treturn nested;\n}\n\nfunction showTruncatedWarnings(warnings: RollupWarning[]) {\n\tconst nestedByModule = nest(warnings, 'id');\n\n\tconst sliced = nestedByModule.length > 5 ? nestedByModule.slice(0, 3) : nestedByModule;\n\tsliced.forEach(({ key: id, items }) => {\n\t\tstderr(tc.bold(relativeId(id)));\n\t\tstderr(tc.gray(items[0].frame as string));\n\n\t\tif (items.length > 1) {\n\t\t\tstderr(`...and ${items.length - 1} other ${items.length > 2 ? 'occurrences' : 'occurrence'}`);\n\t\t}\n\t});\n\n\tif (nestedByModule.length > sliced.length) {\n\t\tstderr(`\\n...and ${nestedByModule.length - sliced.length} other files`);\n\t}\n}\n","'use strict';\nmodule.exports = milliseconds => {\n\tif (typeof milliseconds !== 'number') {\n\t\tthrow new TypeError('Expected a number');\n\t}\n\n\tconst roundTowardsZero = milliseconds > 0 ? Math.floor : Math.ceil;\n\n\treturn {\n\t\tdays: roundTowardsZero(milliseconds / 86400000),\n\t\thours: roundTowardsZero(milliseconds / 3600000) % 24,\n\t\tminutes: roundTowardsZero(milliseconds / 60000) % 60,\n\t\tseconds: roundTowardsZero(milliseconds / 1000) % 60,\n\t\tmilliseconds: roundTowardsZero(milliseconds) % 1000,\n\t\tmicroseconds: roundTowardsZero(milliseconds * 1000) % 1000,\n\t\tnanoseconds: roundTowardsZero(milliseconds * 1e6) % 1000\n\t};\n};\n","'use strict';\nconst parseMilliseconds = require('parse-ms');\n\nconst pluralize = (word, count) => count === 1 ? word : word + 's';\n\nmodule.exports = (milliseconds, options = {}) => {\n\tif (!Number.isFinite(milliseconds)) {\n\t\tthrow new TypeError('Expected a finite number');\n\t}\n\n\tif (options.compact) {\n\t\toptions.secondsDecimalDigits = 0;\n\t\toptions.millisecondsDecimalDigits = 0;\n\t}\n\n\tconst result = [];\n\n\tconst add = (value, long, short, valueString) => {\n\t\tif (value === 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst postfix = options.verbose ? ' ' + pluralize(long, value) : short;\n\n\t\tresult.push((valueString || value) + postfix);\n\t};\n\n\tconst secondsDecimalDigits =\n\t\ttypeof options.secondsDecimalDigits === 'number' ?\n\t\t\toptions.secondsDecimalDigits :\n\t\t\t1;\n\n\tif (secondsDecimalDigits < 1) {\n\t\tconst difference = 1000 - (milliseconds % 1000);\n\t\tif (difference < 500) {\n\t\t\tmilliseconds += difference;\n\t\t}\n\t}\n\n\tconst parsed = parseMilliseconds(milliseconds);\n\n\tadd(Math.trunc(parsed.days / 365), 'year', 'y');\n\tadd(parsed.days % 365, 'day', 'd');\n\tadd(parsed.hours, 'hour', 'h');\n\tadd(parsed.minutes, 'minute', 'm');\n\n\tif (\n\t\toptions.separateMilliseconds ||\n\t\toptions.formatSubMilliseconds ||\n\t\tmilliseconds < 1000\n\t) {\n\t\tadd(parsed.seconds, 'second', 's');\n\t\tif (options.formatSubMilliseconds) {\n\t\t\tadd(parsed.milliseconds, 'millisecond', 'ms');\n\t\t\tadd(parsed.microseconds, 'microsecond', 'µs');\n\t\t\tadd(parsed.nanoseconds, 'nanosecond', 'ns');\n\t\t} else {\n\t\t\tconst millisecondsAndBelow =\n\t\t\t\tparsed.milliseconds +\n\t\t\t\t(parsed.microseconds / 1000) +\n\t\t\t\t(parsed.nanoseconds / 1e6);\n\n\t\t\tconst millisecondsDecimalDigits =\n\t\t\t\ttypeof options.millisecondsDecimalDigits === 'number' ?\n\t\t\t\t\toptions.millisecondsDecimalDigits :\n\t\t\t\t\t0;\n\n\t\t\tconst millisecondsString = millisecondsDecimalDigits ?\n\t\t\t\tmillisecondsAndBelow.toFixed(millisecondsDecimalDigits) :\n\t\t\t\tMath.ceil(millisecondsAndBelow);\n\n\t\t\tadd(\n\t\t\t\tparseFloat(millisecondsString, 10),\n\t\t\t\t'millisecond',\n\t\t\t\t'ms',\n\t\t\t\tmillisecondsString\n\t\t\t);\n\t\t}\n\t} else {\n\t\tconst seconds = (milliseconds / 1000) % 60;\n\t\tconst secondsDecimalDigits =\n\t\t\ttypeof options.secondsDecimalDigits === 'number' ?\n\t\t\t\toptions.secondsDecimalDigits :\n\t\t\t\t1;\n\t\tconst secondsFixed = seconds.toFixed(secondsDecimalDigits);\n\t\tconst secondsString = options.keepDecimalsOnWholeSeconds ?\n\t\t\tsecondsFixed :\n\t\t\tsecondsFixed.replace(/\\.0+$/, '');\n\t\tadd(parseFloat(secondsString, 10), 'second', 's', secondsString);\n\t}\n\n\tif (result.length === 0) {\n\t\treturn '0' + (options.verbose ? ' milliseconds' : 'ms');\n\t}\n\n\tif (options.compact) {\n\t\treturn '~' + result[0];\n\t}\n\n\tif (typeof options.unitCount === 'number') {\n\t\treturn '~' + result.slice(0, Math.max(options.unitCount, 1)).join(' ');\n\t}\n\n\treturn result.join(' ');\n};\n","let SOURCEMAPPING_URL = 'sourceMa';\nSOURCEMAPPING_URL += 'ppingURL';\n\nexport default SOURCEMAPPING_URL;\n","'use strict';\n\nconst UNITS = [\n\t'B',\n\t'kB',\n\t'MB',\n\t'GB',\n\t'TB',\n\t'PB',\n\t'EB',\n\t'ZB',\n\t'YB'\n];\n\n/*\nFormats the given number using `Number#toLocaleString`.\n- If locale is a string, the value is expected to be a locale-key (for example: `de`).\n- If locale is true, the system default locale is used for translation.\n- If no value for locale is specified, the number is returned unmodified.\n*/\nconst toLocaleString = (number, locale) => {\n\tlet result = number;\n\tif (typeof locale === 'string') {\n\t\tresult = number.toLocaleString(locale);\n\t} else if (locale === true) {\n\t\tresult = number.toLocaleString();\n\t}\n\n\treturn result;\n};\n\nmodule.exports = (number, options) => {\n\tif (!Number.isFinite(number)) {\n\t\tthrow new TypeError(`Expected a finite number, got ${typeof number}: ${number}`);\n\t}\n\n\toptions = Object.assign({}, options);\n\n\tif (options.signed && number === 0) {\n\t\treturn ' 0 B';\n\t}\n\n\tconst isNegative = number < 0;\n\tconst prefix = isNegative ? '-' : (options.signed ? '+' : '');\n\n\tif (isNegative) {\n\t\tnumber = -number;\n\t}\n\n\tif (number < 1) {\n\t\tconst numberString = toLocaleString(number, options.locale);\n\t\treturn prefix + numberString + ' B';\n\t}\n\n\tconst exponent = Math.min(Math.floor(Math.log10(number) / 3), UNITS.length - 1);\n\t// eslint-disable-next-line unicorn/prefer-exponentiation-operator\n\tnumber = Number((number / Math.pow(1000, exponent)).toPrecision(3));\n\tconst numberString = toLocaleString(number, options.locale);\n\n\tconst unit = UNITS[exponent];\n\n\treturn prefix + numberString + ' ' + unit;\n};\n","import prettyBytes from 'pretty-bytes';\nimport tc from 'turbocolor';\nimport { SerializedTimings } from '../../../src/rollup/types';\n\nexport function printTimings(timings: SerializedTimings) {\n\tObject.keys(timings).forEach(label => {\n\t\tconst color =\n\t\t\tlabel[0] === '#' ? (label[1] !== '#' ? tc.underline : tc.bold) : (text: string) => text;\n\t\tconst [time, memory, total] = timings[label];\n\t\tconst row = `${label}: ${time.toFixed(0)}ms, ${prettyBytes(memory)} / ${prettyBytes(total)}`;\n\t\tconsole.info(color(row));\n\t});\n}\n","import ms from 'pretty-ms';\nimport * as rollup from 'rollup';\nimport tc from 'turbocolor';\nimport {\n\tInputOptions,\n\tOutputAsset,\n\tOutputChunk,\n\tOutputOptions,\n\tRollupBuild,\n\tSourceMap\n} from '../../../src/rollup/types';\nimport relativeId from '../../../src/utils/relativeId';\nimport { handleError, stderr } from '../logging';\nimport SOURCEMAPPING_URL from '../sourceMappingUrl';\nimport { BatchWarnings } from './batchWarnings';\nimport { printTimings } from './timings';\n\nexport default function build(\n\tinputOptions: InputOptions,\n\toutputOptions: OutputOptions[],\n\twarnings: BatchWarnings,\n\tsilent = false\n) {\n\tconst useStdout = !outputOptions[0].file && !outputOptions[0].dir;\n\n\tconst start = Date.now();\n\tconst files = useStdout\n\t\t? ['stdout']\n\t\t: outputOptions.map(t => relativeId(t.file || (t.dir as string)));\n\tif (!silent) {\n\t\tlet inputFiles: string = undefined as any;\n\t\tif (typeof inputOptions.input === 'string') {\n\t\t\tinputFiles = inputOptions.input;\n\t\t} else if (inputOptions.input instanceof Array) {\n\t\t\tinputFiles = inputOptions.input.join(', ');\n\t\t} else if (typeof inputOptions.input === 'object' && inputOptions.input !== null) {\n\t\t\tinputFiles = Object.keys(inputOptions.input)\n\t\t\t\t.map(name => (inputOptions.input as Record)[name])\n\t\t\t\t.join(', ');\n\t\t}\n\t\tstderr(tc.cyan(`\\n${tc.bold(inputFiles)} → ${tc.bold(files.join(', '))}...`));\n\t}\n\n\treturn rollup\n\t\t.rollup(inputOptions)\n\t\t.then((bundle: RollupBuild) => {\n\t\t\tif (useStdout) {\n\t\t\t\tconst output = outputOptions[0];\n\t\t\t\tif (output.sourcemap && output.sourcemap !== 'inline') {\n\t\t\t\t\thandleError({\n\t\t\t\t\t\tcode: 'MISSING_OUTPUT_OPTION',\n\t\t\t\t\t\tmessage: 'You must specify a --file (-o) option when creating a file with a sourcemap'\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\treturn bundle.generate(output).then(({ output: outputs }) => {\n\t\t\t\t\tfor (const file of outputs) {\n\t\t\t\t\t\tlet source: string | Buffer;\n\t\t\t\t\t\tif ((file as OutputAsset).isAsset) {\n\t\t\t\t\t\t\tsource = (file as OutputAsset).source;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tsource = (file as OutputChunk).code;\n\t\t\t\t\t\t\tif (output.sourcemap === 'inline') {\n\t\t\t\t\t\t\t\tsource += `\\n//# ${SOURCEMAPPING_URL}=${((file as OutputChunk)\n\t\t\t\t\t\t\t\t\t.map as SourceMap).toUrl()}\\n`;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (outputs.length > 1)\n\t\t\t\t\t\t\tprocess.stdout.write('\\n' + tc.cyan(tc.bold('//→ ' + file.fileName + ':')) + '\\n');\n\t\t\t\t\t\tprocess.stdout.write(source);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\n\t\t\treturn Promise.all(outputOptions.map(output => bundle.write(output) as Promise)).then(\n\t\t\t\t() => bundle\n\t\t\t);\n\t\t})\n\t\t.then((bundle?: RollupBuild) => {\n\t\t\tif (!silent) {\n\t\t\t\twarnings.flush();\n\t\t\t\tstderr(\n\t\t\t\t\ttc.green(`created ${tc.bold(files.join(', '))} in ${tc.bold(ms(Date.now() - start))}`)\n\t\t\t\t);\n\t\t\t\tif (bundle && bundle.getTimings) {\n\t\t\t\t\tprintTimings(bundle.getTimings());\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t\t.catch((err: any) => {\n\t\t\tif (warnings.count > 0) warnings.flush();\n\t\t\thandleError(err);\n\t\t});\n}\n","import path from 'path';\nimport rollup from 'rollup';\nimport tc from 'turbocolor';\nimport { RollupBuild, RollupOutput } from '../../../src/rollup/types';\nimport { GenericConfigObject } from '../../../src/utils/mergeOptions';\nimport relativeId from '../../../src/utils/relativeId';\nimport { handleError, stderr } from '../logging';\nimport batchWarnings from './batchWarnings';\n\ninterface NodeModuleWithCompile extends NodeModule {\n\t_compile(code: string, filename: string): any;\n}\n\nexport default function loadConfigFile(\n\tconfigFile: string,\n\tcommandOptions: any = {}\n): Promise {\n\tconst silent = commandOptions.silent || false;\n\tconst warnings = batchWarnings();\n\n\treturn rollup\n\t\t.rollup({\n\t\t\texternal: (id: string) =>\n\t\t\t\t(id[0] !== '.' && !path.isAbsolute(id)) || id.slice(-5, id.length) === '.json',\n\t\t\tinput: configFile,\n\t\t\tonwarn: warnings.add,\n\t\t\ttreeshake: false\n\t\t})\n\t\t.then((bundle: RollupBuild) => {\n\t\t\tif (!silent && warnings.count > 0) {\n\t\t\t\tstderr(tc.bold(`loaded ${relativeId(configFile)} with warnings`));\n\t\t\t\twarnings.flush();\n\t\t\t}\n\n\t\t\treturn bundle.generate({\n\t\t\t\texports: 'named',\n\t\t\t\tformat: 'cjs'\n\t\t\t});\n\t\t})\n\t\t.then(({ output: [{ code }] }: RollupOutput) => {\n\t\t\t// temporarily override require\n\t\t\tconst defaultLoader = require.extensions['.js'];\n\t\t\trequire.extensions['.js'] = (module: NodeModule, filename: string) => {\n\t\t\t\tif (filename === configFile) {\n\t\t\t\t\t(module as NodeModuleWithCompile)._compile(code, filename);\n\t\t\t\t} else {\n\t\t\t\t\tdefaultLoader(module, filename);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tdelete require.cache[configFile];\n\n\t\t\treturn Promise.resolve(require(configFile))\n\t\t\t\t.then(configFileContent => {\n\t\t\t\t\tif (configFileContent.default) configFileContent = configFileContent.default;\n\t\t\t\t\tif (typeof configFileContent === 'function') {\n\t\t\t\t\t\treturn configFileContent(commandOptions);\n\t\t\t\t\t}\n\t\t\t\t\treturn configFileContent;\n\t\t\t\t})\n\t\t\t\t.then(configs => {\n\t\t\t\t\tif (Object.keys(configs).length === 0) {\n\t\t\t\t\t\thandleError({\n\t\t\t\t\t\t\tcode: 'MISSING_CONFIG',\n\t\t\t\t\t\t\tmessage: 'Config file must export an options object, or an array of options objects',\n\t\t\t\t\t\t\turl: 'https://rollupjs.org/guide/en/#configuration-files'\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\trequire.extensions['.js'] = defaultLoader;\n\n\t\t\t\t\treturn Array.isArray(configs) ? configs : [configs];\n\t\t\t\t});\n\t\t});\n}\n","'use strict';\nmodule.exports = date => {\n\tconst offset = (date || new Date()).getTimezoneOffset();\n\tconst absOffset = Math.abs(offset);\n\tconst hours = Math.floor(absOffset / 60);\n\tconst minutes = absOffset % 60;\n\tconst minutesOut = minutes > 0 ? ':' + ('0' + minutes).slice(-2) : '';\n\n\treturn (offset < 0 ? '+' : '-') + hours + minutesOut;\n};\n","'use strict';\nconst timeZone = require('time-zone');\n\nconst dateTime = options => {\n\toptions = Object.assign({\n\t\tdate: new Date(),\n\t\tlocal: true,\n\t\tshowTimeZone: false,\n\t\tshowMilliseconds: false\n\t}, options);\n\n\tlet {date} = options;\n\n\tif (options.local) {\n\t\t// Offset the date so it will return the correct value when getting the ISO string\n\t\tdate = new Date(date.getTime() - (date.getTimezoneOffset() * 60000));\n\t}\n\n\tlet end = '';\n\n\tif (options.showTimeZone) {\n\t\tend = ' UTC' + (options.local ? timeZone(date) : '');\n\t}\n\n\tif (options.showMilliseconds && date.getUTCMilliseconds() > 0) {\n\t\tend = ` ${date.getUTCMilliseconds()}ms${end}`;\n\t}\n\n\treturn date\n\t\t.toISOString()\n\t\t.replace(/T/, ' ')\n\t\t.replace(/\\..+/, end);\n};\n\nmodule.exports = dateTime;\n// TODO: Remove this for the next major release\nmodule.exports.default = dateTime;\n","// This is not the set of all possible signals.\n//\n// It IS, however, the set of all signals that trigger\n// an exit on either Linux or BSD systems. Linux is a\n// superset of the signal names supported on BSD, and\n// the unknown signals just fail to register, so we can\n// catch that easily enough.\n//\n// Don't bother with SIGKILL. It's uncatchable, which\n// means that we can't fire any callbacks anyway.\n//\n// If a user does happen to register a handler on a non-\n// fatal signal like SIGWINCH or something, and then\n// exit, it'll end up firing `process.emit('exit')`, so\n// the handler will be fired anyway.\n//\n// SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised\n// artificially, inherently leave the process in a\n// state from which it is not safe to try and enter JS\n// listeners.\nmodule.exports = [\n 'SIGABRT',\n 'SIGALRM',\n 'SIGHUP',\n 'SIGINT',\n 'SIGTERM'\n]\n\nif (process.platform !== 'win32') {\n module.exports.push(\n 'SIGVTALRM',\n 'SIGXCPU',\n 'SIGXFSZ',\n 'SIGUSR2',\n 'SIGTRAP',\n 'SIGSYS',\n 'SIGQUIT',\n 'SIGIOT'\n // should detect profiler and enable/disable accordingly.\n // see #21\n // 'SIGPROF'\n )\n}\n\nif (process.platform === 'linux') {\n module.exports.push(\n 'SIGIO',\n 'SIGPOLL',\n 'SIGPWR',\n 'SIGSTKFLT',\n 'SIGUNUSED'\n )\n}\n","// Note: since nyc uses this module to output coverage, any lines\n// that are in the direct sync flow of nyc's outputCoverage are\n// ignored, since we can never get coverage for them.\nvar assert = require('assert')\nvar signals = require('./signals.js')\n\nvar EE = require('events')\n/* istanbul ignore if */\nif (typeof EE !== 'function') {\n EE = EE.EventEmitter\n}\n\nvar emitter\nif (process.__signal_exit_emitter__) {\n emitter = process.__signal_exit_emitter__\n} else {\n emitter = process.__signal_exit_emitter__ = new EE()\n emitter.count = 0\n emitter.emitted = {}\n}\n\n// Because this emitter is a global, we have to check to see if a\n// previous version of this library failed to enable infinite listeners.\n// I know what you're about to say. But literally everything about\n// signal-exit is a compromise with evil. Get used to it.\nif (!emitter.infinite) {\n emitter.setMaxListeners(Infinity)\n emitter.infinite = true\n}\n\nmodule.exports = function (cb, opts) {\n assert.equal(typeof cb, 'function', 'a callback must be provided for exit handler')\n\n if (loaded === false) {\n load()\n }\n\n var ev = 'exit'\n if (opts && opts.alwaysLast) {\n ev = 'afterexit'\n }\n\n var remove = function () {\n emitter.removeListener(ev, cb)\n if (emitter.listeners('exit').length === 0 &&\n emitter.listeners('afterexit').length === 0) {\n unload()\n }\n }\n emitter.on(ev, cb)\n\n return remove\n}\n\nmodule.exports.unload = unload\nfunction unload () {\n if (!loaded) {\n return\n }\n loaded = false\n\n signals.forEach(function (sig) {\n try {\n process.removeListener(sig, sigListeners[sig])\n } catch (er) {}\n })\n process.emit = originalProcessEmit\n process.reallyExit = originalProcessReallyExit\n emitter.count -= 1\n}\n\nfunction emit (event, code, signal) {\n if (emitter.emitted[event]) {\n return\n }\n emitter.emitted[event] = true\n emitter.emit(event, code, signal)\n}\n\n// { : , ... }\nvar sigListeners = {}\nsignals.forEach(function (sig) {\n sigListeners[sig] = function listener () {\n // If there are no other listeners, an exit is coming!\n // Simplest way: remove us and then re-send the signal.\n // We know that this will kill the process, so we can\n // safely emit now.\n var listeners = process.listeners(sig)\n if (listeners.length === emitter.count) {\n unload()\n emit('exit', null, sig)\n /* istanbul ignore next */\n emit('afterexit', null, sig)\n /* istanbul ignore next */\n process.kill(process.pid, sig)\n }\n }\n})\n\nmodule.exports.signals = function () {\n return signals\n}\n\nmodule.exports.load = load\n\nvar loaded = false\n\nfunction load () {\n if (loaded) {\n return\n }\n loaded = true\n\n // This is the number of onSignalExit's that are in play.\n // It's important so that we can count the correct number of\n // listeners on signals, and don't wait for the other one to\n // handle it instead of us.\n emitter.count += 1\n\n signals = signals.filter(function (sig) {\n try {\n process.on(sig, sigListeners[sig])\n return true\n } catch (er) {\n return false\n }\n })\n\n process.emit = processEmit\n process.reallyExit = processReallyExit\n}\n\nvar originalProcessReallyExit = process.reallyExit\nfunction processReallyExit (code) {\n process.exitCode = code || 0\n emit('exit', process.exitCode, null)\n /* istanbul ignore next */\n emit('afterexit', process.exitCode, null)\n /* istanbul ignore next */\n originalProcessReallyExit.call(process, process.exitCode)\n}\n\nvar originalProcessEmit = process.emit\nfunction processEmit (ev, arg) {\n if (ev === 'exit') {\n if (arg !== undefined) {\n process.exitCode = arg\n }\n var ret = originalProcessEmit.apply(this, arguments)\n emit('exit', process.exitCode, null)\n /* istanbul ignore next */\n emit('afterexit', process.exitCode, null)\n return ret\n } else {\n return originalProcessEmit.apply(this, arguments)\n }\n}\n","import { stderr } from '../logging';\n\nconst CLEAR_SCREEN = '\\u001Bc';\n\nexport function getResetScreen(clearScreen: boolean) {\n\tif (clearScreen) {\n\t\treturn (heading: string) => stderr(CLEAR_SCREEN + heading);\n\t}\n\n\tlet firstRun = true;\n\treturn (heading: string) => {\n\t\tif (firstRun) {\n\t\t\tstderr(heading);\n\t\t\tfirstRun = false;\n\t\t}\n\t};\n}\n","import dateTime from 'date-time';\nimport fs from 'fs';\nimport ms from 'pretty-ms';\nimport * as rollup from 'rollup';\nimport onExit from 'signal-exit';\nimport tc from 'turbocolor';\nimport {\n\tInputOption,\n\tRollupBuild,\n\tRollupError,\n\tRollupWatchOptions,\n\tWarningHandler,\n\tWatcherOptions\n} from '../../../src/rollup/types';\nimport mergeOptions, { GenericConfigObject } from '../../../src/utils/mergeOptions';\nimport relativeId from '../../../src/utils/relativeId';\nimport { handleError, stderr } from '../logging';\nimport batchWarnings from './batchWarnings';\nimport loadConfigFile from './loadConfigFile';\nimport { getResetScreen } from './resetScreen';\nimport { printTimings } from './timings';\n\ninterface WatchEvent {\n\tcode?: string;\n\tduration?: number;\n\terror?: RollupError | Error;\n\tinput?: InputOption;\n\toutput?: string[];\n\tresult?: RollupBuild;\n}\n\ninterface Watcher {\n\tclose: () => void;\n\ton: (event: string, fn: (event: WatchEvent) => void) => void;\n}\n\nexport default function watch(\n\tconfigFile: string,\n\tconfigs: GenericConfigObject[],\n\tcommand: any,\n\tsilent = false\n) {\n\tconst isTTY = Boolean(process.stderr.isTTY);\n\tconst warnings = batchWarnings();\n\tconst initialConfigs = processConfigs(configs);\n\tconst clearScreen = initialConfigs.every(\n\t\tconfig => (config.watch as WatcherOptions).clearScreen !== false\n\t);\n\n\tconst resetScreen = getResetScreen(isTTY && clearScreen);\n\tlet watcher: Watcher;\n\tlet configWatcher: Watcher;\n\n\tfunction processConfigs(configs: GenericConfigObject[]): RollupWatchOptions[] {\n\t\treturn configs.map(options => {\n\t\t\tconst merged = mergeOptions({\n\t\t\t\tcommand,\n\t\t\t\tconfig: options,\n\t\t\t\tdefaultOnWarnHandler: warnings.add\n\t\t\t});\n\n\t\t\tconst result: RollupWatchOptions = {\n\t\t\t\t...merged.inputOptions,\n\t\t\t\toutput: merged.outputOptions\n\t\t\t};\n\n\t\t\tif (!result.watch) result.watch = {};\n\n\t\t\tif (merged.optionError)\n\t\t\t\t(merged.inputOptions.onwarn as WarningHandler)({\n\t\t\t\t\tcode: 'UNKNOWN_OPTION',\n\t\t\t\t\tmessage: merged.optionError\n\t\t\t\t});\n\n\t\t\treturn result;\n\t\t});\n\t}\n\n\tfunction start(configs: RollupWatchOptions[]) {\n\t\twatcher = rollup.watch(configs);\n\n\t\twatcher.on('event', (event: WatchEvent) => {\n\t\t\tswitch (event.code) {\n\t\t\t\tcase 'FATAL':\n\t\t\t\t\thandleError(event.error as RollupError, true);\n\t\t\t\t\tprocess.exit(1);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'ERROR':\n\t\t\t\t\twarnings.flush();\n\t\t\t\t\thandleError(event.error as RollupError, true);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'START':\n\t\t\t\t\tif (!silent) {\n\t\t\t\t\t\tresetScreen(tc.underline(`rollup v${rollup.VERSION}`));\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'BUNDLE_START':\n\t\t\t\t\tif (!silent) {\n\t\t\t\t\t\tlet input = event.input;\n\t\t\t\t\t\tif (typeof input !== 'string') {\n\t\t\t\t\t\t\tinput = Array.isArray(input)\n\t\t\t\t\t\t\t\t? input.join(', ')\n\t\t\t\t\t\t\t\t: Object.keys(input as Record)\n\t\t\t\t\t\t\t\t\t\t.map(key => (input as Record)[key])\n\t\t\t\t\t\t\t\t\t\t.join(', ');\n\t\t\t\t\t\t}\n\t\t\t\t\t\tstderr(\n\t\t\t\t\t\t\ttc.cyan(\n\t\t\t\t\t\t\t\t`bundles ${tc.bold(input)} → ${tc.bold(\n\t\t\t\t\t\t\t\t\t(event.output as string[]).map(relativeId).join(', ')\n\t\t\t\t\t\t\t\t)}...`\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'BUNDLE_END':\n\t\t\t\t\twarnings.flush();\n\t\t\t\t\tif (!silent)\n\t\t\t\t\t\tstderr(\n\t\t\t\t\t\t\ttc.green(\n\t\t\t\t\t\t\t\t`created ${tc.bold(\n\t\t\t\t\t\t\t\t\t(event.output as string[]).map(relativeId).join(', ')\n\t\t\t\t\t\t\t\t)} in ${tc.bold(ms(event.duration as number))}`\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t\t\tif (event.result && event.result.getTimings) {\n\t\t\t\t\t\tprintTimings(event.result.getTimings());\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'END':\n\t\t\t\t\tif (!silent && isTTY) {\n\t\t\t\t\t\tstderr(`\\n[${dateTime()}] waiting for changes...`);\n\t\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n\n\t// catch ctrl+c, kill, and uncaught errors\n\tconst removeOnExit = onExit(close);\n\tprocess.on('uncaughtException', close);\n\n\t// only listen to stdin if it is a pipe\n\tif (!process.stdin.isTTY) {\n\t\tprocess.stdin.on('end', close); // in case we ever support stdin!\n\t}\n\n\tfunction close(err: Error) {\n\t\tremoveOnExit();\n\t\tprocess.removeListener('uncaughtException', close);\n\t\t// removing a non-existent listener is a no-op\n\t\tprocess.stdin.removeListener('end', close);\n\n\t\tif (watcher) watcher.close();\n\n\t\tif (configWatcher) configWatcher.close();\n\n\t\tif (err) {\n\t\t\tconsole.error(err);\n\t\t\tprocess.exit(1);\n\t\t}\n\t}\n\n\ttry {\n\t\tstart(initialConfigs);\n\t} catch (err) {\n\t\tclose(err);\n\t\treturn;\n\t}\n\n\tif (configFile && !configFile.startsWith('node:')) {\n\t\tlet restarting = false;\n\t\tlet aborted = false;\n\t\tlet configFileData = fs.readFileSync(configFile, 'utf-8');\n\n\t\tconst restart = () => {\n\t\t\tconst newConfigFileData = fs.readFileSync(configFile, 'utf-8');\n\t\t\tif (newConfigFileData === configFileData) return;\n\t\t\tconfigFileData = newConfigFileData;\n\n\t\t\tif (restarting) {\n\t\t\t\taborted = true;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\trestarting = true;\n\n\t\t\tloadConfigFile(configFile, command)\n\t\t\t\t.then((_configs: RollupWatchOptions[]) => {\n\t\t\t\t\trestarting = false;\n\n\t\t\t\t\tif (aborted) {\n\t\t\t\t\t\taborted = false;\n\t\t\t\t\t\trestart();\n\t\t\t\t\t} else {\n\t\t\t\t\t\twatcher.close();\n\t\t\t\t\t\tstart(initialConfigs);\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t\t.catch((err: Error) => {\n\t\t\t\t\thandleError(err, true);\n\t\t\t\t});\n\t\t};\n\n\t\tconfigWatcher = fs.watch(configFile, (event: string) => {\n\t\t\tif (event === 'change') restart();\n\t\t});\n\t}\n}\n","import { realpathSync } from 'fs';\nimport relative from 'require-relative';\nimport { WarningHandler } from '../../../src/rollup/types';\nimport mergeOptions, { GenericConfigObject } from '../../../src/utils/mergeOptions';\nimport { getAliasName } from '../../../src/utils/relativeId';\nimport { handleError } from '../logging';\nimport batchWarnings from './batchWarnings';\nimport build from './build';\nimport loadConfigFile from './loadConfigFile';\nimport watch from './watch';\n\nexport default function runRollup(command: any) {\n\tlet inputSource;\n\tif (command._.length > 0) {\n\t\tif (command.input) {\n\t\t\thandleError({\n\t\t\t\tcode: 'DUPLICATE_IMPORT_OPTIONS',\n\t\t\t\tmessage: 'use --input, or pass input path as argument'\n\t\t\t});\n\t\t}\n\t\tinputSource = command._;\n\t} else if (typeof command.input === 'string') {\n\t\tinputSource = [command.input];\n\t} else {\n\t\tinputSource = command.input;\n\t}\n\n\tif (inputSource && inputSource.length > 0) {\n\t\tif (inputSource.some((input: string) => input.indexOf('=') !== -1)) {\n\t\t\tcommand.input = {};\n\t\t\tinputSource.forEach((input: string) => {\n\t\t\t\tconst equalsIndex = input.indexOf('=');\n\t\t\t\tconst value = input.substr(equalsIndex + 1);\n\t\t\t\tlet key = input.substr(0, equalsIndex);\n\t\t\t\tif (!key) key = getAliasName(input);\n\t\t\t\tcommand.input[key] = value;\n\t\t\t});\n\t\t} else {\n\t\t\tcommand.input = inputSource;\n\t\t}\n\t}\n\n\tif (command.environment) {\n\t\tconst environment = Array.isArray(command.environment)\n\t\t\t? command.environment\n\t\t\t: [command.environment];\n\n\t\tenvironment.forEach((arg: string) => {\n\t\t\targ.split(',').forEach((pair: string) => {\n\t\t\t\tconst [key, value] = pair.split(':');\n\t\t\t\tif (value) {\n\t\t\t\t\tprocess.env[key] = value;\n\t\t\t\t} else {\n\t\t\t\t\tprocess.env[key] = String(true);\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}\n\n\tlet configFile = command.config === true ? 'rollup.config.js' : command.config;\n\n\tif (configFile) {\n\t\tif (configFile.slice(0, 5) === 'node:') {\n\t\t\tconst pkgName = configFile.slice(5);\n\t\t\ttry {\n\t\t\t\tconfigFile = relative.resolve(`rollup-config-${pkgName}`, process.cwd());\n\t\t\t} catch (err) {\n\t\t\t\ttry {\n\t\t\t\t\tconfigFile = relative.resolve(pkgName, process.cwd());\n\t\t\t\t} catch (err) {\n\t\t\t\t\tif (err.code === 'MODULE_NOT_FOUND') {\n\t\t\t\t\t\thandleError({\n\t\t\t\t\t\t\tcode: 'MISSING_EXTERNAL_CONFIG',\n\t\t\t\t\t\t\tmessage: `Could not resolve config file ${configFile}`\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\tthrow err;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t// find real path of config so it matches what Node provides to callbacks in require.extensions\n\t\t\tconfigFile = realpathSync(configFile);\n\t\t}\n\n\t\tif (command.watch) process.env.ROLLUP_WATCH = 'true';\n\n\t\tloadConfigFile(configFile, command)\n\t\t\t.then(configs => execute(configFile, configs, command))\n\t\t\t.catch(handleError);\n\t} else {\n\t\treturn execute(configFile, [{ input: null }] as any, command);\n\t}\n}\n\nfunction execute(configFile: string, configs: GenericConfigObject[], command: any) {\n\tif (command.watch) {\n\t\twatch(configFile, configs, command, command.silent);\n\t} else {\n\t\tlet promise = Promise.resolve();\n\t\tfor (const config of configs) {\n\t\t\tpromise = promise.then(() => {\n\t\t\t\tconst warnings = batchWarnings();\n\t\t\t\tconst { inputOptions, outputOptions, optionError } = mergeOptions({\n\t\t\t\t\tcommand,\n\t\t\t\t\tconfig,\n\t\t\t\t\tdefaultOnWarnHandler: warnings.add\n\t\t\t\t});\n\n\t\t\t\tif (optionError)\n\t\t\t\t\t(inputOptions.onwarn as WarningHandler)({ code: 'UNKNOWN_OPTION', message: optionError });\n\t\t\t\treturn build(inputOptions, outputOptions, warnings, command.silent);\n\t\t\t});\n\t\t}\n\t\treturn promise;\n\t}\n}\n","import help from 'help.md';\nimport minimist from 'minimist';\nimport { version } from 'package.json';\nimport { commandAliases } from '../../src/utils/mergeOptions';\nimport run from './run/index';\n\nconst command = minimist(process.argv.slice(2), {\n\talias: commandAliases\n});\n\nif (command.help || (process.argv.length <= 2 && process.stdin.isTTY)) {\n\tconsole.log(`\\n${help.replace('__VERSION__', version)}\\n`);\n} else if (command.version) {\n\tconsole.log(`rollup v${version}`);\n} else {\n\ttry {\n\t\trequire('source-map-support').install();\n\t} catch (err) {\n\t\t// do nothing\n\t}\n\n\trun(command);\n}\n"],"names":["path","Module","basename","extname","relative","tc","parseMilliseconds","rollup\n .rollup","SOURCEMAPPING_URL","ms","rollup","signals","require$$0","require$$1","rollup.watch","rollup.VERSION","dateTime","onExit","fs","realpathSync","run"],"mappings":";;;;;;;;;;;;;;;;;AAAA,YAAc,GAAG,UAAU,IAAI,EAAE,IAAI;IACjC,IAAI,CAAC,IAAI;QAAE,IAAI,GAAG,EAAE,CAAC;IAErB,IAAI,KAAK,GAAG,EAAE,KAAK,EAAG,EAAE,EAAE,OAAO,EAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;IAE1D,IAAI,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,UAAU,EAAE;QACvC,KAAK,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC;KACrC;IAED,IAAI,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,SAAS,IAAI,IAAI,CAAC,SAAS,CAAC,EAAE;QAC3D,KAAK,CAAC,QAAQ,GAAG,IAAI,CAAC;KACvB;SAAM;QACL,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,UAAU,GAAG;YAC5D,KAAK,CAAC,KAAK,CA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AC;oBACjE,OAAO;oBACP,MAAM;oBACN,oBAAoB,EAAE,QAAQ,CAAC,GAAG;iBAClC,CAAC,CAAC;gBAEH,IAAI,WAAW;oBACb,YAAY,CAAC,MAAyB,CAAC,EAAE,IAAI,EAAE,gBAAgB,EAAE,OAAO,EAAE,WAAW,EAAE,CAAC,CAAC;gBAC3F,OAAO,KAAK,CAAC,YAAY,EAAE,aAAa,EAAE,QAAQ,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;aACpE,CAAC,CAAC;SACH;QACD,OAAO,OAAO,CAAC;KACf;CACD;;AC9GD,MAAM,OAAO,GAAG,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE;IAC/C,KAAK,EAAE,cAAc;CACrB,CAAC,CAAC;AAEH,IAAI,OAAO,CAAC,IAAI,KAAK,OAAO,CAAC,IAAI,CAAC,MAAM,IAAI,CAAC,IAAI,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE;IACtE,OAAO,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC,OAAO,CAAC,aAAa,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3D;KAAM,IAAI,OAAO,CAAC,OAAO,EAAE;IAC3B,OAAO,CAAC,GAAG,CAAC,WAAW,OAAO,EAAE,CAAC,CAAC;CAClC;KAAM;IACN,IAAI;QACH,OAAO,CAAC,oBAAoB,CAAC,CAAC,OAAO,EAAE,CAAC;KACxC;IAAC,OAAO,GAAG,EAAE;;KAEb;IAEDC,SAAG,CAAC,OAAO,CAAC,CAAC;CACb"} \ No newline at end of file diff --git a/docs/05-plugin-development.md b/docs/05-plugin-development.md index c641c647958..e42309a8ad3 100644 --- a/docs/05-plugin-development.md +++ b/docs/05-plugin-development.md @@ -72,6 +72,23 @@ In addition to properties defining the identity of your plugin, you may also spe * `sequential`: If this hook returns a promise, then other hooks of this kind will only be executed once this hook has resolved * `parallel`: If this hook returns a promise, then other hooks of this kind will not wait for this hook to be resolved +#### `augmentChunkHash` +Type: `(preRenderedChunk: PreRenderedChunk) => string`
+Kind: `sync, sequential` + +Can be used to augment the hash of individual chunks. Called for each Rollup output chunk. Returning a falsy value will not modify the hash. + +The following plugin will invalidate the hash of chunk `foo` with the timestamp of the last build: + +```javascript +// rollup.config.js +augmentChunkHash(chunkInfo) { + if(chunkInfo.name === 'foo') { + return Date.now(); + } +} +``` + #### `banner` Type: `string | (() => string)`
Kind: `async, parallel` @@ -187,23 +204,6 @@ Kind: `async, parallel` Called initially each time `bundle.generate()` or `bundle.write()` is called. To get notified when generation has completed, use the `generateBundle` and `renderError` hooks. -#### `augmentChunkHash` -Type: `(preRenderedChunk: PreRenderedChunk) => any`
-Kind: `sync, sequential` - -Can be used to augment the hash of individual chunks. Called for each Rollup output chunk. Returning a falsy value will not modify the hash. - -The following plugin will invalidate the hash of chunk `foo` with the timestamp of the last build: - -```javascript -// rollup.config.js -augmentChunkHash(chunkInfo) { - if(chunkInfo.name === 'foo') { - return Date.now(); - } -} -``` - #### `resolveDynamicImport` Type: `(specifier: string | ESTree.Node, importer: string) => string | false | null | {id: string, external?: boolean}`
Kind: `async, first` diff --git a/src/Chunk.ts b/src/Chunk.ts index f96e57f5b93..b07ef826801 100644 --- a/src/Chunk.ts +++ b/src/Chunk.ts @@ -18,6 +18,7 @@ import { DecodedSourceMapOrMissing, GlobalsOption, OutputOptions, + PreRenderedChunk, RenderedChunk, RenderedModule } from './rollup/types'; @@ -136,7 +137,6 @@ export default class Chunk { return chunk; } - augmentedHash?: string; entryModules: Module[] = []; execIndex: number; exportMode: 'none' | 'named' | 'default' = 'named'; @@ -342,9 +342,8 @@ export default class Chunk { if (this.renderedHash) return this.renderedHash; if (!this.renderedSource) return ''; const hash = sha256(); - if (this.augmentedHash) { - hash.update(this.augmentedHash); - } + const hashAugmentation = this.calculateHashAugmentation(); + hash.update(hashAugmentation); hash.update(this.renderedSource.toString()); hash.update( this.getExportNames() @@ -803,6 +802,35 @@ export default class Chunk { } } + private calculateHashAugmentation(): string { + const facadeModule = this.facadeModule; + const getChunkName = this.getChunkName.bind(this); + const preRenderedChunk = { + dynamicImports: this.getDynamicImportIds(), + exports: this.getExportNames(), + facadeModuleId: facadeModule && facadeModule.id, + imports: this.getImportIds(), + isDynamicEntry: facadeModule !== null && facadeModule.dynamicallyImportedBy.length > 0, + isEntry: facadeModule !== null && facadeModule.isEntryPoint, + modules: this.renderedModules, + get name() { + return getChunkName(); + } + } as PreRenderedChunk; + const hashAugmentation = this.graph.pluginDriver.hookReduceValueSync( + 'augmentChunkHash', + '', + [preRenderedChunk], + (hashAugmentation, pluginHash) => { + if (pluginHash) { + hashAugmentation += pluginHash; + } + return hashAugmentation; + } + ); + return hashAugmentation; + } + private computeContentHashWithDependencies(addons: Addons, options: OutputOptions): string { const hash = sha256(); hash.update( diff --git a/src/rollup/index.ts b/src/rollup/index.ts index 045ba240f8c..32c0487baf5 100644 --- a/src/rollup/index.ts +++ b/src/rollup/index.ts @@ -21,7 +21,6 @@ import { OutputChunk, OutputOptions, Plugin, - PreRenderedChunk, RollupBuild, RollupCache, RollupOutput, @@ -148,37 +147,6 @@ export function setWatcher(watcher: RollupWatcher) { curWatcher = watcher; } -function augmentChunkHashes(graph: Graph, chunks: Chunk[]): void { - for (let i = 0; i < chunks.length; i++) { - const chunk = chunks[i]; - const facadeModule = chunk.facadeModule; - const preRenderedChunk = { - dynamicImports: chunk.getDynamicImportIds(), - exports: chunk.getExportNames(), - facadeModuleId: facadeModule && facadeModule.id, - imports: chunk.getImportIds(), - isDynamicEntry: facadeModule !== null && facadeModule.dynamicallyImportedBy.length > 0, - isEntry: facadeModule !== null && facadeModule.isEntryPoint, - modules: chunk.renderedModules, - get name() { - return chunk.getChunkName(); - } - } as PreRenderedChunk; - const augmentedHash = graph.pluginDriver.hookReduceValueSync( - 'augmentChunkHash', - '', - [preRenderedChunk], - (hashForChunk, pluginHash) => { - if (pluginHash) { - hashForChunk += pluginHash; - } - return hashForChunk; - } - ); - chunk.augmentedHash = augmentedHash; - } -} - function assignChunksToBundle( chunks: Chunk[], outputBundle: OutputBundleWithPlaceholders @@ -284,8 +252,6 @@ export default function rollup(rawInputOptions: GenericConfigObject): Promise void; + augmentChunkHash: (this: PluginContext, chunk: PreRenderedChunk) => string | void; buildEnd: (this: PluginContext, err?: Error) => Promise | void; buildStart: (this: PluginContext, options: InputOptions) => Promise | void; generateBundle: ( diff --git a/test/file-hashes/samples/augment-chunk-hash/_config.js b/test/file-hashes/samples/augment-chunk-hash/_config.js index b1e4e197d46..471dc651c1b 100644 --- a/test/file-hashes/samples/augment-chunk-hash/_config.js +++ b/test/file-hashes/samples/augment-chunk-hash/_config.js @@ -9,8 +9,10 @@ module.exports = { }, plugins: [ { - augmentChunkHash() { - return 'bar'; + augmentChunkHash(chunk) { + if (chunk.name === 'dep') { + return 'adfasdf'; + } } } ] diff --git a/test/file-hashes/samples/augment-chunk-hash/main.js b/test/file-hashes/samples/augment-chunk-hash/main.js index 45db37e9b18..47e809f4ee7 100644 --- a/test/file-hashes/samples/augment-chunk-hash/main.js +++ b/test/file-hashes/samples/augment-chunk-hash/main.js @@ -1,3 +1,4 @@ -import {foo} from './dep'; -console.log(foo); -console.log('main'); +import('./dep').then(({foo})=>{ + console.log(foo); + console.log('main'); +}); From e2aac9a2fe5e1779a0e10c4308ac3af0d00214f4 Mon Sep 17 00:00:00 2001 From: isidrok Date: Mon, 12 Aug 2019 21:21:20 +0200 Subject: [PATCH 08/11] restore unchanged files --- src/finalisers/shared/getExportBlock.ts | 5 +---- src/rollup/index.ts | 2 +- test/function/samples/avoid-variable-be-empty/_config.js | 6 +++--- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/finalisers/shared/getExportBlock.ts b/src/finalisers/shared/getExportBlock.ts index 9b0cde992bd..05beb20173c 100644 --- a/src/finalisers/shared/getExportBlock.ts +++ b/src/finalisers/shared/getExportBlock.ts @@ -27,10 +27,7 @@ export default function getExportBlock( if (!dep.reexports) return false; return dep.reexports.some(expt => { if (expt.reexported === 'default') { - local = - dep.namedExportsMode && expt.imported !== '*' - ? `${dep.name}.${expt.imported}` - : dep.name; + local = dep.namedExportsMode && expt.imported !== '*' ? `${dep.name}.${expt.imported}` : dep.name; return true; } return false; diff --git a/src/rollup/index.ts b/src/rollup/index.ts index 32c0487baf5..bc11bab656b 100644 --- a/src/rollup/index.ts +++ b/src/rollup/index.ts @@ -154,6 +154,7 @@ function assignChunksToBundle( for (let i = 0; i < chunks.length; i++) { const chunk = chunks[i]; const facadeModule = chunk.facadeModule; + outputBundle[chunk.id as string] = { code: undefined as any, dynamicImports: chunk.getDynamicImportIds(), @@ -251,7 +252,6 @@ export default function rollup(rawInputOptions: GenericConfigObject): Promise Date: Mon, 12 Aug 2019 21:23:23 +0200 Subject: [PATCH 09/11] allow augmentChunk to return string or void --- src/rollup/types.d.ts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/rollup/types.d.ts b/src/rollup/types.d.ts index 7242fc5e86c..f24e305b4d7 100644 --- a/src/rollup/types.d.ts +++ b/src/rollup/types.d.ts @@ -327,11 +327,7 @@ interface OnWriteOptions extends OutputOptions { } export interface PluginHooks { -<<<<<<< HEAD augmentChunkHash: (this: PluginContext, chunk: PreRenderedChunk) => string | void; -======= - augmentChunkHash: (this: PluginContext, chunk: PreRenderedChunk) => void; ->>>>>>> 237254ce94d3dcf23ec52a2dfb8b693a62cf171f buildEnd: (this: PluginContext, err?: Error) => Promise | void; buildStart: (this: PluginContext, options: InputOptions) => Promise | void; generateBundle: ( From 373f6e9e7049cb7cd9f9b91bbd9e679bb29d5cdc Mon Sep 17 00:00:00 2001 From: isidrok Date: Tue, 13 Aug 2019 16:38:21 +0200 Subject: [PATCH 10/11] update augment-chunk-hash tests --- test/file-hashes/index.js | 1 + .../samples/augment-chunk-hash/_config.js | 22 ++++++++++++++++--- .../samples/augment-chunk-hash/dep.js | 1 - .../samples/augment-chunk-hash/main.js | 5 +---- 4 files changed, 21 insertions(+), 8 deletions(-) delete mode 100644 test/file-hashes/samples/augment-chunk-hash/dep.js diff --git a/test/file-hashes/index.js b/test/file-hashes/index.js index b5843887694..b315fb50d22 100644 --- a/test/file-hashes/index.js +++ b/test/file-hashes/index.js @@ -23,6 +23,7 @@ runTestSuiteWithSamples('file hashes', path.resolve(__dirname, 'samples'), (dir, ) ) ).then(([generated1, generated2]) => { + console.log(generated1, generated2); const fileContentsByHash = new Map(); addAndCheckFileContentsByHash(fileContentsByHash, generated1); addAndCheckFileContentsByHash(fileContentsByHash, generated2); diff --git a/test/file-hashes/samples/augment-chunk-hash/_config.js b/test/file-hashes/samples/augment-chunk-hash/_config.js index 471dc651c1b..4cc7c0f564e 100644 --- a/test/file-hashes/samples/augment-chunk-hash/_config.js +++ b/test/file-hashes/samples/augment-chunk-hash/_config.js @@ -1,3 +1,5 @@ +const augment1 = '/*foo*/'; +const augment2 = '/*bar*/'; module.exports = { description: 'augmentChunkHash updates hashes across all modules when returning something', options1: { @@ -10,8 +12,13 @@ module.exports = { plugins: [ { augmentChunkHash(chunk) { - if (chunk.name === 'dep') { - return 'adfasdf'; + if (chunk.name === 'main') { + return augment1; + } + }, + renderChunk(code, chunk) { + if (chunk.name === 'main') { + return augment1 + code; } } } @@ -26,7 +33,16 @@ module.exports = { }, plugins: [ { - augmentChunkHash() {} + augmentChunkHash(chunk) { + if (chunk.name === 'main') { + return augment2; + } + }, + renderChunk(code, chunk) { + if (chunk.name === 'main') { + return augment2 + code; + } + } } ] } diff --git a/test/file-hashes/samples/augment-chunk-hash/dep.js b/test/file-hashes/samples/augment-chunk-hash/dep.js deleted file mode 100644 index 3329a7d972f..00000000000 --- a/test/file-hashes/samples/augment-chunk-hash/dep.js +++ /dev/null @@ -1 +0,0 @@ -export const foo = 'foo'; diff --git a/test/file-hashes/samples/augment-chunk-hash/main.js b/test/file-hashes/samples/augment-chunk-hash/main.js index 47e809f4ee7..c0b933d7b56 100644 --- a/test/file-hashes/samples/augment-chunk-hash/main.js +++ b/test/file-hashes/samples/augment-chunk-hash/main.js @@ -1,4 +1 @@ -import('./dep').then(({foo})=>{ - console.log(foo); - console.log('main'); -}); +console.log('main'); From 57ccc8cdf8ac4109667681d68f845bc1bb7fd29c Mon Sep 17 00:00:00 2001 From: isidrok Date: Tue, 13 Aug 2019 16:38:21 +0200 Subject: [PATCH 11/11] update augment-chunk-hash tests --- test/file-hashes/index.js | 1 - 1 file changed, 1 deletion(-) diff --git a/test/file-hashes/index.js b/test/file-hashes/index.js index b315fb50d22..b5843887694 100644 --- a/test/file-hashes/index.js +++ b/test/file-hashes/index.js @@ -23,7 +23,6 @@ runTestSuiteWithSamples('file hashes', path.resolve(__dirname, 'samples'), (dir, ) ) ).then(([generated1, generated2]) => { - console.log(generated1, generated2); const fileContentsByHash = new Map(); addAndCheckFileContentsByHash(fileContentsByHash, generated1); addAndCheckFileContentsByHash(fileContentsByHash, generated2);