rollup 0.56.3 → 0.57.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +39 -0
- package/README.md +7 -1
- package/bin/rollup +251 -208
- package/dist/rollup.browser.js +3912 -4459
- package/dist/rollup.es.js +3970 -4497
- package/dist/rollup.js +3970 -4497
- package/dist/typings/Chunk.d.ts +4 -3
- package/dist/typings/Graph.d.ts +4 -5
- package/dist/typings/Module.d.ts +3 -14
- package/dist/typings/ast/Entity.d.ts +1 -1
- package/dist/typings/ast/ExecutionPathOptions.d.ts +1 -1
- package/dist/typings/ast/nodes/ArrayExpression.d.ts +1 -1
- package/dist/typings/ast/nodes/ArrayPattern.d.ts +1 -1
- package/dist/typings/ast/nodes/ArrowFunctionExpression.d.ts +1 -1
- package/dist/typings/ast/nodes/AssignmentExpression.d.ts +1 -1
- package/dist/typings/ast/nodes/AssignmentPattern.d.ts +1 -1
- package/dist/typings/ast/nodes/BinaryExpression.d.ts +1 -1
- package/dist/typings/ast/nodes/BlockStatement.d.ts +1 -1
- package/dist/typings/ast/nodes/CallExpression.d.ts +1 -1
- package/dist/typings/ast/nodes/ClassBody.d.ts +1 -1
- package/dist/typings/ast/nodes/ClassDeclaration.d.ts +1 -1
- package/dist/typings/ast/nodes/ClassExpression.d.ts +1 -1
- package/dist/typings/ast/nodes/ConditionalExpression.d.ts +2 -2
- package/dist/typings/ast/nodes/EmptyStatement.d.ts +1 -1
- package/dist/typings/ast/nodes/ExportAllDeclaration.d.ts +1 -1
- package/dist/typings/ast/nodes/ExportDefaultDeclaration.d.ts +1 -1
- package/dist/typings/ast/nodes/ExportNamedDeclaration.d.ts +1 -1
- package/dist/typings/ast/nodes/ExpressionStatement.d.ts +1 -1
- package/dist/typings/ast/nodes/ForInStatement.d.ts +1 -1
- package/dist/typings/ast/nodes/ForOfStatement.d.ts +1 -1
- package/dist/typings/ast/nodes/ForStatement.d.ts +1 -1
- package/dist/typings/ast/nodes/Identifier.d.ts +2 -2
- package/dist/typings/ast/nodes/IfStatement.d.ts +1 -1
- package/dist/typings/ast/nodes/Import.d.ts +1 -1
- package/dist/typings/ast/nodes/ImportDeclaration.d.ts +1 -1
- package/dist/typings/ast/nodes/ImportDefaultSpecifier.d.ts +1 -1
- package/dist/typings/ast/nodes/ImportNamespaceSpecifier.d.ts +1 -1
- package/dist/typings/ast/nodes/Literal.d.ts +2 -2
- package/dist/typings/ast/nodes/LogicalExpression.d.ts +1 -1
- package/dist/typings/ast/nodes/MemberExpression.d.ts +2 -2
- package/dist/typings/ast/nodes/MethodDefinition.d.ts +1 -1
- package/dist/typings/ast/nodes/NewExpression.d.ts +1 -1
- package/dist/typings/ast/nodes/ObjectExpression.d.ts +1 -1
- package/dist/typings/ast/nodes/ObjectPattern.d.ts +1 -1
- package/dist/typings/ast/nodes/Program.d.ts +1 -1
- package/dist/typings/ast/nodes/Property.d.ts +3 -3
- package/dist/typings/ast/nodes/RestElement.d.ts +1 -1
- package/dist/typings/ast/nodes/SequenceExpression.d.ts +1 -1
- package/dist/typings/ast/nodes/SwitchCase.d.ts +1 -1
- package/dist/typings/ast/nodes/TemplateLiteral.d.ts +2 -2
- package/dist/typings/ast/nodes/ThisExpression.d.ts +2 -2
- package/dist/typings/ast/nodes/UnaryExpression.d.ts +1 -1
- package/dist/typings/ast/nodes/UpdateExpression.d.ts +1 -1
- package/dist/typings/ast/nodes/VariableDeclaration.d.ts +2 -2
- package/dist/typings/ast/nodes/VariableDeclarator.d.ts +2 -2
- package/dist/typings/ast/nodes/shared/ClassNode.d.ts +1 -1
- package/dist/typings/ast/nodes/shared/Expression.d.ts +1 -1
- package/dist/typings/ast/nodes/shared/FunctionNode.d.ts +1 -1
- package/dist/typings/ast/nodes/shared/Node.d.ts +3 -2
- package/dist/typings/ast/values.d.ts +9 -1
- package/dist/typings/ast/variables/ArgumentsVariable.d.ts +1 -1
- package/dist/typings/ast/variables/ExportDefaultVariable.d.ts +1 -0
- package/dist/typings/ast/variables/GlobalVariable.d.ts +1 -1
- package/dist/typings/ast/variables/LocalVariable.d.ts +2 -1
- package/dist/typings/ast/variables/NamespaceVariable.d.ts +5 -1
- package/dist/typings/ast/variables/ReplaceableInitializationVariable.d.ts +1 -1
- package/dist/typings/ast/variables/Variable.d.ts +1 -1
- package/dist/typings/ast/variables/VariableReassignmentTracker.d.ts +1 -9
- package/dist/typings/finalisers/amd.d.ts +1 -1
- package/dist/typings/finalisers/es.d.ts +1 -1
- package/dist/typings/finalisers/iife.d.ts +1 -1
- package/dist/typings/finalisers/shared/getExportBlock.d.ts +1 -1
- package/dist/typings/finalisers/shared/getGlobalNameMaker.d.ts +3 -3
- package/dist/typings/finalisers/shared/getInteropBlock.d.ts +2 -2
- package/dist/typings/finalisers/shared/trimEmptyImports.d.ts +1 -1
- package/dist/typings/finalisers/shared/warnOnBuiltins.d.ts +1 -1
- package/dist/typings/finalisers/system.d.ts +1 -1
- package/dist/typings/finalisers/umd.d.ts +1 -1
- package/dist/typings/rollup/index.d.ts +33 -9
- package/dist/typings/utils/collapseSourcemaps.d.ts +2 -1
- package/dist/typings/utils/commondir.d.ts +1 -0
- package/dist/typings/utils/defaults.d.ts +1 -2
- package/dist/typings/utils/getIndentString.d.ts +2 -2
- package/dist/typings/utils/mergeOptions.d.ts +4 -1
- package/dist/typings/utils/renderHelpers.d.ts +15 -1
- package/dist/typings/utils/timers.d.ts +7 -0
- package/dist/typings/watch/index.d.ts +2 -2
- package/package.json +42 -25
package/bin/rollup
CHANGED
|
@@ -249,9 +249,9 @@ function isNumber (x) {
|
|
|
249
249
|
return /^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x);
|
|
250
250
|
}
|
|
251
251
|
|
|
252
|
-
var help = "rollup version __VERSION__\n=====================================\n\nUsage: rollup [options] <entry file>\n\nBasic options:\n\n-v, --version Show version number\n-h, --help Show this help message\n-c, --config Use this config file (if argument is used but value\n is unspecified, defaults to rollup.config.js)\n-w, --watch Watch files in bundle and rebuild on changes\n-i, --input Input (alternative to <entry file>)\n-o, --
|
|
252
|
+
var help = "rollup version __VERSION__\n=====================================\n\nUsage: rollup [options] <entry file>\n\nBasic options:\n\n-v, --version Show version number\n-h, --help Show this help message\n-c, --config Use this config file (if argument is used but value\n is unspecified, defaults to rollup.config.js)\n-w, --watch Watch files in bundle and rebuild on changes\n-i, --input Input (alternative to <entry file>)\n-o, --file <output> Output (if absent, prints to stdout)\n-f, --format [es] Type of output (amd, cjs, es, iife, umd)\n-e, --external Comma-separate list of module IDs to exclude\n-g, --globals Comma-separate list of `module ID:Global` pairs\n Any module IDs defined here are added to external\n-n, --name Name for UMD export\n-m, --sourcemap Generate sourcemap (`-m inline` for inline map)\n-l, --legacy Support IE8\n--amd.id ID for AMD module (default is anonymous)\n--amd.define Function to use in place of `define`\n--no-strict Don't emit a `\"use strict\";` in the generated modules.\n--no-indent Don't indent result\n--environment <values> Settings passed to config file (see example)\n--no-conflict Generate a noConflict method for UMD globals\n--no-treeshake Disable tree-shaking\n--silent Don't print warnings\n--intro Content to insert at top of bundle (inside wrapper)\n--outro Content to insert at end of bundle (inside wrapper)\n--banner Content to insert at top of bundle (outside wrapper)\n--footer Content to insert at end of bundle (outside wrapper)\n--no-interop Do not include interop block\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";
|
|
253
253
|
|
|
254
|
-
var version = "0.
|
|
254
|
+
var version = "0.57.1";
|
|
255
255
|
|
|
256
256
|
var modules = {};
|
|
257
257
|
|
|
@@ -1599,30 +1599,43 @@ function assembleStyles() {
|
|
|
1599
1599
|
});
|
|
1600
1600
|
}
|
|
1601
1601
|
|
|
1602
|
+
const ansi2ansi = n => n;
|
|
1602
1603
|
const rgb2rgb = (r, g, b) => [r, g, b];
|
|
1603
1604
|
|
|
1604
1605
|
styles.color.close = '\u001B[39m';
|
|
1605
1606
|
styles.bgColor.close = '\u001B[49m';
|
|
1606
1607
|
|
|
1607
|
-
styles.color.ansi = {
|
|
1608
|
-
|
|
1608
|
+
styles.color.ansi = {
|
|
1609
|
+
ansi: wrapAnsi16(ansi2ansi, 0)
|
|
1610
|
+
};
|
|
1611
|
+
styles.color.ansi256 = {
|
|
1612
|
+
ansi256: wrapAnsi256(ansi2ansi, 0)
|
|
1613
|
+
};
|
|
1609
1614
|
styles.color.ansi16m = {
|
|
1610
1615
|
rgb: wrapAnsi16m(rgb2rgb, 0)
|
|
1611
1616
|
};
|
|
1612
1617
|
|
|
1613
|
-
styles.bgColor.ansi = {
|
|
1614
|
-
|
|
1618
|
+
styles.bgColor.ansi = {
|
|
1619
|
+
ansi: wrapAnsi16(ansi2ansi, 10)
|
|
1620
|
+
};
|
|
1621
|
+
styles.bgColor.ansi256 = {
|
|
1622
|
+
ansi256: wrapAnsi256(ansi2ansi, 10)
|
|
1623
|
+
};
|
|
1615
1624
|
styles.bgColor.ansi16m = {
|
|
1616
1625
|
rgb: wrapAnsi16m(rgb2rgb, 10)
|
|
1617
1626
|
};
|
|
1618
1627
|
|
|
1619
|
-
for (
|
|
1628
|
+
for (let key of Object.keys(colorConvert)) {
|
|
1620
1629
|
if (typeof colorConvert[key] !== 'object') {
|
|
1621
1630
|
continue;
|
|
1622
1631
|
}
|
|
1623
1632
|
|
|
1624
1633
|
const suite = colorConvert[key];
|
|
1625
1634
|
|
|
1635
|
+
if (key === 'ansi16') {
|
|
1636
|
+
key = 'ansi';
|
|
1637
|
+
}
|
|
1638
|
+
|
|
1626
1639
|
if ('ansi16' in suite) {
|
|
1627
1640
|
styles.color.ansi[key] = wrapAnsi16(suite.ansi16, 0);
|
|
1628
1641
|
styles.bgColor.ansi[key] = wrapAnsi16(suite.ansi16, 10);
|
|
@@ -1649,15 +1662,13 @@ Object.defineProperty(module, 'exports', {
|
|
|
1649
1662
|
});
|
|
1650
1663
|
});
|
|
1651
1664
|
|
|
1652
|
-
var hasFlag =
|
|
1653
|
-
module.exports = (flag, argv) => {
|
|
1665
|
+
var hasFlag = (flag, argv) => {
|
|
1654
1666
|
argv = argv || process.argv;
|
|
1655
1667
|
const prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--');
|
|
1656
1668
|
const pos = argv.indexOf(prefix + flag);
|
|
1657
1669
|
const terminatorPos = argv.indexOf('--');
|
|
1658
1670
|
return pos !== -1 && (terminatorPos === -1 ? true : pos < terminatorPos);
|
|
1659
1671
|
};
|
|
1660
|
-
});
|
|
1661
1672
|
|
|
1662
1673
|
const env = process.env;
|
|
1663
1674
|
|
|
@@ -1705,6 +1716,10 @@ function supportsColor(stream) {
|
|
|
1705
1716
|
}
|
|
1706
1717
|
|
|
1707
1718
|
if (stream && !stream.isTTY && forceColor !== true) {
|
|
1719
|
+
// VS code debugger doesn't have isTTY set
|
|
1720
|
+
if (env.VSCODE_PID) {
|
|
1721
|
+
return 1;
|
|
1722
|
+
}
|
|
1708
1723
|
return 0;
|
|
1709
1724
|
}
|
|
1710
1725
|
|
|
@@ -1741,14 +1756,16 @@ function supportsColor(stream) {
|
|
|
1741
1756
|
return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
|
|
1742
1757
|
}
|
|
1743
1758
|
|
|
1759
|
+
if (env.COLORTERM === 'truecolor') {
|
|
1760
|
+
return 3;
|
|
1761
|
+
}
|
|
1762
|
+
|
|
1744
1763
|
if ('TERM_PROGRAM' in env) {
|
|
1745
1764
|
const version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);
|
|
1746
1765
|
|
|
1747
1766
|
switch (env.TERM_PROGRAM) {
|
|
1748
1767
|
case 'iTerm.app':
|
|
1749
1768
|
return version >= 3 ? 3 : 2;
|
|
1750
|
-
case 'Hyper':
|
|
1751
|
-
return 3;
|
|
1752
1769
|
case 'Apple_Terminal':
|
|
1753
1770
|
return 2;
|
|
1754
1771
|
// No default
|
|
@@ -1785,7 +1802,6 @@ var supportsColor_1 = {
|
|
|
1785
1802
|
stderr: getSupportLevel(process.stderr)
|
|
1786
1803
|
};
|
|
1787
1804
|
|
|
1788
|
-
var templates = createCommonjsModule(function (module) {
|
|
1789
1805
|
const TEMPLATE_REGEX = /(?:\\(u[a-f\d]{4}|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi;
|
|
1790
1806
|
const STYLE_REGEX = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g;
|
|
1791
1807
|
const STRING_REGEX = /^(['"])((?:\\.|(?!\1)[^\\])*)\1$/;
|
|
@@ -1877,7 +1893,7 @@ function buildStyle(chalk, styles) {
|
|
|
1877
1893
|
return current;
|
|
1878
1894
|
}
|
|
1879
1895
|
|
|
1880
|
-
|
|
1896
|
+
var templates = (chalk, tmp) => {
|
|
1881
1897
|
const styles = [];
|
|
1882
1898
|
const chunks = [];
|
|
1883
1899
|
let chunk = [];
|
|
@@ -1913,7 +1929,6 @@ module.exports = (chalk, tmp) => {
|
|
|
1913
1929
|
|
|
1914
1930
|
return chunks.join('');
|
|
1915
1931
|
};
|
|
1916
|
-
});
|
|
1917
1932
|
|
|
1918
1933
|
var chalk = createCommonjsModule(function (module) {
|
|
1919
1934
|
|
|
@@ -2166,7 +2181,9 @@ function handleError(err, recover) {
|
|
|
2166
2181
|
var description = err.message || err;
|
|
2167
2182
|
if (err.name)
|
|
2168
2183
|
description = err.name + ": " + description;
|
|
2169
|
-
var message = (err.plugin
|
|
2184
|
+
var message = (err.plugin
|
|
2185
|
+
? "(" + err.plugin + " plugin) " + description
|
|
2186
|
+
: description) || err;
|
|
2170
2187
|
stderr(chalk.bold.red("[!] " + chalk.bold(message.toString())));
|
|
2171
2188
|
// TODO should this be "err.url || (err.file && err.loc.file) || err.id"?
|
|
2172
2189
|
if (err.url) {
|
|
@@ -2251,7 +2268,9 @@ function deprecateOptions(options, deprecateConfig) {
|
|
|
2251
2268
|
deprecations.push({ old: 'targets', new: 'output' });
|
|
2252
2269
|
// as targets is an array and we need to merge other output options
|
|
2253
2270
|
// like sourcemap etc.
|
|
2254
|
-
options.output = options.targets.map(function (target) {
|
|
2271
|
+
options.output = options.targets.map(function (target) {
|
|
2272
|
+
return Object.assign({}, target, options.output);
|
|
2273
|
+
});
|
|
2255
2274
|
delete options.targets;
|
|
2256
2275
|
var deprecatedDest_1 = false;
|
|
2257
2276
|
options.output.forEach(function (outputEntry) {
|
|
@@ -2274,7 +2293,10 @@ function deprecateOptions(options, deprecateConfig) {
|
|
|
2274
2293
|
delete options.dest;
|
|
2275
2294
|
}
|
|
2276
2295
|
if (options.pureExternalModules) {
|
|
2277
|
-
deprecations.push({
|
|
2296
|
+
deprecations.push({
|
|
2297
|
+
old: 'pureExternalModules',
|
|
2298
|
+
new: 'treeshake.pureExternalModules'
|
|
2299
|
+
});
|
|
2278
2300
|
if (options.treeshake === undefined) {
|
|
2279
2301
|
options.treeshake = {};
|
|
2280
2302
|
}
|
|
@@ -2306,7 +2328,12 @@ function deprecateOptions(options, deprecateConfig) {
|
|
|
2306
2328
|
}
|
|
2307
2329
|
}
|
|
2308
2330
|
|
|
2309
|
-
function
|
|
2331
|
+
var createGetOption = function (config, command) { return function (name, defaultValue) {
|
|
2332
|
+
return command[name] !== undefined
|
|
2333
|
+
? command[name]
|
|
2334
|
+
: config[name] !== undefined ? config[name] : defaultValue;
|
|
2335
|
+
}; };
|
|
2336
|
+
var normalizeObjectOptionValue = function (optionValue) {
|
|
2310
2337
|
if (!optionValue) {
|
|
2311
2338
|
return optionValue;
|
|
2312
2339
|
}
|
|
@@ -2314,7 +2341,17 @@ function normalizeObjectOptionValue(optionValue) {
|
|
|
2314
2341
|
return {};
|
|
2315
2342
|
}
|
|
2316
2343
|
return optionValue;
|
|
2317
|
-
}
|
|
2344
|
+
};
|
|
2345
|
+
var getObjectOption = function (config, command, name) {
|
|
2346
|
+
var commandOption = normalizeObjectOptionValue(command[name]);
|
|
2347
|
+
var configOption = normalizeObjectOptionValue(config[name]);
|
|
2348
|
+
if (commandOption !== undefined) {
|
|
2349
|
+
return commandOption && configOption
|
|
2350
|
+
? Object.assign({}, configOption, commandOption)
|
|
2351
|
+
: commandOption;
|
|
2352
|
+
}
|
|
2353
|
+
return configOption;
|
|
2354
|
+
};
|
|
2318
2355
|
var defaultOnWarn = function (warning) {
|
|
2319
2356
|
if (typeof warning === 'string') {
|
|
2320
2357
|
console.warn(warning); // eslint-disable-line no-console
|
|
@@ -2323,141 +2360,147 @@ var defaultOnWarn = function (warning) {
|
|
|
2323
2360
|
console.warn(warning.message); // eslint-disable-line no-console
|
|
2324
2361
|
}
|
|
2325
2362
|
};
|
|
2326
|
-
function
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2363
|
+
var getOnWarn = function (config, command, defaultOnWarnHandler) {
|
|
2364
|
+
if (defaultOnWarnHandler === void 0) { defaultOnWarnHandler = defaultOnWarn; }
|
|
2365
|
+
return command.silent
|
|
2366
|
+
? function () { }
|
|
2367
|
+
: config.onwarn
|
|
2368
|
+
? function (warning) { return config.onwarn(warning, defaultOnWarnHandler); }
|
|
2369
|
+
: defaultOnWarnHandler;
|
|
2370
|
+
};
|
|
2371
|
+
var getExternal = function (config, command) {
|
|
2372
|
+
var configExternal = config.external;
|
|
2373
|
+
return typeof configExternal === 'function'
|
|
2374
|
+
? function (id) {
|
|
2375
|
+
var rest = [];
|
|
2376
|
+
for (var _i = 1; _i < arguments.length; _i++) {
|
|
2377
|
+
rest[_i - 1] = arguments[_i];
|
|
2378
|
+
}
|
|
2379
|
+
return configExternal.apply(void 0, [id].concat(rest)) || command.external.indexOf(id) !== -1;
|
|
2341
2380
|
}
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2381
|
+
: (configExternal || []).concat(command.external);
|
|
2382
|
+
};
|
|
2383
|
+
var commandAliases = {
|
|
2384
|
+
c: 'config',
|
|
2385
|
+
d: 'indent',
|
|
2386
|
+
e: 'external',
|
|
2387
|
+
f: 'format',
|
|
2388
|
+
g: 'globals',
|
|
2389
|
+
h: 'help',
|
|
2390
|
+
i: 'input',
|
|
2391
|
+
l: 'legacy',
|
|
2392
|
+
m: 'sourcemap',
|
|
2393
|
+
n: 'name',
|
|
2394
|
+
o: 'file',
|
|
2395
|
+
v: 'version',
|
|
2396
|
+
w: 'watch'
|
|
2397
|
+
};
|
|
2398
|
+
function mergeOptions(_a) {
|
|
2399
|
+
var _b = _a.config, config = _b === void 0 ? {} : _b, _c = _a.command, rawCommandOptions = _c === void 0 ? {} : _c, deprecateConfig = _a.deprecateConfig, defaultOnWarnHandler = _a.defaultOnWarnHandler;
|
|
2400
|
+
var deprecations = deprecate(config, rawCommandOptions, deprecateConfig);
|
|
2401
|
+
var command = getCommandOptions(rawCommandOptions);
|
|
2402
|
+
var inputOptions = getInputOptions(config, command, defaultOnWarnHandler);
|
|
2403
|
+
if (command.output) {
|
|
2404
|
+
Object.assign(command, command.output);
|
|
2348
2405
|
}
|
|
2349
|
-
|
|
2350
|
-
|
|
2406
|
+
var normalizedOutputOptions = ensureArray(config.output);
|
|
2407
|
+
if (normalizedOutputOptions.length === 0)
|
|
2408
|
+
normalizedOutputOptions.push({});
|
|
2409
|
+
var outputOptions = normalizedOutputOptions.map(function (singleOutputOptions) {
|
|
2410
|
+
return getOutputOptions(singleOutputOptions, command);
|
|
2411
|
+
});
|
|
2412
|
+
var unknownOptionErrors = [];
|
|
2413
|
+
var validInputOptions = Object.keys(inputOptions);
|
|
2414
|
+
addUnknownOptionErrors(unknownOptionErrors, Object.keys(config), validInputOptions, 'input option', /^output$/);
|
|
2415
|
+
var validOutputOptions = Object.keys(outputOptions[0]);
|
|
2416
|
+
addUnknownOptionErrors(unknownOptionErrors, outputOptions.reduce(function (allKeys, options) { return allKeys.concat(Object.keys(options)); }, []), validOutputOptions, 'output option');
|
|
2417
|
+
addUnknownOptionErrors(unknownOptionErrors, Object.keys(command), validInputOptions.concat(validOutputOptions, Object.keys(commandAliases), 'config', 'environment', 'silent'), 'CLI flag', /^_|output|(config.*)$/);
|
|
2418
|
+
return {
|
|
2419
|
+
inputOptions: inputOptions,
|
|
2420
|
+
outputOptions: outputOptions,
|
|
2421
|
+
deprecations: deprecations,
|
|
2422
|
+
optionError: unknownOptionErrors.length > 0 ? unknownOptionErrors.join('\n') : null
|
|
2423
|
+
};
|
|
2424
|
+
}
|
|
2425
|
+
function addUnknownOptionErrors(errors, options, validOptions, optionType, ignoredKeys) {
|
|
2426
|
+
if (ignoredKeys === void 0) { ignoredKeys = /$./; }
|
|
2427
|
+
var unknownOptions = options.filter(function (key) { return validOptions.indexOf(key) === -1 && !ignoredKeys.test(key); });
|
|
2428
|
+
if (unknownOptions.length > 0)
|
|
2429
|
+
errors.push("Unknown " + optionType + ": " + unknownOptions.join(', ') + ". Allowed options: " + validOptions.sort().join(', '));
|
|
2430
|
+
}
|
|
2431
|
+
function getCommandOptions(rawCommandOptions) {
|
|
2432
|
+
var command = Object.assign({}, rawCommandOptions);
|
|
2433
|
+
command.external = (rawCommandOptions.external || '').split(',');
|
|
2434
|
+
if (rawCommandOptions.globals) {
|
|
2435
|
+
command.globals = Object.create(null);
|
|
2436
|
+
rawCommandOptions.globals.split(',').forEach(function (str) {
|
|
2437
|
+
var names = str.split(':');
|
|
2438
|
+
command.globals[names[0]] = names[1];
|
|
2439
|
+
// Add missing Module IDs to external.
|
|
2440
|
+
if (command.external.indexOf(names[0]) === -1) {
|
|
2441
|
+
command.external.push(names[0]);
|
|
2442
|
+
}
|
|
2443
|
+
});
|
|
2351
2444
|
}
|
|
2445
|
+
return command;
|
|
2446
|
+
}
|
|
2447
|
+
function getInputOptions(config, command, defaultOnWarnHandler) {
|
|
2448
|
+
if (command === void 0) { command = {}; }
|
|
2449
|
+
var getOption = createGetOption(config, command);
|
|
2352
2450
|
var inputOptions = {
|
|
2353
|
-
input: getInputOption('input'),
|
|
2354
|
-
legacy: getInputOption('legacy'),
|
|
2355
|
-
treeshake: getObjectOption('treeshake'),
|
|
2356
2451
|
acorn: config.acorn,
|
|
2357
2452
|
acornInjectPlugins: config.acornInjectPlugins,
|
|
2453
|
+
cache: getOption('cache'),
|
|
2358
2454
|
context: config.context,
|
|
2455
|
+
experimentalCodeSplitting: getOption('experimentalCodeSplitting'),
|
|
2456
|
+
experimentalDynamicImport: getOption('experimentalDynamicImport'),
|
|
2457
|
+
experimentalPreserveModules: getOption('experimentalPreserveModules'),
|
|
2458
|
+
external: getExternal(config, command),
|
|
2459
|
+
input: getOption('input'),
|
|
2359
2460
|
moduleContext: config.moduleContext,
|
|
2461
|
+
onwarn: getOnWarn(config, command, defaultOnWarnHandler),
|
|
2462
|
+
perf: getOption('perf', false),
|
|
2360
2463
|
plugins: config.plugins,
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
experimentalDynamicImport: getInputOption('experimentalDynamicImport'),
|
|
2366
|
-
experimentalCodeSplitting: getInputOption('experimentalCodeSplitting'),
|
|
2367
|
-
preserveSymlinks: getInputOption('preserveSymlinks')
|
|
2368
|
-
};
|
|
2369
|
-
// legacy, to ensure e.g. commonjs plugin still works
|
|
2370
|
-
inputOptions.entry = inputOptions.input;
|
|
2371
|
-
var commandExternal = (command.external || '').split(',');
|
|
2372
|
-
var configExternal = config.external;
|
|
2373
|
-
if (command.globals) {
|
|
2374
|
-
var globals_1 = Object.create(null);
|
|
2375
|
-
command.globals.split(',').forEach(function (str) {
|
|
2376
|
-
var names = str.split(':');
|
|
2377
|
-
globals_1[names[0]] = names[1];
|
|
2378
|
-
// Add missing Module IDs to external.
|
|
2379
|
-
if (commandExternal.indexOf(names[0]) === -1) {
|
|
2380
|
-
commandExternal.push(names[0]);
|
|
2381
|
-
}
|
|
2382
|
-
});
|
|
2383
|
-
command.globals = globals_1;
|
|
2384
|
-
}
|
|
2385
|
-
if (typeof configExternal === 'function') {
|
|
2386
|
-
inputOptions.external = function (id) {
|
|
2387
|
-
var rest = [];
|
|
2388
|
-
for (var _i = 1; _i < arguments.length; _i++) {
|
|
2389
|
-
rest[_i - 1] = arguments[_i];
|
|
2390
|
-
}
|
|
2391
|
-
return configExternal.apply(void 0, [id].concat(rest)) || commandExternal.indexOf(id) !== -1;
|
|
2392
|
-
};
|
|
2393
|
-
}
|
|
2394
|
-
else {
|
|
2395
|
-
inputOptions.external = (configExternal || []).concat(commandExternal);
|
|
2396
|
-
}
|
|
2397
|
-
if (command.silent) {
|
|
2398
|
-
inputOptions.onwarn = function () { };
|
|
2399
|
-
}
|
|
2400
|
-
var baseOutputOptions = {
|
|
2401
|
-
extend: getOutputOption('extend'),
|
|
2402
|
-
amd: Object.assign({}, config.amd, command.amd),
|
|
2403
|
-
banner: getOutputOption('banner'),
|
|
2404
|
-
footer: getOutputOption('footer'),
|
|
2405
|
-
intro: getOutputOption('intro'),
|
|
2406
|
-
format: getOutputOption('format'),
|
|
2407
|
-
outro: getOutputOption('outro'),
|
|
2408
|
-
sourcemap: getOutputOption('sourcemap'),
|
|
2409
|
-
sourcemapFile: getOutputOption('sourcemapFile'),
|
|
2410
|
-
name: getOutputOption('name'),
|
|
2411
|
-
globals: getOutputOption('globals'),
|
|
2412
|
-
interop: getOutputOption('interop'),
|
|
2413
|
-
legacy: getOutputOption('legacy'),
|
|
2414
|
-
freeze: getOutputOption('freeze'),
|
|
2415
|
-
indent: getOutputOption('indent'),
|
|
2416
|
-
strict: getOutputOption('strict'),
|
|
2417
|
-
noConflict: getOutputOption('noConflict'),
|
|
2418
|
-
paths: getOutputOption('paths'),
|
|
2419
|
-
exports: getOutputOption('exports'),
|
|
2420
|
-
file: getOutputOption('file'),
|
|
2421
|
-
dir: getOutputOption('dir')
|
|
2464
|
+
preferConst: getOption('preferConst'),
|
|
2465
|
+
preserveSymlinks: getOption('preserveSymlinks'),
|
|
2466
|
+
treeshake: getObjectOption(config, command, 'treeshake'),
|
|
2467
|
+
watch: config.watch
|
|
2422
2468
|
};
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
mergedOutputOptions = config.output.map(function (output) {
|
|
2426
|
-
return Object.assign({}, output, command.output);
|
|
2427
|
-
});
|
|
2428
|
-
}
|
|
2429
|
-
else if (config.output && command.output) {
|
|
2430
|
-
mergedOutputOptions = [Object.assign({}, config.output, command.output)];
|
|
2431
|
-
}
|
|
2432
|
-
else {
|
|
2433
|
-
mergedOutputOptions =
|
|
2434
|
-
command.output || config.output
|
|
2435
|
-
? ensureArray(command.output || config.output)
|
|
2436
|
-
: [
|
|
2437
|
-
{
|
|
2438
|
-
file: command.output ? command.output.file : null,
|
|
2439
|
-
format: command.output ? command.output.format : null
|
|
2440
|
-
}
|
|
2441
|
-
];
|
|
2469
|
+
if (inputOptions.experimentalPreserveModules && !Array.isArray(inputOptions.input)) {
|
|
2470
|
+
inputOptions.input = [inputOptions.input];
|
|
2442
2471
|
}
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
: Object.keys(config.output || {});
|
|
2453
|
-
var errors = Object.keys(config || {}).concat(outputOptionKeys).filter(function (k) { return k !== 'output' && validKeys.indexOf(k) === -1; });
|
|
2472
|
+
// legacy to make sure certain plugins still work
|
|
2473
|
+
inputOptions.entry = Array.isArray(inputOptions.input)
|
|
2474
|
+
? inputOptions.input[0]
|
|
2475
|
+
: inputOptions.input;
|
|
2476
|
+
return inputOptions;
|
|
2477
|
+
}
|
|
2478
|
+
function getOutputOptions(config, command) {
|
|
2479
|
+
if (command === void 0) { command = {}; }
|
|
2480
|
+
var getOption = createGetOption(config, command);
|
|
2454
2481
|
return {
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2482
|
+
amd: Object.assign({}, config.amd, command.amd),
|
|
2483
|
+
banner: getOption('banner'),
|
|
2484
|
+
dir: getOption('dir'),
|
|
2485
|
+
exports: getOption('exports'),
|
|
2486
|
+
extend: getOption('extend'),
|
|
2487
|
+
file: getOption('file'),
|
|
2488
|
+
footer: getOption('footer'),
|
|
2489
|
+
format: getOption('format'),
|
|
2490
|
+
freeze: getOption('freeze'),
|
|
2491
|
+
globals: getOption('globals'),
|
|
2492
|
+
indent: getOption('indent', true),
|
|
2493
|
+
interop: getOption('interop', true),
|
|
2494
|
+
intro: getOption('intro'),
|
|
2495
|
+
legacy: getOption('legacy', false),
|
|
2496
|
+
name: getOption('name'),
|
|
2497
|
+
namespaceToStringTag: getOption('namespaceToStringTag'),
|
|
2498
|
+
noConflict: getOption('noConflict'),
|
|
2499
|
+
outro: getOption('outro'),
|
|
2500
|
+
paths: getOption('paths'),
|
|
2501
|
+
sourcemap: getOption('sourcemap'),
|
|
2502
|
+
sourcemapFile: getOption('sourcemapFile'),
|
|
2503
|
+
strict: getOption('strict', true)
|
|
2461
2504
|
};
|
|
2462
2505
|
}
|
|
2463
2506
|
function deprecate(config, command, deprecateConfig) {
|
|
@@ -2475,17 +2518,10 @@ function deprecate(config, command, deprecateConfig) {
|
|
|
2475
2518
|
if (typeof command.output === 'string') {
|
|
2476
2519
|
deprecations.push({
|
|
2477
2520
|
old: '--output',
|
|
2478
|
-
new: '--
|
|
2521
|
+
new: '--file'
|
|
2479
2522
|
});
|
|
2480
2523
|
command.output = { file: command.output };
|
|
2481
2524
|
}
|
|
2482
|
-
if (command.format) {
|
|
2483
|
-
deprecations.push({
|
|
2484
|
-
old: '--format',
|
|
2485
|
-
new: '--output.format'
|
|
2486
|
-
});
|
|
2487
|
-
(command.output || (command.output = {})).format = command.format;
|
|
2488
|
-
}
|
|
2489
2525
|
// config file
|
|
2490
2526
|
deprecations.push.apply(deprecations, deprecateOptions(config, deprecateConfig));
|
|
2491
2527
|
return deprecations;
|
|
@@ -2745,16 +2781,16 @@ function showTruncatedWarnings(warnings) {
|
|
|
2745
2781
|
}
|
|
2746
2782
|
}
|
|
2747
2783
|
|
|
2748
|
-
function loadConfigFile(configFile,
|
|
2749
|
-
if (
|
|
2784
|
+
function loadConfigFile(configFile, commandOptions) {
|
|
2785
|
+
if (commandOptions === void 0) { commandOptions = {}; }
|
|
2786
|
+
var silent = commandOptions.silent || false;
|
|
2750
2787
|
var warnings = batchWarnings();
|
|
2751
2788
|
return rollup.rollup({
|
|
2752
2789
|
input: configFile,
|
|
2753
2790
|
external: function (id) {
|
|
2754
|
-
return (
|
|
2755
|
-
id.slice(-5, id.length) === '.json');
|
|
2791
|
+
return (id[0] !== '.' && !path__default.isAbsolute(id)) || id.slice(-5, id.length) === '.json';
|
|
2756
2792
|
},
|
|
2757
|
-
onwarn: warnings.add
|
|
2793
|
+
onwarn: warnings.add
|
|
2758
2794
|
})
|
|
2759
2795
|
.then(function (bundle) {
|
|
2760
2796
|
if (!silent && warnings.count > 0) {
|
|
@@ -2769,16 +2805,23 @@ function loadConfigFile(configFile, silent) {
|
|
|
2769
2805
|
var code = _a.code;
|
|
2770
2806
|
// temporarily override require
|
|
2771
2807
|
var defaultLoader = require.extensions['.js'];
|
|
2772
|
-
require.extensions['.js'] = function (
|
|
2808
|
+
require.extensions['.js'] = function (module, filename) {
|
|
2773
2809
|
if (filename === configFile) {
|
|
2774
|
-
|
|
2810
|
+
module._compile(code, filename);
|
|
2775
2811
|
}
|
|
2776
2812
|
else {
|
|
2777
|
-
defaultLoader(
|
|
2813
|
+
defaultLoader(module, filename);
|
|
2778
2814
|
}
|
|
2779
2815
|
};
|
|
2780
2816
|
delete require.cache[configFile];
|
|
2781
|
-
return Promise.resolve(require(configFile))
|
|
2817
|
+
return Promise.resolve(require(configFile))
|
|
2818
|
+
.then(function (configFileContent) {
|
|
2819
|
+
if (typeof configFileContent === 'function') {
|
|
2820
|
+
return configFileContent(commandOptions);
|
|
2821
|
+
}
|
|
2822
|
+
return configFileContent;
|
|
2823
|
+
})
|
|
2824
|
+
.then(function (configs) {
|
|
2782
2825
|
if (Object.keys(configs).length === 0) {
|
|
2783
2826
|
handleError({
|
|
2784
2827
|
code: 'MISSING_CONFIG',
|
|
@@ -3276,11 +3319,7 @@ var plur = function (str, plural, count) {
|
|
|
3276
3319
|
return count === 1 ? str : plural;
|
|
3277
3320
|
};
|
|
3278
3321
|
|
|
3279
|
-
var prettyMs =
|
|
3280
|
-
|
|
3281
|
-
|
|
3282
|
-
|
|
3283
|
-
module.exports = (ms, opts) => {
|
|
3322
|
+
var prettyMs = (ms, opts) => {
|
|
3284
3323
|
if (!Number.isFinite(ms)) {
|
|
3285
3324
|
throw new TypeError('Expected a finite number');
|
|
3286
3325
|
}
|
|
@@ -3324,7 +3363,6 @@ module.exports = (ms, opts) => {
|
|
|
3324
3363
|
|
|
3325
3364
|
return ret.join(' ');
|
|
3326
3365
|
};
|
|
3327
|
-
});
|
|
3328
3366
|
|
|
3329
3367
|
function mapSequence(array, fn) {
|
|
3330
3368
|
var results = [];
|
|
@@ -3345,15 +3383,30 @@ var SOURCEMAPPING_URL = 'sourceMa';
|
|
|
3345
3383
|
SOURCEMAPPING_URL += 'ppingURL';
|
|
3346
3384
|
var SOURCEMAPPING_URL$1 = SOURCEMAPPING_URL;
|
|
3347
3385
|
|
|
3386
|
+
function printTimings(timings) {
|
|
3387
|
+
Object.keys(timings).forEach(function (label) {
|
|
3388
|
+
var color = chalk;
|
|
3389
|
+
if (label[0] === '#') {
|
|
3390
|
+
color = color.bold;
|
|
3391
|
+
if (label[1] !== '#') {
|
|
3392
|
+
color = color.underline;
|
|
3393
|
+
}
|
|
3394
|
+
}
|
|
3395
|
+
console.info(color(label + ": " + timings[label].toFixed(0) + "ms"));
|
|
3396
|
+
});
|
|
3397
|
+
}
|
|
3398
|
+
|
|
3348
3399
|
function build(inputOptions, outputOptions, warnings, silent) {
|
|
3349
3400
|
if (silent === void 0) { silent = false; }
|
|
3350
|
-
var useStdout = outputOptions.length === 1 &&
|
|
3401
|
+
var useStdout = outputOptions.length === 1 &&
|
|
3402
|
+
!outputOptions[0].file &&
|
|
3403
|
+
inputOptions.input instanceof Array === false;
|
|
3351
3404
|
var start = Date.now();
|
|
3352
|
-
var files = useStdout
|
|
3353
|
-
? ['stdout']
|
|
3354
|
-
: outputOptions.map(function (t) { return relativeId(t.file || t.dir); });
|
|
3405
|
+
var files = useStdout ? ['stdout'] : outputOptions.map(function (t) { return relativeId(t.file || t.dir); });
|
|
3355
3406
|
if (!silent)
|
|
3356
|
-
stderr(chalk.cyan("\n" + chalk.bold(typeof inputOptions.input === 'string'
|
|
3407
|
+
stderr(chalk.cyan("\n" + chalk.bold(typeof inputOptions.input === 'string'
|
|
3408
|
+
? inputOptions.input
|
|
3409
|
+
: inputOptions.input && inputOptions.input.join(', ')) + " \u2192 " + chalk.bold(files.join(', ')) + "..."));
|
|
3357
3410
|
return rollup.rollup(inputOptions)
|
|
3358
3411
|
.then(function (bundle) {
|
|
3359
3412
|
if (useStdout) {
|
|
@@ -3366,20 +3419,23 @@ function build(inputOptions, outputOptions, warnings, silent) {
|
|
|
3366
3419
|
}
|
|
3367
3420
|
return bundle.generate(output_1).then(function (_a) {
|
|
3368
3421
|
var code = _a.code, map = _a.map;
|
|
3422
|
+
if (!code)
|
|
3423
|
+
return;
|
|
3369
3424
|
if (output_1.sourcemap === 'inline') {
|
|
3370
3425
|
code += "\n//# " + SOURCEMAPPING_URL$1 + "=" + map.toUrl() + "\n";
|
|
3371
3426
|
}
|
|
3372
3427
|
process.stdout.write(code);
|
|
3373
3428
|
});
|
|
3374
3429
|
}
|
|
3375
|
-
return mapSequence(outputOptions, function (output) {
|
|
3376
|
-
return bundle.write(output);
|
|
3377
|
-
});
|
|
3430
|
+
return mapSequence(outputOptions, function (output) { return bundle.write(output); }).then(function () { return bundle; });
|
|
3378
3431
|
})
|
|
3379
|
-
.then(function () {
|
|
3432
|
+
.then(function (bundle) {
|
|
3380
3433
|
warnings.flush();
|
|
3381
3434
|
if (!silent)
|
|
3382
3435
|
stderr(chalk.green("created " + chalk.bold(files.join(', ')) + " in " + chalk.bold(prettyMs(Date.now() - start))));
|
|
3436
|
+
if (bundle && bundle.getTimings) {
|
|
3437
|
+
printTimings(bundle.getTimings());
|
|
3438
|
+
}
|
|
3383
3439
|
})
|
|
3384
3440
|
.catch(handleError);
|
|
3385
3441
|
}
|
|
@@ -3601,8 +3657,7 @@ signalExit.unload = unload_1;
|
|
|
3601
3657
|
signalExit.signals = signals_1;
|
|
3602
3658
|
signalExit.load = load_1;
|
|
3603
3659
|
|
|
3604
|
-
var timeZone =
|
|
3605
|
-
module.exports = date => {
|
|
3660
|
+
var timeZone = date => {
|
|
3606
3661
|
const offset = (date || new Date()).getTimezoneOffset();
|
|
3607
3662
|
const absOffset = Math.abs(offset);
|
|
3608
3663
|
const hours = Math.floor(absOffset / 60);
|
|
@@ -3611,12 +3666,8 @@ module.exports = date => {
|
|
|
3611
3666
|
|
|
3612
3667
|
return (offset < 0 ? '+' : '-') + hours + minutesOut;
|
|
3613
3668
|
};
|
|
3614
|
-
});
|
|
3615
3669
|
|
|
3616
|
-
var dateTime =
|
|
3617
|
-
|
|
3618
|
-
|
|
3619
|
-
module.exports = options => {
|
|
3670
|
+
var dateTime = options => {
|
|
3620
3671
|
options = Object.assign({
|
|
3621
3672
|
date: new Date(),
|
|
3622
3673
|
local: true,
|
|
@@ -3646,7 +3697,6 @@ module.exports = options => {
|
|
|
3646
3697
|
.replace(/T/, ' ')
|
|
3647
3698
|
.replace(/\..+/, end);
|
|
3648
3699
|
};
|
|
3649
|
-
});
|
|
3650
3700
|
|
|
3651
3701
|
var ansiEscapes = createCommonjsModule(function (module) {
|
|
3652
3702
|
const x = module.exports;
|
|
@@ -3801,7 +3851,11 @@ function watch(configFile, configs, command, silent) {
|
|
|
3801
3851
|
screen.reset(chalk.underline("rollup v" + rollup.VERSION));
|
|
3802
3852
|
var screenWriter = screen.reset;
|
|
3803
3853
|
configs = configs.map(function (options) {
|
|
3804
|
-
var merged = mergeOptions({
|
|
3854
|
+
var merged = mergeOptions({
|
|
3855
|
+
config: options,
|
|
3856
|
+
command: command,
|
|
3857
|
+
defaultOnWarnHandler: warnings.add
|
|
3858
|
+
});
|
|
3805
3859
|
var result = Object.assign({}, merged.inputOptions, {
|
|
3806
3860
|
output: merged.outputOptions
|
|
3807
3861
|
});
|
|
@@ -3811,7 +3865,10 @@ function watch(configFile, configs, command, silent) {
|
|
|
3811
3865
|
result.watch._deprecations = merged.deprecations;
|
|
3812
3866
|
}
|
|
3813
3867
|
if (merged.optionError)
|
|
3814
|
-
merged.inputOptions.onwarn({
|
|
3868
|
+
merged.inputOptions.onwarn({
|
|
3869
|
+
message: merged.optionError,
|
|
3870
|
+
code: 'UNKNOWN_OPTION'
|
|
3871
|
+
});
|
|
3815
3872
|
if (merged.inputOptions.watch &&
|
|
3816
3873
|
merged.inputOptions.watch.clearScreen === false) {
|
|
3817
3874
|
screenWriter = stderr;
|
|
@@ -3889,7 +3946,7 @@ function watch(configFile, configs, command, silent) {
|
|
|
3889
3946
|
return;
|
|
3890
3947
|
}
|
|
3891
3948
|
restarting_1 = true;
|
|
3892
|
-
loadConfigFile(configFile,
|
|
3949
|
+
loadConfigFile(configFile, command)
|
|
3893
3950
|
.then(function (configs) {
|
|
3894
3951
|
restarting_1 = false;
|
|
3895
3952
|
if (aborted_1) {
|
|
@@ -3972,8 +4029,8 @@ function runRollup(command) {
|
|
|
3972
4029
|
}
|
|
3973
4030
|
if (command.watch)
|
|
3974
4031
|
process.env.ROLLUP_WATCH = 'true';
|
|
3975
|
-
loadConfigFile(configFile, command
|
|
3976
|
-
.then(function (
|
|
4032
|
+
loadConfigFile(configFile, command)
|
|
4033
|
+
.then(function (configs) { return execute(configFile, configs, command); })
|
|
3977
4034
|
.catch(handleError);
|
|
3978
4035
|
}
|
|
3979
4036
|
else {
|
|
@@ -3987,7 +4044,11 @@ function execute(configFile, configs, command) {
|
|
|
3987
4044
|
else {
|
|
3988
4045
|
return sequence(configs, function (config) {
|
|
3989
4046
|
var warnings = batchWarnings();
|
|
3990
|
-
var _a = mergeOptions({
|
|
4047
|
+
var _a = mergeOptions({
|
|
4048
|
+
config: config,
|
|
4049
|
+
command: command,
|
|
4050
|
+
defaultOnWarnHandler: warnings.add
|
|
4051
|
+
}), inputOptions = _a.inputOptions, outputOptions = _a.outputOptions, deprecations = _a.deprecations, optionError = _a.optionError;
|
|
3991
4052
|
if (deprecations.length) {
|
|
3992
4053
|
inputOptions.onwarn({
|
|
3993
4054
|
code: 'DEPRECATED_OPTIONS',
|
|
@@ -4005,25 +4066,7 @@ function execute(configFile, configs, command) {
|
|
|
4005
4066
|
}
|
|
4006
4067
|
|
|
4007
4068
|
var command = minimist(process.argv.slice(2), {
|
|
4008
|
-
alias:
|
|
4009
|
-
// Aliases
|
|
4010
|
-
strict: 'useStrict',
|
|
4011
|
-
dir: 'output.dir',
|
|
4012
|
-
// Short options
|
|
4013
|
-
c: 'config',
|
|
4014
|
-
d: 'indent',
|
|
4015
|
-
e: 'external',
|
|
4016
|
-
f: 'output.format',
|
|
4017
|
-
g: 'globals',
|
|
4018
|
-
h: 'help',
|
|
4019
|
-
i: 'input',
|
|
4020
|
-
l: 'legacy',
|
|
4021
|
-
m: 'sourcemap',
|
|
4022
|
-
n: 'name',
|
|
4023
|
-
o: 'output.file',
|
|
4024
|
-
v: 'version',
|
|
4025
|
-
w: 'watch'
|
|
4026
|
-
}
|
|
4069
|
+
alias: commandAliases
|
|
4027
4070
|
});
|
|
4028
4071
|
if (command.help || (process.argv.length <= 2 && process.stdin.isTTY)) {
|
|
4029
4072
|
console.log("\n" + help.replace('__VERSION__', version) + "\n"); // eslint-disable-line no-console
|