rollup 0.49.3 → 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 +5 -0
- package/README.md +4 -4
- package/bin/rollup +152 -101
- package/dist/rollup.browser.js +1063 -805
- package/dist/rollup.es.js +1155 -897
- package/dist/rollup.js +1155 -897
- 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( '' );
|
|
@@ -2402,7 +2402,7 @@ function batchWarnings () {
|
|
|
2402
2402
|
handler.fn( warnings );
|
|
2403
2403
|
} else {
|
|
2404
2404
|
warnings.forEach( warning => {
|
|
2405
|
-
stderr( `${
|
|
2405
|
+
stderr( `${chalk.bold.yellow('(!)')} ${chalk.bold.yellow( warning.message )}` );
|
|
2406
2406
|
|
|
2407
2407
|
if ( warning.url ) { info( warning.url ); }
|
|
2408
2408
|
|
|
@@ -2412,7 +2412,7 @@ function batchWarnings () {
|
|
|
2412
2412
|
`${relativeId( id )}: (${warning.loc.line}:${warning.loc.column})` :
|
|
2413
2413
|
relativeId( id );
|
|
2414
2414
|
|
|
2415
|
-
stderr(
|
|
2415
|
+
stderr( chalk.bold( relativeId( loc ) ) );
|
|
2416
2416
|
}
|
|
2417
2417
|
|
|
2418
2418
|
if ( warning.frame ) { info( warning.frame ); }
|
|
@@ -2431,7 +2431,7 @@ const immediateHandlers = {
|
|
|
2431
2431
|
title( `Some options have been renamed` );
|
|
2432
2432
|
info( `https://gist.github.com/Rich-Harris/d472c50732dab03efeb37472b08a3f32` );
|
|
2433
2433
|
warning.deprecations.forEach(option => {
|
|
2434
|
-
stderr( `${
|
|
2434
|
+
stderr( `${chalk.bold(option.old)} is now ${option.new}` );
|
|
2435
2435
|
});
|
|
2436
2436
|
},
|
|
2437
2437
|
|
|
@@ -2480,7 +2480,7 @@ const deferredHandlers = {
|
|
|
2480
2480
|
|
|
2481
2481
|
Array.from( dependencies.keys() ).forEach( dependency => {
|
|
2482
2482
|
const importers = dependencies.get( dependency );
|
|
2483
|
-
stderr( `${
|
|
2483
|
+
stderr( `${chalk.bold( dependency )} (imported by ${importers.join( ', ' )})` );
|
|
2484
2484
|
});
|
|
2485
2485
|
}
|
|
2486
2486
|
},
|
|
@@ -2492,9 +2492,9 @@ const deferredHandlers = {
|
|
|
2492
2492
|
info( 'https://github.com/rollup/rollup/wiki/Troubleshooting#name-is-not-exported-by-module' );
|
|
2493
2493
|
|
|
2494
2494
|
warnings.forEach( warning => {
|
|
2495
|
-
stderr(
|
|
2495
|
+
stderr( chalk.bold( warning.importer ) );
|
|
2496
2496
|
stderr( `${warning.missing} is not exported by ${warning.exporter}` );
|
|
2497
|
-
stderr(
|
|
2497
|
+
stderr( chalk.grey( warning.frame ) );
|
|
2498
2498
|
});
|
|
2499
2499
|
}
|
|
2500
2500
|
},
|
|
@@ -2530,7 +2530,7 @@ const deferredHandlers = {
|
|
|
2530
2530
|
fn: warnings => {
|
|
2531
2531
|
title( `Conflicting re-exports` );
|
|
2532
2532
|
warnings.forEach(warning => {
|
|
2533
|
-
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)` );
|
|
2534
2534
|
});
|
|
2535
2535
|
}
|
|
2536
2536
|
},
|
|
@@ -2541,7 +2541,7 @@ const deferredHandlers = {
|
|
|
2541
2541
|
title( `Missing global variable ${warnings.length > 1 ? 'names' : 'name'}` );
|
|
2542
2542
|
stderr( `Use options.globals to specify browser global variable names corresponding to external modules` );
|
|
2543
2543
|
warnings.forEach(warning => {
|
|
2544
|
-
stderr(`${
|
|
2544
|
+
stderr(`${chalk.bold(warning.source)} (guessing '${warning.guess}')`);
|
|
2545
2545
|
});
|
|
2546
2546
|
}
|
|
2547
2547
|
},
|
|
@@ -2586,7 +2586,7 @@ const deferredHandlers = {
|
|
|
2586
2586
|
`${relativeId( warning.id )}: (${warning.loc.line}:${warning.loc.column})` :
|
|
2587
2587
|
relativeId( warning.id );
|
|
2588
2588
|
|
|
2589
|
-
stderr(
|
|
2589
|
+
stderr( chalk.bold( relativeId( loc ) ) );
|
|
2590
2590
|
if ( warning.frame ) { info( warning.frame ); }
|
|
2591
2591
|
});
|
|
2592
2592
|
});
|
|
@@ -2596,11 +2596,11 @@ const deferredHandlers = {
|
|
|
2596
2596
|
};
|
|
2597
2597
|
|
|
2598
2598
|
function title ( str ) {
|
|
2599
|
-
stderr( `${
|
|
2599
|
+
stderr( `${chalk.bold.yellow('(!)')} ${chalk.bold.yellow( str )}` );
|
|
2600
2600
|
}
|
|
2601
2601
|
|
|
2602
2602
|
function info ( url ) {
|
|
2603
|
-
stderr(
|
|
2603
|
+
stderr( chalk.grey( url ) );
|
|
2604
2604
|
}
|
|
2605
2605
|
|
|
2606
2606
|
function nest(array, prop) {
|
|
@@ -2632,8 +2632,8 @@ function showTruncatedWarnings(warnings) {
|
|
|
2632
2632
|
var id = ref.key;
|
|
2633
2633
|
var items = ref.items;
|
|
2634
2634
|
|
|
2635
|
-
stderr(
|
|
2636
|
-
stderr(
|
|
2635
|
+
stderr( chalk.bold( relativeId( id ) ) );
|
|
2636
|
+
stderr( chalk.grey( items[0].frame ) );
|
|
2637
2637
|
|
|
2638
2638
|
if ( items.length > 1 ) {
|
|
2639
2639
|
stderr( `...and ${items.length - 1} other ${items.length > 2 ? 'occurrences' : 'occurrence'}` );
|
|
@@ -2657,7 +2657,7 @@ function loadConfigFile (configFile, silent) {
|
|
|
2657
2657
|
})
|
|
2658
2658
|
.then( bundle => {
|
|
2659
2659
|
if ( !silent && warnings.count > 0 ) {
|
|
2660
|
-
stderr(
|
|
2660
|
+
stderr( chalk.bold( `loaded ${relativeId( configFile )} with warnings` ) );
|
|
2661
2661
|
warnings.flush();
|
|
2662
2662
|
}
|
|
2663
2663
|
|
|
@@ -2709,7 +2709,7 @@ function sequence ( array, fn ) {
|
|
|
2709
2709
|
return promise.then( () => results );
|
|
2710
2710
|
}
|
|
2711
2711
|
|
|
2712
|
-
var
|
|
2712
|
+
var parseMs = function (ms) {
|
|
2713
2713
|
if (typeof ms !== 'number') {
|
|
2714
2714
|
throw new TypeError('Expected a number');
|
|
2715
2715
|
}
|
|
@@ -2789,7 +2789,7 @@ var hero = "heroes";
|
|
|
2789
2789
|
var hoof = "hooves";
|
|
2790
2790
|
var hovercraft = "hovercraft";
|
|
2791
2791
|
var hypothesis = "hypotheses";
|
|
2792
|
-
var index
|
|
2792
|
+
var index = "indices";
|
|
2793
2793
|
var kakapo = "kakapo";
|
|
2794
2794
|
var knife = "knives";
|
|
2795
2795
|
var larva = "larvae";
|
|
@@ -2931,7 +2931,7 @@ var irregularPlurals = {
|
|
|
2931
2931
|
hoof: hoof,
|
|
2932
2932
|
hovercraft: hovercraft,
|
|
2933
2933
|
hypothesis: hypothesis,
|
|
2934
|
-
index: index
|
|
2934
|
+
index: index,
|
|
2935
2935
|
kakapo: kakapo,
|
|
2936
2936
|
knife: knife,
|
|
2937
2937
|
larva: larva,
|
|
@@ -3077,7 +3077,7 @@ var irregularPlurals$1 = Object.freeze({
|
|
|
3077
3077
|
hoof: hoof,
|
|
3078
3078
|
hovercraft: hovercraft,
|
|
3079
3079
|
hypothesis: hypothesis,
|
|
3080
|
-
index: index
|
|
3080
|
+
index: index,
|
|
3081
3081
|
kakapo: kakapo,
|
|
3082
3082
|
knife: knife,
|
|
3083
3083
|
larva: larva,
|
|
@@ -3159,7 +3159,7 @@ var irregularPlurals$1 = Object.freeze({
|
|
|
3159
3159
|
|
|
3160
3160
|
var irregularPlurals$2 = ( irregularPlurals$1 && irregularPlurals ) || irregularPlurals$1;
|
|
3161
3161
|
|
|
3162
|
-
var
|
|
3162
|
+
var plur = function (str, plural, count) {
|
|
3163
3163
|
if (typeof plural === 'number') {
|
|
3164
3164
|
count = plural;
|
|
3165
3165
|
}
|
|
@@ -3177,7 +3177,7 @@ var index$19 = function (str, plural, count) {
|
|
|
3177
3177
|
return count === 1 ? str : plural;
|
|
3178
3178
|
};
|
|
3179
3179
|
|
|
3180
|
-
var
|
|
3180
|
+
var prettyMs = createCommonjsModule(function (module) {
|
|
3181
3181
|
'use strict';
|
|
3182
3182
|
|
|
3183
3183
|
|
|
@@ -3191,7 +3191,7 @@ module.exports = (ms, opts) => {
|
|
|
3191
3191
|
|
|
3192
3192
|
if (ms < 1000) {
|
|
3193
3193
|
const msDecimalDigits = typeof opts.msDecimalDigits === 'number' ? opts.msDecimalDigits : 0;
|
|
3194
|
-
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');
|
|
3195
3195
|
}
|
|
3196
3196
|
|
|
3197
3197
|
const ret = [];
|
|
@@ -3201,12 +3201,12 @@ module.exports = (ms, opts) => {
|
|
|
3201
3201
|
return;
|
|
3202
3202
|
}
|
|
3203
3203
|
|
|
3204
|
-
const postfix = opts.verbose ? ' ' +
|
|
3204
|
+
const postfix = opts.verbose ? ' ' + plur(long, val) : short;
|
|
3205
3205
|
|
|
3206
3206
|
ret.push((valStr || val) + postfix);
|
|
3207
3207
|
};
|
|
3208
3208
|
|
|
3209
|
-
const parsed =
|
|
3209
|
+
const parsed = parseMs(ms);
|
|
3210
3210
|
|
|
3211
3211
|
add(Math.trunc(parsed.days / 365), 'year', 'y');
|
|
3212
3212
|
add(parsed.days % 365, 'day', 'd');
|
|
@@ -3252,7 +3252,7 @@ function build$1 ( inputOptions, outputOptions, warnings, silent ) {
|
|
|
3252
3252
|
|
|
3253
3253
|
const start = Date.now();
|
|
3254
3254
|
const files = useStdout ? [ 'stdout' ] : outputOptions.map( t => relativeId( t.file ) );
|
|
3255
|
-
if ( !silent ) { stderr(
|
|
3255
|
+
if ( !silent ) { stderr( chalk.cyan( `\n${chalk.bold( inputOptions.input )} → ${chalk.bold( files.join( ', ' ) )}...` ) ); }
|
|
3256
3256
|
|
|
3257
3257
|
return rollup.rollup( inputOptions )
|
|
3258
3258
|
.then( bundle => {
|
|
@@ -3283,7 +3283,7 @@ function build$1 ( inputOptions, outputOptions, warnings, silent ) {
|
|
|
3283
3283
|
})
|
|
3284
3284
|
.then( () => {
|
|
3285
3285
|
warnings.flush();
|
|
3286
|
-
if ( !silent ) { stderr(
|
|
3286
|
+
if ( !silent ) { stderr( chalk.green( `created ${chalk.bold( files.join( ', ' ) )} in ${chalk.bold(prettyMs( Date.now() - start))}` ) ); }
|
|
3287
3287
|
})
|
|
3288
3288
|
.catch( handleError );
|
|
3289
3289
|
}
|
|
@@ -3374,7 +3374,7 @@ if (!emitter.infinite) {
|
|
|
3374
3374
|
emitter.infinite = true;
|
|
3375
3375
|
}
|
|
3376
3376
|
|
|
3377
|
-
var
|
|
3377
|
+
var signalExit = function (cb, opts) {
|
|
3378
3378
|
assert.equal(typeof cb, 'function', 'a callback must be provided for exit handler');
|
|
3379
3379
|
|
|
3380
3380
|
if (loaded === false) {
|
|
@@ -3502,11 +3502,60 @@ function processEmit (ev, arg) {
|
|
|
3502
3502
|
}
|
|
3503
3503
|
}
|
|
3504
3504
|
|
|
3505
|
-
|
|
3506
|
-
|
|
3507
|
-
|
|
3505
|
+
signalExit.unload = unload_1;
|
|
3506
|
+
signalExit.signals = signals_1;
|
|
3507
|
+
signalExit.load = load_1;
|
|
3508
3508
|
|
|
3509
|
-
var
|
|
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);
|
|
3533
|
+
|
|
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) {
|
|
3510
3559
|
'use strict';
|
|
3511
3560
|
const x = module.exports;
|
|
3512
3561
|
const ESC = '\u001B[';
|
|
@@ -3633,7 +3682,7 @@ function alternateScreen ( enabled ) {
|
|
|
3633
3682
|
process.stderr.write(HIDE_ALTERNATE_SCREEN);
|
|
3634
3683
|
},
|
|
3635
3684
|
reset( heading ) {
|
|
3636
|
-
stderr( `${
|
|
3685
|
+
stderr( `${ansiEscapes.eraseScreen}${ansiEscapes.cursorTo(0, 0)}${heading}` );
|
|
3637
3686
|
}
|
|
3638
3687
|
};
|
|
3639
3688
|
}
|
|
@@ -3650,7 +3699,7 @@ function watch$1(configFile, configs, command, silent) {
|
|
|
3650
3699
|
let configWatcher;
|
|
3651
3700
|
|
|
3652
3701
|
function start(configs) {
|
|
3653
|
-
screen.reset(
|
|
3702
|
+
screen.reset( chalk.underline( `rollup v${rollup.VERSION}` ) );
|
|
3654
3703
|
|
|
3655
3704
|
configs = configs.map(options => {
|
|
3656
3705
|
const merged = mergeOptions(options, command);
|
|
@@ -3691,26 +3740,28 @@ function watch$1(configFile, configs, command, silent) {
|
|
|
3691
3740
|
break;
|
|
3692
3741
|
|
|
3693
3742
|
case 'START':
|
|
3694
|
-
screen.reset(
|
|
3743
|
+
screen.reset( chalk.underline( `rollup v${rollup.VERSION}` ) );
|
|
3695
3744
|
break;
|
|
3696
3745
|
|
|
3697
3746
|
case 'BUNDLE_START':
|
|
3698
|
-
if ( !silent ) { stderr(
|
|
3747
|
+
if ( !silent ) { stderr( chalk.cyan( `bundles ${chalk.bold( event.input )} → ${chalk.bold( event.output.map( relativeId ).join( ', ' ) )}...` ) ); }
|
|
3699
3748
|
break;
|
|
3700
3749
|
|
|
3701
3750
|
case 'BUNDLE_END':
|
|
3702
3751
|
warnings.flush();
|
|
3703
|
-
if ( !silent ) { stderr(
|
|
3752
|
+
if ( !silent ) { stderr( chalk.green( `created ${chalk.bold( event.output.map( relativeId ).join( ', ' ) )} in ${chalk.bold(prettyMs(event.duration))}` ) ); }
|
|
3704
3753
|
break;
|
|
3705
3754
|
|
|
3706
3755
|
case 'END':
|
|
3707
|
-
if ( !silent && isTTY ) {
|
|
3756
|
+
if ( !silent && isTTY ) {
|
|
3757
|
+
stderr( `\n[${dateTime()}] waiting for changes...` );
|
|
3758
|
+
}
|
|
3708
3759
|
}
|
|
3709
3760
|
});
|
|
3710
3761
|
}
|
|
3711
3762
|
|
|
3712
3763
|
// catch ctrl+c, kill, and uncaught errors
|
|
3713
|
-
const removeOnExit =
|
|
3764
|
+
const removeOnExit = signalExit(close);
|
|
3714
3765
|
process.on('uncaughtException', close);
|
|
3715
3766
|
|
|
3716
3767
|
// only listen to stdin if it is a pipe
|
|
@@ -3808,10 +3859,10 @@ function runRollup ( command ) {
|
|
|
3808
3859
|
if ( configFile.slice( 0, 5 ) === 'node:' ) {
|
|
3809
3860
|
const pkgName = configFile.slice( 5 );
|
|
3810
3861
|
try {
|
|
3811
|
-
configFile =
|
|
3862
|
+
configFile = requireRelative_1.resolve( `rollup-config-${pkgName}`, process.cwd() );
|
|
3812
3863
|
} catch ( err ) {
|
|
3813
3864
|
try {
|
|
3814
|
-
configFile =
|
|
3865
|
+
configFile = requireRelative_1.resolve( pkgName, process.cwd() );
|
|
3815
3866
|
} catch ( err ) {
|
|
3816
3867
|
if ( err.code === 'MODULE_NOT_FOUND' ) {
|
|
3817
3868
|
handleError({
|
|
@@ -3872,7 +3923,7 @@ function execute ( configFile, configs, command ) {
|
|
|
3872
3923
|
}
|
|
3873
3924
|
}
|
|
3874
3925
|
|
|
3875
|
-
const command =
|
|
3926
|
+
const command = minimist( process.argv.slice( 2 ), {
|
|
3876
3927
|
alias: {
|
|
3877
3928
|
// Aliases
|
|
3878
3929
|
strict: 'useStrict',
|