rollup 0.49.0 → 0.50.0
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 +20 -1
- package/README.md +4 -4
- package/bin/rollup +165 -106
- package/dist/rollup.browser.js +1205 -758
- package/dist/rollup.es.js +1297 -850
- package/dist/rollup.js +1297 -850
- package/package.json +2 -1
package/bin/rollup
CHANGED
|
@@ -13,7 +13,7 @@ var rollup = require('../dist/rollup.js');
|
|
|
13
13
|
var assert = _interopDefault(require('assert'));
|
|
14
14
|
var events = _interopDefault(require('events'));
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var minimist = function (args, opts) {
|
|
17
17
|
if (!opts) { opts = {}; }
|
|
18
18
|
|
|
19
19
|
var flags = { bools : {}, strings : {}, unknownFn: null };
|
|
@@ -250,7 +250,7 @@ function isNumber (x) {
|
|
|
250
250
|
|
|
251
251
|
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, --output.file <output> Output (if absent, prints to stdout)\n-f, --output.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--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--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--interop Include interop block (true by default)\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 --output=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://github.com/rollup/rollup/wiki\n";
|
|
252
252
|
|
|
253
|
-
var version = "0.
|
|
253
|
+
var version = "0.50.0";
|
|
254
254
|
|
|
255
255
|
var modules = {};
|
|
256
256
|
|
|
@@ -277,11 +277,11 @@ requireRelative.resolve = function(requested, relativeTo) {
|
|
|
277
277
|
return module$1._resolveFilename(requested, root);
|
|
278
278
|
};
|
|
279
279
|
|
|
280
|
-
var
|
|
280
|
+
var requireRelative_1 = requireRelative;
|
|
281
281
|
|
|
282
282
|
var matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g;
|
|
283
283
|
|
|
284
|
-
var
|
|
284
|
+
var escapeStringRegexp = function (str) {
|
|
285
285
|
if (typeof str !== 'string') {
|
|
286
286
|
throw new TypeError('Expected a string');
|
|
287
287
|
}
|
|
@@ -293,7 +293,7 @@ function createCommonjsModule(fn, module) {
|
|
|
293
293
|
return module = { exports: {} }, fn(module, module.exports), module.exports;
|
|
294
294
|
}
|
|
295
295
|
|
|
296
|
-
var
|
|
296
|
+
var colorName = {
|
|
297
297
|
"aliceblue": [240, 248, 255],
|
|
298
298
|
"antiquewhite": [250, 235, 215],
|
|
299
299
|
"aqua": [0, 255, 255],
|
|
@@ -453,9 +453,9 @@ var conversions = createCommonjsModule(function (module) {
|
|
|
453
453
|
// do not use box values types (i.e. Number(), String(), etc.)
|
|
454
454
|
|
|
455
455
|
var reverseKeywords = {};
|
|
456
|
-
for (var key in
|
|
457
|
-
if (
|
|
458
|
-
reverseKeywords[
|
|
456
|
+
for (var key in colorName) {
|
|
457
|
+
if (colorName.hasOwnProperty(key)) {
|
|
458
|
+
reverseKeywords[colorName[key]] = key;
|
|
459
459
|
}
|
|
460
460
|
}
|
|
461
461
|
|
|
@@ -628,9 +628,9 @@ convert.rgb.keyword = function (rgb) {
|
|
|
628
628
|
var currentClosestDistance = Infinity;
|
|
629
629
|
var currentClosestKeyword;
|
|
630
630
|
|
|
631
|
-
for (var keyword in
|
|
632
|
-
if (
|
|
633
|
-
var value =
|
|
631
|
+
for (var keyword in colorName) {
|
|
632
|
+
if (colorName.hasOwnProperty(keyword)) {
|
|
633
|
+
var value = colorName[keyword];
|
|
634
634
|
|
|
635
635
|
// Compute comparative distance
|
|
636
636
|
var distance = comparativeDistance(rgb, value);
|
|
@@ -647,7 +647,7 @@ convert.rgb.keyword = function (rgb) {
|
|
|
647
647
|
};
|
|
648
648
|
|
|
649
649
|
convert.keyword.rgb = function (keyword) {
|
|
650
|
-
return
|
|
650
|
+
return colorName[keyword];
|
|
651
651
|
};
|
|
652
652
|
|
|
653
653
|
convert.rgb.xyz = function (rgb) {
|
|
@@ -1478,24 +1478,24 @@ models.forEach(function (fromModel) {
|
|
|
1478
1478
|
});
|
|
1479
1479
|
});
|
|
1480
1480
|
|
|
1481
|
-
var
|
|
1481
|
+
var colorConvert = convert;
|
|
1482
1482
|
|
|
1483
|
-
var
|
|
1483
|
+
var ansiStyles = createCommonjsModule(function (module) {
|
|
1484
1484
|
'use strict';
|
|
1485
1485
|
|
|
1486
1486
|
|
|
1487
1487
|
const wrapAnsi16 = (fn, offset) => function () {
|
|
1488
|
-
const code = fn.apply(
|
|
1488
|
+
const code = fn.apply(colorConvert, arguments);
|
|
1489
1489
|
return `\u001B[${code + offset}m`;
|
|
1490
1490
|
};
|
|
1491
1491
|
|
|
1492
1492
|
const wrapAnsi256 = (fn, offset) => function () {
|
|
1493
|
-
const code = fn.apply(
|
|
1493
|
+
const code = fn.apply(colorConvert, arguments);
|
|
1494
1494
|
return `\u001B[${38 + offset};5;${code}m`;
|
|
1495
1495
|
};
|
|
1496
1496
|
|
|
1497
1497
|
const wrapAnsi16m = (fn, offset) => function () {
|
|
1498
|
-
const rgb = fn.apply(
|
|
1498
|
+
const rgb = fn.apply(colorConvert, arguments);
|
|
1499
1499
|
return `\u001B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`;
|
|
1500
1500
|
};
|
|
1501
1501
|
|
|
@@ -1602,12 +1602,12 @@ function assembleStyles() {
|
|
|
1602
1602
|
rgb: wrapAnsi16m(rgb2rgb, 10)
|
|
1603
1603
|
};
|
|
1604
1604
|
|
|
1605
|
-
for (const key of Object.keys(
|
|
1606
|
-
if (typeof
|
|
1605
|
+
for (const key of Object.keys(colorConvert)) {
|
|
1606
|
+
if (typeof colorConvert[key] !== 'object') {
|
|
1607
1607
|
continue;
|
|
1608
1608
|
}
|
|
1609
1609
|
|
|
1610
|
-
const suite =
|
|
1610
|
+
const suite = colorConvert[key];
|
|
1611
1611
|
|
|
1612
1612
|
if ('ansi16' in suite) {
|
|
1613
1613
|
styles.color.ansi[key] = wrapAnsi16(suite.ansi16, 0);
|
|
@@ -1635,7 +1635,7 @@ Object.defineProperty(module, 'exports', {
|
|
|
1635
1635
|
});
|
|
1636
1636
|
});
|
|
1637
1637
|
|
|
1638
|
-
var
|
|
1638
|
+
var hasFlag = function (flag, argv) {
|
|
1639
1639
|
argv = argv || process.argv;
|
|
1640
1640
|
|
|
1641
1641
|
var terminatorPos = argv.indexOf('--');
|
|
@@ -1645,7 +1645,7 @@ var index$14 = function (flag, argv) {
|
|
|
1645
1645
|
return pos !== -1 && (terminatorPos === -1 ? true : pos < terminatorPos);
|
|
1646
1646
|
};
|
|
1647
1647
|
|
|
1648
|
-
var
|
|
1648
|
+
var supportsColor = createCommonjsModule(function (module) {
|
|
1649
1649
|
'use strict';
|
|
1650
1650
|
|
|
1651
1651
|
|
|
@@ -1666,26 +1666,26 @@ const support = level => {
|
|
|
1666
1666
|
};
|
|
1667
1667
|
|
|
1668
1668
|
let supportLevel = (() => {
|
|
1669
|
-
if (
|
|
1670
|
-
|
|
1671
|
-
|
|
1669
|
+
if (hasFlag('no-color') ||
|
|
1670
|
+
hasFlag('no-colors') ||
|
|
1671
|
+
hasFlag('color=false')) {
|
|
1672
1672
|
return 0;
|
|
1673
1673
|
}
|
|
1674
1674
|
|
|
1675
|
-
if (
|
|
1676
|
-
|
|
1677
|
-
|
|
1675
|
+
if (hasFlag('color=16m') ||
|
|
1676
|
+
hasFlag('color=full') ||
|
|
1677
|
+
hasFlag('color=truecolor')) {
|
|
1678
1678
|
return 3;
|
|
1679
1679
|
}
|
|
1680
1680
|
|
|
1681
|
-
if (
|
|
1681
|
+
if (hasFlag('color=256')) {
|
|
1682
1682
|
return 2;
|
|
1683
1683
|
}
|
|
1684
1684
|
|
|
1685
|
-
if (
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1685
|
+
if (hasFlag('color') ||
|
|
1686
|
+
hasFlag('colors') ||
|
|
1687
|
+
hasFlag('color=true') ||
|
|
1688
|
+
hasFlag('color=always')) {
|
|
1689
1689
|
return 1;
|
|
1690
1690
|
}
|
|
1691
1691
|
|
|
@@ -1712,7 +1712,7 @@ let supportLevel = (() => {
|
|
|
1712
1712
|
}
|
|
1713
1713
|
|
|
1714
1714
|
if ('CI' in env) {
|
|
1715
|
-
if ('TRAVIS' in env || env.
|
|
1715
|
+
if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI'].some(sign => sign in env) || env.CI_NAME === 'codeship') {
|
|
1716
1716
|
return 1;
|
|
1717
1717
|
}
|
|
1718
1718
|
|
|
@@ -1737,7 +1737,7 @@ let supportLevel = (() => {
|
|
|
1737
1737
|
}
|
|
1738
1738
|
}
|
|
1739
1739
|
|
|
1740
|
-
if (
|
|
1740
|
+
if (/-256(color)?$/i.test(env.TERM)) {
|
|
1741
1741
|
return 2;
|
|
1742
1742
|
}
|
|
1743
1743
|
|
|
@@ -1908,7 +1908,7 @@ function applyOptions(obj, options) {
|
|
|
1908
1908
|
options = options || {};
|
|
1909
1909
|
|
|
1910
1910
|
// Detect level if not set manually
|
|
1911
|
-
const scLevel =
|
|
1911
|
+
const scLevel = supportsColor ? supportsColor.level : 0;
|
|
1912
1912
|
obj.level = options.level === undefined ? scLevel : options.level;
|
|
1913
1913
|
obj.enabled = 'enabled' in options ? options.enabled : obj.level > 0;
|
|
1914
1914
|
}
|
|
@@ -1938,22 +1938,22 @@ function Chalk(options) {
|
|
|
1938
1938
|
|
|
1939
1939
|
// Use bright blue on Windows as the normal blue color is illegible
|
|
1940
1940
|
if (isSimpleWindowsTerm) {
|
|
1941
|
-
|
|
1941
|
+
ansiStyles.blue.open = '\u001B[94m';
|
|
1942
1942
|
}
|
|
1943
1943
|
|
|
1944
|
-
for (const key of Object.keys(
|
|
1945
|
-
|
|
1944
|
+
for (const key of Object.keys(ansiStyles)) {
|
|
1945
|
+
ansiStyles[key].closeRe = new RegExp(escapeStringRegexp(ansiStyles[key].close), 'g');
|
|
1946
1946
|
|
|
1947
1947
|
styles[key] = {
|
|
1948
1948
|
get() {
|
|
1949
|
-
const codes =
|
|
1949
|
+
const codes = ansiStyles[key];
|
|
1950
1950
|
return build.call(this, this._styles ? this._styles.concat(codes) : [codes], key);
|
|
1951
1951
|
}
|
|
1952
1952
|
};
|
|
1953
1953
|
}
|
|
1954
1954
|
|
|
1955
|
-
|
|
1956
|
-
for (const model of Object.keys(
|
|
1955
|
+
ansiStyles.color.closeRe = new RegExp(escapeStringRegexp(ansiStyles.color.close), 'g');
|
|
1956
|
+
for (const model of Object.keys(ansiStyles.color.ansi)) {
|
|
1957
1957
|
if (skipModels.has(model)) {
|
|
1958
1958
|
continue;
|
|
1959
1959
|
}
|
|
@@ -1962,11 +1962,11 @@ for (const model of Object.keys(index$6.color.ansi)) {
|
|
|
1962
1962
|
get() {
|
|
1963
1963
|
const level = this.level;
|
|
1964
1964
|
return function () {
|
|
1965
|
-
const open =
|
|
1965
|
+
const open = ansiStyles.color[levelMapping[level]][model].apply(null, arguments);
|
|
1966
1966
|
const codes = {
|
|
1967
1967
|
open,
|
|
1968
|
-
close:
|
|
1969
|
-
closeRe:
|
|
1968
|
+
close: ansiStyles.color.close,
|
|
1969
|
+
closeRe: ansiStyles.color.closeRe
|
|
1970
1970
|
};
|
|
1971
1971
|
return build.call(this, this._styles ? this._styles.concat(codes) : [codes], model);
|
|
1972
1972
|
};
|
|
@@ -1974,8 +1974,8 @@ for (const model of Object.keys(index$6.color.ansi)) {
|
|
|
1974
1974
|
};
|
|
1975
1975
|
}
|
|
1976
1976
|
|
|
1977
|
-
|
|
1978
|
-
for (const model of Object.keys(
|
|
1977
|
+
ansiStyles.bgColor.closeRe = new RegExp(escapeStringRegexp(ansiStyles.bgColor.close), 'g');
|
|
1978
|
+
for (const model of Object.keys(ansiStyles.bgColor.ansi)) {
|
|
1979
1979
|
if (skipModels.has(model)) {
|
|
1980
1980
|
continue;
|
|
1981
1981
|
}
|
|
@@ -1985,11 +1985,11 @@ for (const model of Object.keys(index$6.bgColor.ansi)) {
|
|
|
1985
1985
|
get() {
|
|
1986
1986
|
const level = this.level;
|
|
1987
1987
|
return function () {
|
|
1988
|
-
const open =
|
|
1988
|
+
const open = ansiStyles.bgColor[levelMapping[level]][model].apply(null, arguments);
|
|
1989
1989
|
const codes = {
|
|
1990
1990
|
open,
|
|
1991
|
-
close:
|
|
1992
|
-
closeRe:
|
|
1991
|
+
close: ansiStyles.bgColor.close,
|
|
1992
|
+
closeRe: ansiStyles.bgColor.closeRe
|
|
1993
1993
|
};
|
|
1994
1994
|
return build.call(this, this._styles ? this._styles.concat(codes) : [codes], model);
|
|
1995
1995
|
};
|
|
@@ -2062,9 +2062,9 @@ function applyStyle() {
|
|
|
2062
2062
|
// Turns out that on Windows dimmed gray text becomes invisible in cmd.exe,
|
|
2063
2063
|
// see https://github.com/chalk/chalk/issues/58
|
|
2064
2064
|
// If we're on Windows and we're dealing with a gray color, temporarily make 'dim' a noop.
|
|
2065
|
-
const originalDim =
|
|
2065
|
+
const originalDim = ansiStyles.dim.open;
|
|
2066
2066
|
if (isSimpleWindowsTerm && this.hasGrey) {
|
|
2067
|
-
|
|
2067
|
+
ansiStyles.dim.open = '';
|
|
2068
2068
|
}
|
|
2069
2069
|
|
|
2070
2070
|
for (const code of this._styles.slice().reverse()) {
|
|
@@ -2080,7 +2080,7 @@ function applyStyle() {
|
|
|
2080
2080
|
}
|
|
2081
2081
|
|
|
2082
2082
|
// Reset the original `dim` if we changed it to work around the Windows dimmed gray issue
|
|
2083
|
-
|
|
2083
|
+
ansiStyles.dim.open = originalDim;
|
|
2084
2084
|
|
|
2085
2085
|
return str;
|
|
2086
2086
|
}
|
|
@@ -2105,10 +2105,10 @@ function chalkTag(chalk, strings) {
|
|
|
2105
2105
|
|
|
2106
2106
|
Object.defineProperties(Chalk.prototype, styles);
|
|
2107
2107
|
|
|
2108
|
-
var
|
|
2109
|
-
var supportsColor_1 =
|
|
2108
|
+
var chalk = Chalk(); // eslint-disable-line new-cap
|
|
2109
|
+
var supportsColor_1 = supportsColor;
|
|
2110
2110
|
|
|
2111
|
-
|
|
2111
|
+
chalk.supportsColor = supportsColor_1;
|
|
2112
2112
|
|
|
2113
2113
|
const absolutePath = /^(?:\/|(?:[A-Za-z]:)?[\\|/])/;
|
|
2114
2114
|
|
|
@@ -2122,7 +2122,7 @@ function relativeId ( id ) {
|
|
|
2122
2122
|
return path.relative( process.cwd(), id );
|
|
2123
2123
|
}
|
|
2124
2124
|
|
|
2125
|
-
if ( !process.stderr.isTTY ) {
|
|
2125
|
+
if ( !process.stderr.isTTY ) { chalk.enabled = false; }
|
|
2126
2126
|
|
|
2127
2127
|
// log to stderr to keep `rollup main.js > bundle.js` from breaking
|
|
2128
2128
|
const stderr = console.error.bind( console ); // eslint-disable-line no-console
|
|
@@ -2132,11 +2132,11 @@ function handleError ( err, recover ) {
|
|
|
2132
2132
|
if (err.name) { description = `${err.name}: ${description}`; }
|
|
2133
2133
|
const message = (err.plugin ? `(${err.plugin} plugin) ${description}` : description) || err;
|
|
2134
2134
|
|
|
2135
|
-
stderr(
|
|
2135
|
+
stderr( chalk.bold.red( `[!] ${chalk.bold( message )}` ) );
|
|
2136
2136
|
|
|
2137
2137
|
// TODO should this be "err.url || (err.file && err.loc.file) || err.id"?
|
|
2138
2138
|
if ( err.url ) {
|
|
2139
|
-
stderr(
|
|
2139
|
+
stderr( chalk.cyan( err.url ) );
|
|
2140
2140
|
}
|
|
2141
2141
|
|
|
2142
2142
|
if ( err.loc ) {
|
|
@@ -2146,9 +2146,9 @@ function handleError ( err, recover ) {
|
|
|
2146
2146
|
}
|
|
2147
2147
|
|
|
2148
2148
|
if ( err.frame ) {
|
|
2149
|
-
stderr(
|
|
2149
|
+
stderr( chalk.dim( err.frame ) );
|
|
2150
2150
|
} else if ( err.stack ) {
|
|
2151
|
-
stderr(
|
|
2151
|
+
stderr( chalk.dim( err.stack ) );
|
|
2152
2152
|
}
|
|
2153
2153
|
|
|
2154
2154
|
stderr( '' );
|
|
@@ -2244,7 +2244,8 @@ function mergeOptions ( config, command ) {
|
|
|
2244
2244
|
context: config.context,
|
|
2245
2245
|
moduleContext: config.moduleContext,
|
|
2246
2246
|
plugins: config.plugins,
|
|
2247
|
-
onwarn: config.onwarn
|
|
2247
|
+
onwarn: config.onwarn,
|
|
2248
|
+
watch: config.watch
|
|
2248
2249
|
};
|
|
2249
2250
|
|
|
2250
2251
|
// legacy, to ensure e.g. commonjs plugin still works
|
|
@@ -2300,14 +2301,21 @@ function mergeOptions ( config, command ) {
|
|
|
2300
2301
|
paths: getOption('paths')
|
|
2301
2302
|
};
|
|
2302
2303
|
|
|
2303
|
-
|
|
2304
|
-
|
|
2304
|
+
let mergedOutputOptions;
|
|
2305
|
+
if (Array.isArray(config.output)) {
|
|
2306
|
+
mergedOutputOptions = config.output.map((output) => Object.assign({}, output, command.output));
|
|
2307
|
+
} else if (config.output && command.output) {
|
|
2308
|
+
mergedOutputOptions = [Object.assign({}, config.output, command.output)];
|
|
2309
|
+
} else {
|
|
2310
|
+
mergedOutputOptions = (command.output || config.output) ?
|
|
2305
2311
|
ensureArray(command.output || config.output) :
|
|
2306
2312
|
[{
|
|
2307
2313
|
file: command.output ? command.output.file : null,
|
|
2308
2314
|
format: command.output ? command.output.format : null
|
|
2309
|
-
}]
|
|
2310
|
-
|
|
2315
|
+
}];
|
|
2316
|
+
}
|
|
2317
|
+
|
|
2318
|
+
const outputOptions = mergedOutputOptions.map(output => {
|
|
2311
2319
|
return Object.assign({}, baseOutputOptions, output);
|
|
2312
2320
|
});
|
|
2313
2321
|
|
|
@@ -2394,7 +2402,7 @@ function batchWarnings () {
|
|
|
2394
2402
|
handler.fn( warnings );
|
|
2395
2403
|
} else {
|
|
2396
2404
|
warnings.forEach( warning => {
|
|
2397
|
-
stderr( `${
|
|
2405
|
+
stderr( `${chalk.bold.yellow('(!)')} ${chalk.bold.yellow( warning.message )}` );
|
|
2398
2406
|
|
|
2399
2407
|
if ( warning.url ) { info( warning.url ); }
|
|
2400
2408
|
|
|
@@ -2404,7 +2412,7 @@ function batchWarnings () {
|
|
|
2404
2412
|
`${relativeId( id )}: (${warning.loc.line}:${warning.loc.column})` :
|
|
2405
2413
|
relativeId( id );
|
|
2406
2414
|
|
|
2407
|
-
stderr(
|
|
2415
|
+
stderr( chalk.bold( relativeId( loc ) ) );
|
|
2408
2416
|
}
|
|
2409
2417
|
|
|
2410
2418
|
if ( warning.frame ) { info( warning.frame ); }
|
|
@@ -2423,7 +2431,7 @@ const immediateHandlers = {
|
|
|
2423
2431
|
title( `Some options have been renamed` );
|
|
2424
2432
|
info( `https://gist.github.com/Rich-Harris/d472c50732dab03efeb37472b08a3f32` );
|
|
2425
2433
|
warning.deprecations.forEach(option => {
|
|
2426
|
-
stderr( `${
|
|
2434
|
+
stderr( `${chalk.bold(option.old)} is now ${option.new}` );
|
|
2427
2435
|
});
|
|
2428
2436
|
},
|
|
2429
2437
|
|
|
@@ -2472,7 +2480,7 @@ const deferredHandlers = {
|
|
|
2472
2480
|
|
|
2473
2481
|
Array.from( dependencies.keys() ).forEach( dependency => {
|
|
2474
2482
|
const importers = dependencies.get( dependency );
|
|
2475
|
-
stderr( `${
|
|
2483
|
+
stderr( `${chalk.bold( dependency )} (imported by ${importers.join( ', ' )})` );
|
|
2476
2484
|
});
|
|
2477
2485
|
}
|
|
2478
2486
|
},
|
|
@@ -2484,9 +2492,9 @@ const deferredHandlers = {
|
|
|
2484
2492
|
info( 'https://github.com/rollup/rollup/wiki/Troubleshooting#name-is-not-exported-by-module' );
|
|
2485
2493
|
|
|
2486
2494
|
warnings.forEach( warning => {
|
|
2487
|
-
stderr(
|
|
2495
|
+
stderr( chalk.bold( warning.importer ) );
|
|
2488
2496
|
stderr( `${warning.missing} is not exported by ${warning.exporter}` );
|
|
2489
|
-
stderr(
|
|
2497
|
+
stderr( chalk.grey( warning.frame ) );
|
|
2490
2498
|
});
|
|
2491
2499
|
}
|
|
2492
2500
|
},
|
|
@@ -2522,7 +2530,7 @@ const deferredHandlers = {
|
|
|
2522
2530
|
fn: warnings => {
|
|
2523
2531
|
title( `Conflicting re-exports` );
|
|
2524
2532
|
warnings.forEach(warning => {
|
|
2525
|
-
stderr( `${
|
|
2533
|
+
stderr( `${chalk.bold(relativeId(warning.reexporter))} re-exports '${warning.name}' from both ${relativeId(warning.sources[0])} and ${relativeId(warning.sources[1])} (will be ignored)` );
|
|
2526
2534
|
});
|
|
2527
2535
|
}
|
|
2528
2536
|
},
|
|
@@ -2533,7 +2541,7 @@ const deferredHandlers = {
|
|
|
2533
2541
|
title( `Missing global variable ${warnings.length > 1 ? 'names' : 'name'}` );
|
|
2534
2542
|
stderr( `Use options.globals to specify browser global variable names corresponding to external modules` );
|
|
2535
2543
|
warnings.forEach(warning => {
|
|
2536
|
-
stderr(`${
|
|
2544
|
+
stderr(`${chalk.bold(warning.source)} (guessing '${warning.guess}')`);
|
|
2537
2545
|
});
|
|
2538
2546
|
}
|
|
2539
2547
|
},
|
|
@@ -2578,7 +2586,7 @@ const deferredHandlers = {
|
|
|
2578
2586
|
`${relativeId( warning.id )}: (${warning.loc.line}:${warning.loc.column})` :
|
|
2579
2587
|
relativeId( warning.id );
|
|
2580
2588
|
|
|
2581
|
-
stderr(
|
|
2589
|
+
stderr( chalk.bold( relativeId( loc ) ) );
|
|
2582
2590
|
if ( warning.frame ) { info( warning.frame ); }
|
|
2583
2591
|
});
|
|
2584
2592
|
});
|
|
@@ -2588,11 +2596,11 @@ const deferredHandlers = {
|
|
|
2588
2596
|
};
|
|
2589
2597
|
|
|
2590
2598
|
function title ( str ) {
|
|
2591
|
-
stderr( `${
|
|
2599
|
+
stderr( `${chalk.bold.yellow('(!)')} ${chalk.bold.yellow( str )}` );
|
|
2592
2600
|
}
|
|
2593
2601
|
|
|
2594
2602
|
function info ( url ) {
|
|
2595
|
-
stderr(
|
|
2603
|
+
stderr( chalk.grey( url ) );
|
|
2596
2604
|
}
|
|
2597
2605
|
|
|
2598
2606
|
function nest(array, prop) {
|
|
@@ -2624,8 +2632,8 @@ function showTruncatedWarnings(warnings) {
|
|
|
2624
2632
|
var id = ref.key;
|
|
2625
2633
|
var items = ref.items;
|
|
2626
2634
|
|
|
2627
|
-
stderr(
|
|
2628
|
-
stderr(
|
|
2635
|
+
stderr( chalk.bold( relativeId( id ) ) );
|
|
2636
|
+
stderr( chalk.grey( items[0].frame ) );
|
|
2629
2637
|
|
|
2630
2638
|
if ( items.length > 1 ) {
|
|
2631
2639
|
stderr( `...and ${items.length - 1} other ${items.length > 2 ? 'occurrences' : 'occurrence'}` );
|
|
@@ -2649,7 +2657,7 @@ function loadConfigFile (configFile, silent) {
|
|
|
2649
2657
|
})
|
|
2650
2658
|
.then( bundle => {
|
|
2651
2659
|
if ( !silent && warnings.count > 0 ) {
|
|
2652
|
-
stderr(
|
|
2660
|
+
stderr( chalk.bold( `loaded ${relativeId( configFile )} with warnings` ) );
|
|
2653
2661
|
warnings.flush();
|
|
2654
2662
|
}
|
|
2655
2663
|
|
|
@@ -2701,7 +2709,7 @@ function sequence ( array, fn ) {
|
|
|
2701
2709
|
return promise.then( () => results );
|
|
2702
2710
|
}
|
|
2703
2711
|
|
|
2704
|
-
var
|
|
2712
|
+
var parseMs = function (ms) {
|
|
2705
2713
|
if (typeof ms !== 'number') {
|
|
2706
2714
|
throw new TypeError('Expected a number');
|
|
2707
2715
|
}
|
|
@@ -2781,7 +2789,7 @@ var hero = "heroes";
|
|
|
2781
2789
|
var hoof = "hooves";
|
|
2782
2790
|
var hovercraft = "hovercraft";
|
|
2783
2791
|
var hypothesis = "hypotheses";
|
|
2784
|
-
var index
|
|
2792
|
+
var index = "indices";
|
|
2785
2793
|
var kakapo = "kakapo";
|
|
2786
2794
|
var knife = "knives";
|
|
2787
2795
|
var larva = "larvae";
|
|
@@ -2923,7 +2931,7 @@ var irregularPlurals = {
|
|
|
2923
2931
|
hoof: hoof,
|
|
2924
2932
|
hovercraft: hovercraft,
|
|
2925
2933
|
hypothesis: hypothesis,
|
|
2926
|
-
index: index
|
|
2934
|
+
index: index,
|
|
2927
2935
|
kakapo: kakapo,
|
|
2928
2936
|
knife: knife,
|
|
2929
2937
|
larva: larva,
|
|
@@ -3069,7 +3077,7 @@ var irregularPlurals$1 = Object.freeze({
|
|
|
3069
3077
|
hoof: hoof,
|
|
3070
3078
|
hovercraft: hovercraft,
|
|
3071
3079
|
hypothesis: hypothesis,
|
|
3072
|
-
index: index
|
|
3080
|
+
index: index,
|
|
3073
3081
|
kakapo: kakapo,
|
|
3074
3082
|
knife: knife,
|
|
3075
3083
|
larva: larva,
|
|
@@ -3151,7 +3159,7 @@ var irregularPlurals$1 = Object.freeze({
|
|
|
3151
3159
|
|
|
3152
3160
|
var irregularPlurals$2 = ( irregularPlurals$1 && irregularPlurals ) || irregularPlurals$1;
|
|
3153
3161
|
|
|
3154
|
-
var
|
|
3162
|
+
var plur = function (str, plural, count) {
|
|
3155
3163
|
if (typeof plural === 'number') {
|
|
3156
3164
|
count = plural;
|
|
3157
3165
|
}
|
|
@@ -3169,7 +3177,7 @@ var index$19 = function (str, plural, count) {
|
|
|
3169
3177
|
return count === 1 ? str : plural;
|
|
3170
3178
|
};
|
|
3171
3179
|
|
|
3172
|
-
var
|
|
3180
|
+
var prettyMs = createCommonjsModule(function (module) {
|
|
3173
3181
|
'use strict';
|
|
3174
3182
|
|
|
3175
3183
|
|
|
@@ -3183,7 +3191,7 @@ module.exports = (ms, opts) => {
|
|
|
3183
3191
|
|
|
3184
3192
|
if (ms < 1000) {
|
|
3185
3193
|
const msDecimalDigits = typeof opts.msDecimalDigits === 'number' ? opts.msDecimalDigits : 0;
|
|
3186
|
-
return (msDecimalDigits ? ms.toFixed(msDecimalDigits) : Math.ceil(ms)) + (opts.verbose ? ' ' +
|
|
3194
|
+
return (msDecimalDigits ? ms.toFixed(msDecimalDigits) : Math.ceil(ms)) + (opts.verbose ? ' ' + plur('millisecond', Math.ceil(ms)) : 'ms');
|
|
3187
3195
|
}
|
|
3188
3196
|
|
|
3189
3197
|
const ret = [];
|
|
@@ -3193,12 +3201,12 @@ module.exports = (ms, opts) => {
|
|
|
3193
3201
|
return;
|
|
3194
3202
|
}
|
|
3195
3203
|
|
|
3196
|
-
const postfix = opts.verbose ? ' ' +
|
|
3204
|
+
const postfix = opts.verbose ? ' ' + plur(long, val) : short;
|
|
3197
3205
|
|
|
3198
3206
|
ret.push((valStr || val) + postfix);
|
|
3199
3207
|
};
|
|
3200
3208
|
|
|
3201
|
-
const parsed =
|
|
3209
|
+
const parsed = parseMs(ms);
|
|
3202
3210
|
|
|
3203
3211
|
add(Math.trunc(parsed.days / 365), 'year', 'y');
|
|
3204
3212
|
add(parsed.days % 365, 'day', 'd');
|
|
@@ -3244,7 +3252,7 @@ function build$1 ( inputOptions, outputOptions, warnings, silent ) {
|
|
|
3244
3252
|
|
|
3245
3253
|
const start = Date.now();
|
|
3246
3254
|
const files = useStdout ? [ 'stdout' ] : outputOptions.map( t => relativeId( t.file ) );
|
|
3247
|
-
if ( !silent ) { stderr(
|
|
3255
|
+
if ( !silent ) { stderr( chalk.cyan( `\n${chalk.bold( inputOptions.input )} → ${chalk.bold( files.join( ', ' ) )}...` ) ); }
|
|
3248
3256
|
|
|
3249
3257
|
return rollup.rollup( inputOptions )
|
|
3250
3258
|
.then( bundle => {
|
|
@@ -3275,7 +3283,7 @@ function build$1 ( inputOptions, outputOptions, warnings, silent ) {
|
|
|
3275
3283
|
})
|
|
3276
3284
|
.then( () => {
|
|
3277
3285
|
warnings.flush();
|
|
3278
|
-
if ( !silent ) { stderr(
|
|
3286
|
+
if ( !silent ) { stderr( chalk.green( `created ${chalk.bold( files.join( ', ' ) )} in ${chalk.bold(prettyMs( Date.now() - start))}` ) ); }
|
|
3279
3287
|
})
|
|
3280
3288
|
.catch( handleError );
|
|
3281
3289
|
}
|
|
@@ -3366,7 +3374,7 @@ if (!emitter.infinite) {
|
|
|
3366
3374
|
emitter.infinite = true;
|
|
3367
3375
|
}
|
|
3368
3376
|
|
|
3369
|
-
var
|
|
3377
|
+
var signalExit = function (cb, opts) {
|
|
3370
3378
|
assert.equal(typeof cb, 'function', 'a callback must be provided for exit handler');
|
|
3371
3379
|
|
|
3372
3380
|
if (loaded === false) {
|
|
@@ -3494,11 +3502,60 @@ function processEmit (ev, arg) {
|
|
|
3494
3502
|
}
|
|
3495
3503
|
}
|
|
3496
3504
|
|
|
3497
|
-
|
|
3498
|
-
|
|
3499
|
-
|
|
3505
|
+
signalExit.unload = unload_1;
|
|
3506
|
+
signalExit.signals = signals_1;
|
|
3507
|
+
signalExit.load = load_1;
|
|
3508
|
+
|
|
3509
|
+
var timeZone = createCommonjsModule(function (module) {
|
|
3510
|
+
'use strict';
|
|
3511
|
+
module.exports = date => {
|
|
3512
|
+
const offset = (date || new Date()).getTimezoneOffset();
|
|
3513
|
+
const absOffset = Math.abs(offset);
|
|
3514
|
+
const hours = Math.floor(absOffset / 60);
|
|
3515
|
+
const minutes = absOffset % 60;
|
|
3516
|
+
const minutesOut = minutes > 0 ? ':' + ('0' + minutes).slice(-2) : '';
|
|
3517
|
+
|
|
3518
|
+
return (offset < 0 ? '+' : '-') + hours + minutesOut;
|
|
3519
|
+
};
|
|
3520
|
+
});
|
|
3521
|
+
|
|
3522
|
+
var dateTime = createCommonjsModule(function (module) {
|
|
3523
|
+
'use strict';
|
|
3524
|
+
|
|
3525
|
+
|
|
3526
|
+
module.exports = options => {
|
|
3527
|
+
options = Object.assign({
|
|
3528
|
+
date: new Date(),
|
|
3529
|
+
local: true,
|
|
3530
|
+
showTimeZone: false,
|
|
3531
|
+
showMilliseconds: false
|
|
3532
|
+
}, options);
|
|
3500
3533
|
|
|
3501
|
-
|
|
3534
|
+
let date = options.date;
|
|
3535
|
+
|
|
3536
|
+
if (options.local) {
|
|
3537
|
+
// Offset the date so it will return the correct value when getting the ISO string
|
|
3538
|
+
date = new Date(date.getTime() - (date.getTimezoneOffset() * 60000));
|
|
3539
|
+
}
|
|
3540
|
+
|
|
3541
|
+
let end = '';
|
|
3542
|
+
|
|
3543
|
+
if (options.showTimeZone) {
|
|
3544
|
+
end = ' UTC' + (options.local ? timeZone(date) : '');
|
|
3545
|
+
}
|
|
3546
|
+
|
|
3547
|
+
if (options.showMilliseconds && date.getUTCMilliseconds() > 0) {
|
|
3548
|
+
end = ` ${date.getUTCMilliseconds()}ms${end}`;
|
|
3549
|
+
}
|
|
3550
|
+
|
|
3551
|
+
return date
|
|
3552
|
+
.toISOString()
|
|
3553
|
+
.replace(/T/, ' ')
|
|
3554
|
+
.replace(/\..+/, end);
|
|
3555
|
+
};
|
|
3556
|
+
});
|
|
3557
|
+
|
|
3558
|
+
var ansiEscapes = createCommonjsModule(function (module) {
|
|
3502
3559
|
'use strict';
|
|
3503
3560
|
const x = module.exports;
|
|
3504
3561
|
const ESC = '\u001B[';
|
|
@@ -3625,7 +3682,7 @@ function alternateScreen ( enabled ) {
|
|
|
3625
3682
|
process.stderr.write(HIDE_ALTERNATE_SCREEN);
|
|
3626
3683
|
},
|
|
3627
3684
|
reset( heading ) {
|
|
3628
|
-
stderr( `${
|
|
3685
|
+
stderr( `${ansiEscapes.eraseScreen}${ansiEscapes.cursorTo(0, 0)}${heading}` );
|
|
3629
3686
|
}
|
|
3630
3687
|
};
|
|
3631
3688
|
}
|
|
@@ -3642,7 +3699,7 @@ function watch$1(configFile, configs, command, silent) {
|
|
|
3642
3699
|
let configWatcher;
|
|
3643
3700
|
|
|
3644
3701
|
function start(configs) {
|
|
3645
|
-
screen.reset(
|
|
3702
|
+
screen.reset( chalk.underline( `rollup v${rollup.VERSION}` ) );
|
|
3646
3703
|
|
|
3647
3704
|
configs = configs.map(options => {
|
|
3648
3705
|
const merged = mergeOptions(options, command);
|
|
@@ -3683,26 +3740,28 @@ function watch$1(configFile, configs, command, silent) {
|
|
|
3683
3740
|
break;
|
|
3684
3741
|
|
|
3685
3742
|
case 'START':
|
|
3686
|
-
screen.reset(
|
|
3743
|
+
screen.reset( chalk.underline( `rollup v${rollup.VERSION}` ) );
|
|
3687
3744
|
break;
|
|
3688
3745
|
|
|
3689
3746
|
case 'BUNDLE_START':
|
|
3690
|
-
if ( !silent ) { stderr(
|
|
3747
|
+
if ( !silent ) { stderr( chalk.cyan( `bundles ${chalk.bold( event.input )} → ${chalk.bold( event.output.map( relativeId ).join( ', ' ) )}...` ) ); }
|
|
3691
3748
|
break;
|
|
3692
3749
|
|
|
3693
3750
|
case 'BUNDLE_END':
|
|
3694
3751
|
warnings.flush();
|
|
3695
|
-
if ( !silent ) { stderr(
|
|
3752
|
+
if ( !silent ) { stderr( chalk.green( `created ${chalk.bold( event.output.map( relativeId ).join( ', ' ) )} in ${chalk.bold(prettyMs(event.duration))}` ) ); }
|
|
3696
3753
|
break;
|
|
3697
3754
|
|
|
3698
3755
|
case 'END':
|
|
3699
|
-
if ( !silent && isTTY ) {
|
|
3756
|
+
if ( !silent && isTTY ) {
|
|
3757
|
+
stderr( `\n[${dateTime()}] waiting for changes...` );
|
|
3758
|
+
}
|
|
3700
3759
|
}
|
|
3701
3760
|
});
|
|
3702
3761
|
}
|
|
3703
3762
|
|
|
3704
3763
|
// catch ctrl+c, kill, and uncaught errors
|
|
3705
|
-
const removeOnExit =
|
|
3764
|
+
const removeOnExit = signalExit(close);
|
|
3706
3765
|
process.on('uncaughtException', close);
|
|
3707
3766
|
|
|
3708
3767
|
// only listen to stdin if it is a pipe
|
|
@@ -3800,10 +3859,10 @@ function runRollup ( command ) {
|
|
|
3800
3859
|
if ( configFile.slice( 0, 5 ) === 'node:' ) {
|
|
3801
3860
|
const pkgName = configFile.slice( 5 );
|
|
3802
3861
|
try {
|
|
3803
|
-
configFile =
|
|
3862
|
+
configFile = requireRelative_1.resolve( `rollup-config-${pkgName}`, process.cwd() );
|
|
3804
3863
|
} catch ( err ) {
|
|
3805
3864
|
try {
|
|
3806
|
-
configFile =
|
|
3865
|
+
configFile = requireRelative_1.resolve( pkgName, process.cwd() );
|
|
3807
3866
|
} catch ( err ) {
|
|
3808
3867
|
if ( err.code === 'MODULE_NOT_FOUND' ) {
|
|
3809
3868
|
handleError({
|
|
@@ -3864,7 +3923,7 @@ function execute ( configFile, configs, command ) {
|
|
|
3864
3923
|
}
|
|
3865
3924
|
}
|
|
3866
3925
|
|
|
3867
|
-
const command =
|
|
3926
|
+
const command = minimist( process.argv.slice( 2 ), {
|
|
3868
3927
|
alias: {
|
|
3869
3928
|
// Aliases
|
|
3870
3929
|
strict: 'useStrict',
|