rollup 2.51.2 → 2.52.3
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 +47 -5
- package/LICENSE.md +70 -0
- package/dist/bin/rollup +3 -3
- package/dist/es/rollup.browser.js +3 -3
- package/dist/es/rollup.js +2 -2
- package/dist/es/shared/rollup.js +133 -88
- package/dist/es/shared/watch.js +97 -61
- package/dist/loadConfigFile.js +2 -2
- package/dist/rollup.browser.js +3 -3
- package/dist/rollup.browser.js.map +1 -1
- package/dist/rollup.d.ts +10 -4
- package/dist/rollup.js +2 -2
- package/dist/shared/index.js +78 -49
- package/dist/shared/loadConfigFile.js +16 -10
- package/dist/shared/mergeOptions.js +20 -13
- package/dist/shared/rollup.js +3737 -3690
- package/dist/shared/watch-cli.js +2 -2
- package/dist/shared/watch.js +2 -2
- package/package.json +23 -23
package/dist/rollup.d.ts
CHANGED
|
@@ -277,7 +277,8 @@ export type RenderChunkHook = (
|
|
|
277
277
|
| Promise<{ code: string; map?: SourceMapInput } | null>
|
|
278
278
|
| { code: string; map?: SourceMapInput }
|
|
279
279
|
| string
|
|
280
|
-
| null
|
|
280
|
+
| null
|
|
281
|
+
| undefined;
|
|
281
282
|
|
|
282
283
|
export type ResolveDynamicImportHook = (
|
|
283
284
|
this: PluginContext,
|
|
@@ -474,9 +475,13 @@ export interface OutputPlugin extends Partial<OutputPluginHooks>, Partial<Output
|
|
|
474
475
|
name: string;
|
|
475
476
|
}
|
|
476
477
|
|
|
478
|
+
type TreeshakingPreset = 'smallest' | 'safest' | 'recommended';
|
|
479
|
+
|
|
477
480
|
export interface TreeshakingOptions {
|
|
478
481
|
annotations?: boolean;
|
|
482
|
+
correctVarValueBeforeDeclaration?: boolean;
|
|
479
483
|
moduleSideEffects?: ModuleSideEffectsOption;
|
|
484
|
+
preset?: TreeshakingPreset;
|
|
480
485
|
propertyReadSideEffects?: boolean | 'always';
|
|
481
486
|
/** @deprecated Use `moduleSideEffects` instead */
|
|
482
487
|
pureExternalModules?: PureModulesOption;
|
|
@@ -486,6 +491,7 @@ export interface TreeshakingOptions {
|
|
|
486
491
|
|
|
487
492
|
export interface NormalizedTreeshakingOptions {
|
|
488
493
|
annotations: boolean;
|
|
494
|
+
correctVarValueBeforeDeclaration: boolean;
|
|
489
495
|
moduleSideEffects: HasModuleSideEffects;
|
|
490
496
|
propertyReadSideEffects: boolean | 'always';
|
|
491
497
|
tryCatchDeoptimization: boolean;
|
|
@@ -534,14 +540,14 @@ export interface InputOptions {
|
|
|
534
540
|
moduleContext?: ((id: string) => string | null | undefined) | { [id: string]: string };
|
|
535
541
|
onwarn?: WarningHandlerWithDefault;
|
|
536
542
|
perf?: boolean;
|
|
537
|
-
plugins?: Plugin[];
|
|
543
|
+
plugins?: (Plugin | null | false | undefined)[];
|
|
538
544
|
preserveEntrySignatures?: PreserveEntrySignaturesOption;
|
|
539
545
|
/** @deprecated Use the "preserveModules" output option instead. */
|
|
540
546
|
preserveModules?: boolean;
|
|
541
547
|
preserveSymlinks?: boolean;
|
|
542
548
|
shimMissingExports?: boolean;
|
|
543
549
|
strictDeprecations?: boolean;
|
|
544
|
-
treeshake?: boolean | TreeshakingOptions;
|
|
550
|
+
treeshake?: boolean | TreeshakingPreset | TreeshakingOptions;
|
|
545
551
|
watch?: WatcherOptions | false;
|
|
546
552
|
}
|
|
547
553
|
|
|
@@ -645,7 +651,7 @@ export interface OutputOptions {
|
|
|
645
651
|
noConflict?: boolean;
|
|
646
652
|
outro?: string | (() => string | Promise<string>);
|
|
647
653
|
paths?: OptionsPaths;
|
|
648
|
-
plugins?: OutputPlugin[];
|
|
654
|
+
plugins?: (OutputPlugin | null | false | undefined)[];
|
|
649
655
|
preferConst?: boolean;
|
|
650
656
|
preserveModules?: boolean;
|
|
651
657
|
preserveModulesRoot?: string;
|
package/dist/rollup.js
CHANGED
package/dist/shared/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
@license
|
|
3
|
-
Rollup.js v2.
|
|
4
|
-
Fri,
|
|
3
|
+
Rollup.js v2.52.3
|
|
4
|
+
Fri, 25 Jun 2021 13:12:43 GMT - commit 9c436a7c7c368f2ff840735a30119899513ff4bd
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
https://github.com/rollup/rollup
|
|
@@ -1731,7 +1731,8 @@ const depth = token => {
|
|
|
1731
1731
|
/**
|
|
1732
1732
|
* Quickly scans a glob pattern and returns an object with a handful of
|
|
1733
1733
|
* useful properties, like `isGlob`, `path` (the leading non-glob, if it exists),
|
|
1734
|
-
* `glob` (the actual pattern),
|
|
1734
|
+
* `glob` (the actual pattern), `negated` (true if the path starts with `!` but not
|
|
1735
|
+
* with `!(`) and `negatedExtglob` (true if the path starts with `!(`).
|
|
1735
1736
|
*
|
|
1736
1737
|
* ```js
|
|
1737
1738
|
* const pm = require('picomatch');
|
|
@@ -1765,6 +1766,7 @@ const scan$1 = (input, options) => {
|
|
|
1765
1766
|
let braceEscaped = false;
|
|
1766
1767
|
let backslashes = false;
|
|
1767
1768
|
let negated = false;
|
|
1769
|
+
let negatedExtglob = false;
|
|
1768
1770
|
let finished = false;
|
|
1769
1771
|
let braces = 0;
|
|
1770
1772
|
let prev;
|
|
@@ -1876,6 +1878,9 @@ const scan$1 = (input, options) => {
|
|
|
1876
1878
|
isGlob = token.isGlob = true;
|
|
1877
1879
|
isExtglob = token.isExtglob = true;
|
|
1878
1880
|
finished = true;
|
|
1881
|
+
if (code === CHAR_EXCLAMATION_MARK && index === start) {
|
|
1882
|
+
negatedExtglob = true;
|
|
1883
|
+
}
|
|
1879
1884
|
|
|
1880
1885
|
if (scanToEnd === true) {
|
|
1881
1886
|
while (eos() !== true && (code = advance())) {
|
|
@@ -2029,7 +2034,8 @@ const scan$1 = (input, options) => {
|
|
|
2029
2034
|
isGlob,
|
|
2030
2035
|
isExtglob,
|
|
2031
2036
|
isGlobstar,
|
|
2032
|
-
negated
|
|
2037
|
+
negated,
|
|
2038
|
+
negatedExtglob
|
|
2033
2039
|
};
|
|
2034
2040
|
|
|
2035
2041
|
if (opts.tokens === true) {
|
|
@@ -2168,7 +2174,7 @@ const parse$1 = (input, options) => {
|
|
|
2168
2174
|
START_ANCHOR
|
|
2169
2175
|
} = PLATFORM_CHARS;
|
|
2170
2176
|
|
|
2171
|
-
const globstar =
|
|
2177
|
+
const globstar = opts => {
|
|
2172
2178
|
return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
|
|
2173
2179
|
};
|
|
2174
2180
|
|
|
@@ -2218,12 +2224,13 @@ const parse$1 = (input, options) => {
|
|
|
2218
2224
|
|
|
2219
2225
|
const eos = () => state.index === len - 1;
|
|
2220
2226
|
const peek = state.peek = (n = 1) => input[state.index + n];
|
|
2221
|
-
const advance = state.advance = () => input[++state.index];
|
|
2227
|
+
const advance = state.advance = () => input[++state.index] || '';
|
|
2222
2228
|
const remaining = () => input.slice(state.index + 1);
|
|
2223
2229
|
const consume = (value = '', num = 0) => {
|
|
2224
2230
|
state.consumed += value;
|
|
2225
2231
|
state.index += num;
|
|
2226
2232
|
};
|
|
2233
|
+
|
|
2227
2234
|
const append = token => {
|
|
2228
2235
|
state.output += token.output != null ? token.output : token.value;
|
|
2229
2236
|
consume(token.value);
|
|
@@ -2279,7 +2286,7 @@ const parse$1 = (input, options) => {
|
|
|
2279
2286
|
}
|
|
2280
2287
|
}
|
|
2281
2288
|
|
|
2282
|
-
if (extglobs.length && tok.type !== 'paren'
|
|
2289
|
+
if (extglobs.length && tok.type !== 'paren') {
|
|
2283
2290
|
extglobs[extglobs.length - 1].inner += tok.value;
|
|
2284
2291
|
}
|
|
2285
2292
|
|
|
@@ -2311,6 +2318,7 @@ const parse$1 = (input, options) => {
|
|
|
2311
2318
|
|
|
2312
2319
|
const extglobClose = token => {
|
|
2313
2320
|
let output = token.close + (opts.capture ? ')' : '');
|
|
2321
|
+
let rest;
|
|
2314
2322
|
|
|
2315
2323
|
if (token.type === 'negate') {
|
|
2316
2324
|
let extglobStar = star;
|
|
@@ -2323,6 +2331,10 @@ const parse$1 = (input, options) => {
|
|
|
2323
2331
|
output = token.close = `)$))${extglobStar}`;
|
|
2324
2332
|
}
|
|
2325
2333
|
|
|
2334
|
+
if (token.inner.includes('*') && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) {
|
|
2335
|
+
output = token.close = `)${rest})${extglobStar})`;
|
|
2336
|
+
}
|
|
2337
|
+
|
|
2326
2338
|
if (token.prev.type === 'bos') {
|
|
2327
2339
|
state.negatedExtglob = true;
|
|
2328
2340
|
}
|
|
@@ -2432,9 +2444,9 @@ const parse$1 = (input, options) => {
|
|
|
2432
2444
|
}
|
|
2433
2445
|
|
|
2434
2446
|
if (opts.unescape === true) {
|
|
2435
|
-
value = advance()
|
|
2447
|
+
value = advance();
|
|
2436
2448
|
} else {
|
|
2437
|
-
value += advance()
|
|
2449
|
+
value += advance();
|
|
2438
2450
|
}
|
|
2439
2451
|
|
|
2440
2452
|
if (state.brackets === 0) {
|
|
@@ -3098,7 +3110,7 @@ parse$1.fastpaths = (input, options) => {
|
|
|
3098
3110
|
star = `(${star})`;
|
|
3099
3111
|
}
|
|
3100
3112
|
|
|
3101
|
-
const globstar =
|
|
3113
|
+
const globstar = opts => {
|
|
3102
3114
|
if (opts.noglobstar === true) return star;
|
|
3103
3115
|
return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
|
|
3104
3116
|
};
|
|
@@ -3384,68 +3396,71 @@ picomatch$3.parse = (pattern, options) => {
|
|
|
3384
3396
|
picomatch$3.scan = (input, options) => scan(input, options);
|
|
3385
3397
|
|
|
3386
3398
|
/**
|
|
3387
|
-
*
|
|
3399
|
+
* Compile a regular expression from the `state` object returned by the
|
|
3400
|
+
* [parse()](#parse) method.
|
|
3388
3401
|
*
|
|
3389
|
-
*
|
|
3390
|
-
* const picomatch = require('picomatch');
|
|
3391
|
-
* const state = picomatch.parse('*.js');
|
|
3392
|
-
* // picomatch.compileRe(state[, options]);
|
|
3393
|
-
*
|
|
3394
|
-
* console.log(picomatch.compileRe(state));
|
|
3395
|
-
* //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/
|
|
3396
|
-
* ```
|
|
3397
|
-
* @param {String} `state` The object returned from the `.parse` method.
|
|
3402
|
+
* @param {Object} `state`
|
|
3398
3403
|
* @param {Object} `options`
|
|
3399
|
-
* @
|
|
3404
|
+
* @param {Boolean} `returnOutput` Intended for implementors, this argument allows you to return the raw output from the parser.
|
|
3405
|
+
* @param {Boolean} `returnState` Adds the state to a `state` property on the returned regex. Useful for implementors and debugging.
|
|
3406
|
+
* @return {RegExp}
|
|
3400
3407
|
* @api public
|
|
3401
3408
|
*/
|
|
3402
3409
|
|
|
3403
|
-
picomatch$3.compileRe = (
|
|
3410
|
+
picomatch$3.compileRe = (state, options, returnOutput = false, returnState = false) => {
|
|
3404
3411
|
if (returnOutput === true) {
|
|
3405
|
-
return
|
|
3412
|
+
return state.output;
|
|
3406
3413
|
}
|
|
3407
3414
|
|
|
3408
3415
|
const opts = options || {};
|
|
3409
3416
|
const prepend = opts.contains ? '' : '^';
|
|
3410
3417
|
const append = opts.contains ? '' : '$';
|
|
3411
3418
|
|
|
3412
|
-
let source = `${prepend}(?:${
|
|
3413
|
-
if (
|
|
3419
|
+
let source = `${prepend}(?:${state.output})${append}`;
|
|
3420
|
+
if (state && state.negated === true) {
|
|
3414
3421
|
source = `^(?!${source}).*$`;
|
|
3415
3422
|
}
|
|
3416
3423
|
|
|
3417
3424
|
const regex = picomatch$3.toRegex(source, options);
|
|
3418
3425
|
if (returnState === true) {
|
|
3419
|
-
regex.state =
|
|
3426
|
+
regex.state = state;
|
|
3420
3427
|
}
|
|
3421
3428
|
|
|
3422
3429
|
return regex;
|
|
3423
3430
|
};
|
|
3424
3431
|
|
|
3425
|
-
|
|
3432
|
+
/**
|
|
3433
|
+
* Create a regular expression from a parsed glob pattern.
|
|
3434
|
+
*
|
|
3435
|
+
* ```js
|
|
3436
|
+
* const picomatch = require('picomatch');
|
|
3437
|
+
* const state = picomatch.parse('*.js');
|
|
3438
|
+
* // picomatch.compileRe(state[, options]);
|
|
3439
|
+
*
|
|
3440
|
+
* console.log(picomatch.compileRe(state));
|
|
3441
|
+
* //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/
|
|
3442
|
+
* ```
|
|
3443
|
+
* @param {String} `state` The object returned from the `.parse` method.
|
|
3444
|
+
* @param {Object} `options`
|
|
3445
|
+
* @param {Boolean} `returnOutput` Implementors may use this argument to return the compiled output, instead of a regular expression. This is not exposed on the options to prevent end-users from mutating the result.
|
|
3446
|
+
* @param {Boolean} `returnState` Implementors may use this argument to return the state from the parsed glob with the returned regular expression.
|
|
3447
|
+
* @return {RegExp} Returns a regex created from the given pattern.
|
|
3448
|
+
* @api public
|
|
3449
|
+
*/
|
|
3450
|
+
|
|
3451
|
+
picomatch$3.makeRe = (input, options = {}, returnOutput = false, returnState = false) => {
|
|
3426
3452
|
if (!input || typeof input !== 'string') {
|
|
3427
3453
|
throw new TypeError('Expected a non-empty string');
|
|
3428
3454
|
}
|
|
3429
3455
|
|
|
3430
|
-
const opts = options || {};
|
|
3431
3456
|
let parsed = { negated: false, fastpaths: true };
|
|
3432
|
-
let prefix = '';
|
|
3433
|
-
let output;
|
|
3434
|
-
|
|
3435
|
-
if (input.startsWith('./')) {
|
|
3436
|
-
input = input.slice(2);
|
|
3437
|
-
prefix = parsed.prefix = './';
|
|
3438
|
-
}
|
|
3439
3457
|
|
|
3440
|
-
if (
|
|
3441
|
-
output = parse.fastpaths(input, options);
|
|
3458
|
+
if (options.fastpaths !== false && (input[0] === '.' || input[0] === '*')) {
|
|
3459
|
+
parsed.output = parse.fastpaths(input, options);
|
|
3442
3460
|
}
|
|
3443
3461
|
|
|
3444
|
-
if (output
|
|
3462
|
+
if (!parsed.output) {
|
|
3445
3463
|
parsed = parse(input, options);
|
|
3446
|
-
parsed.prefix = prefix + (parsed.prefix || '');
|
|
3447
|
-
} else {
|
|
3448
|
-
parsed.output = output;
|
|
3449
3464
|
}
|
|
3450
3465
|
|
|
3451
3466
|
return picomatch$3.compileRe(parsed, options, returnOutput, returnState);
|
|
@@ -3516,7 +3531,8 @@ const realpath$1 = promisify$3(fs$3.realpath);
|
|
|
3516
3531
|
*/
|
|
3517
3532
|
|
|
3518
3533
|
const BANG$2 = '!';
|
|
3519
|
-
const
|
|
3534
|
+
const RECURSIVE_ERROR_CODE = 'READDIRP_RECURSIVE_ERROR';
|
|
3535
|
+
const NORMAL_FLOW_ERRORS = new Set(['ENOENT', 'EPERM', 'EACCES', 'ELOOP', RECURSIVE_ERROR_CODE]);
|
|
3520
3536
|
const FILE_TYPE = 'files';
|
|
3521
3537
|
const DIR_TYPE = 'directories';
|
|
3522
3538
|
const FILE_DIR_TYPE = 'files_directories';
|
|
@@ -3524,6 +3540,8 @@ const EVERYTHING_TYPE = 'all';
|
|
|
3524
3540
|
const ALL_TYPES = [FILE_TYPE, DIR_TYPE, FILE_DIR_TYPE, EVERYTHING_TYPE];
|
|
3525
3541
|
|
|
3526
3542
|
const isNormalFlowError = error => NORMAL_FLOW_ERRORS.has(error.code);
|
|
3543
|
+
const [maj, min] = process.versions.node.split('.').slice(0, 2).map(n => Number.parseInt(n, 10));
|
|
3544
|
+
const wantBigintFsStats = process.platform === 'win32' && (maj > 10 || (maj === 10 && min >= 5));
|
|
3527
3545
|
|
|
3528
3546
|
const normalizeFilter = filter => {
|
|
3529
3547
|
if (filter === undefined) return;
|
|
@@ -3586,7 +3604,7 @@ class ReaddirpStream extends Readable {
|
|
|
3586
3604
|
|
|
3587
3605
|
const statMethod = opts.lstat ? lstat$2 : stat$3;
|
|
3588
3606
|
// Use bigint stats if it's windows and stat() supports options (node 10+).
|
|
3589
|
-
if (
|
|
3607
|
+
if (wantBigintFsStats) {
|
|
3590
3608
|
this._stat = path => statMethod(path, { bigint: true });
|
|
3591
3609
|
} else {
|
|
3592
3610
|
this._stat = statMethod;
|
|
@@ -3661,7 +3679,7 @@ class ReaddirpStream extends Readable {
|
|
|
3661
3679
|
} catch (error) {
|
|
3662
3680
|
this._onError(error);
|
|
3663
3681
|
}
|
|
3664
|
-
return {files, depth, path};
|
|
3682
|
+
return { files, depth, path };
|
|
3665
3683
|
}
|
|
3666
3684
|
|
|
3667
3685
|
async _formatEntry(dirent, path) {
|
|
@@ -3669,7 +3687,7 @@ class ReaddirpStream extends Readable {
|
|
|
3669
3687
|
try {
|
|
3670
3688
|
const basename = this._isDirent ? dirent.name : dirent;
|
|
3671
3689
|
const fullPath = sysPath$3.resolve(sysPath$3.join(path, basename));
|
|
3672
|
-
entry = {path: sysPath$3.relative(this._root, fullPath), fullPath, basename};
|
|
3690
|
+
entry = { path: sysPath$3.relative(this._root, fullPath), fullPath, basename };
|
|
3673
3691
|
entry[this._statsProp] = this._isDirent ? dirent : await this._stat(fullPath);
|
|
3674
3692
|
} catch (err) {
|
|
3675
3693
|
this._onError(err);
|
|
@@ -3709,9 +3727,11 @@ class ReaddirpStream extends Readable {
|
|
|
3709
3727
|
if (entryRealPathStats.isDirectory()) {
|
|
3710
3728
|
const len = entryRealPath.length;
|
|
3711
3729
|
if (full.startsWith(entryRealPath) && full.substr(len, 1) === sysPath$3.sep) {
|
|
3712
|
-
|
|
3730
|
+
const recursiveError = new Error(
|
|
3713
3731
|
`Circular symlink detected: "${full}" points to "${entryRealPath}"`
|
|
3714
|
-
)
|
|
3732
|
+
);
|
|
3733
|
+
recursiveError.code = RECURSIVE_ERROR_CODE;
|
|
3734
|
+
return this._onError(recursiveError);
|
|
3715
3735
|
}
|
|
3716
3736
|
return 'directory';
|
|
3717
3737
|
}
|
|
@@ -4304,6 +4324,7 @@ var constants = {};
|
|
|
4304
4324
|
|
|
4305
4325
|
const {sep} = path$3;
|
|
4306
4326
|
const {platform} = process;
|
|
4327
|
+
const os = require$$2;
|
|
4307
4328
|
|
|
4308
4329
|
exports.EV_ALL = 'all';
|
|
4309
4330
|
exports.EV_READY = 'ready';
|
|
@@ -4363,6 +4384,7 @@ exports.IDENTITY_FN = val => val;
|
|
|
4363
4384
|
exports.isWindows = platform === 'win32';
|
|
4364
4385
|
exports.isMacos = platform === 'darwin';
|
|
4365
4386
|
exports.isLinux = platform === 'linux';
|
|
4387
|
+
exports.isIBMi = os.type() === 'OS400';
|
|
4366
4388
|
}(constants));
|
|
4367
4389
|
|
|
4368
4390
|
const fs$2 = fs$4;
|
|
@@ -5108,7 +5130,8 @@ const createFSEventsInstance = (path, callback) => {
|
|
|
5108
5130
|
* @returns {Function} closer
|
|
5109
5131
|
*/
|
|
5110
5132
|
function setFSEventsListener(path, realPath, listener, rawEmitter) {
|
|
5111
|
-
let watchPath = sysPath$1.extname(
|
|
5133
|
+
let watchPath = sysPath$1.extname(realPath) ? sysPath$1.dirname(realPath) : realPath;
|
|
5134
|
+
|
|
5112
5135
|
const parentPath = sysPath$1.dirname(watchPath);
|
|
5113
5136
|
let cont = FSEventsWatchers.get(watchPath);
|
|
5114
5137
|
|
|
@@ -5574,7 +5597,8 @@ const {
|
|
|
5574
5597
|
EMPTY_FN,
|
|
5575
5598
|
|
|
5576
5599
|
isWindows,
|
|
5577
|
-
isMacos
|
|
5600
|
+
isMacos,
|
|
5601
|
+
isIBMi
|
|
5578
5602
|
} = constants;
|
|
5579
5603
|
|
|
5580
5604
|
const stat = promisify(fs.stat);
|
|
@@ -5856,6 +5880,11 @@ constructor(_opts) {
|
|
|
5856
5880
|
opts.usePolling = isMacos;
|
|
5857
5881
|
}
|
|
5858
5882
|
|
|
5883
|
+
// Always default to polling on IBM i because fs.watch() is not available on IBM i.
|
|
5884
|
+
if(isIBMi) {
|
|
5885
|
+
opts.usePolling = true;
|
|
5886
|
+
}
|
|
5887
|
+
|
|
5859
5888
|
// Global override (useful for end-developers that need to force polling for all
|
|
5860
5889
|
// instances of chokidar, regardless of usage/dependency depth)
|
|
5861
5890
|
const envPoll = process.env.CHOKIDAR_USEPOLLING;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
@license
|
|
3
|
-
Rollup.js v2.
|
|
4
|
-
Fri,
|
|
3
|
+
Rollup.js v2.52.3
|
|
4
|
+
Fri, 25 Jun 2021 13:12:43 GMT - commit 9c436a7c7c368f2ff840735a30119899513ff4bd
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
https://github.com/rollup/rollup
|
|
@@ -379,7 +379,9 @@ function addCommandPluginsToInputOptions(inputOptions, command) {
|
|
|
379
379
|
if (command.waitForBundleInput === true) {
|
|
380
380
|
inputOptions.plugins.push(waitForInputPlugin());
|
|
381
381
|
}
|
|
382
|
-
|
|
382
|
+
addPluginsFromCommandOption(command.plugin, inputOptions);
|
|
383
|
+
}
|
|
384
|
+
function addPluginsFromCommandOption(commandPlugin, inputOptions) {
|
|
383
385
|
if (commandPlugin) {
|
|
384
386
|
const plugins = Array.isArray(commandPlugin) ? commandPlugin : [commandPlugin];
|
|
385
387
|
for (const plugin of plugins) {
|
|
@@ -480,25 +482,29 @@ async function loadAndParseConfigFile(fileName, commandOptions = {}) {
|
|
|
480
482
|
}
|
|
481
483
|
async function loadConfigFile(fileName, commandOptions) {
|
|
482
484
|
const extension = path__namespace.extname(fileName);
|
|
483
|
-
const configFileExport =
|
|
484
|
-
|
|
485
|
+
const configFileExport = commandOptions.configPlugin ||
|
|
486
|
+
!(extension === '.cjs' || (extension === '.mjs' && supportsNativeESM()))
|
|
487
|
+
? await getDefaultFromTranspiledConfigFile(fileName, commandOptions)
|
|
485
488
|
: extension === '.cjs'
|
|
486
489
|
? getDefaultFromCjs(require(fileName))
|
|
487
|
-
: await
|
|
490
|
+
: (await import(url.pathToFileURL(fileName).href)).default;
|
|
488
491
|
return getConfigList(configFileExport, commandOptions);
|
|
489
492
|
}
|
|
490
493
|
function getDefaultFromCjs(namespace) {
|
|
491
494
|
return namespace.__esModule ? namespace.default : namespace;
|
|
492
495
|
}
|
|
493
|
-
async function getDefaultFromTranspiledConfigFile(fileName,
|
|
496
|
+
async function getDefaultFromTranspiledConfigFile(fileName, commandOptions) {
|
|
494
497
|
const warnings = batchWarnings();
|
|
495
|
-
const
|
|
498
|
+
const inputOptions = {
|
|
496
499
|
external: (id) => (id[0] !== '.' && !path__namespace.isAbsolute(id)) || id.slice(-5, id.length) === '.json',
|
|
497
500
|
input: fileName,
|
|
498
501
|
onwarn: warnings.add,
|
|
502
|
+
plugins: [],
|
|
499
503
|
treeshake: false
|
|
500
|
-
}
|
|
501
|
-
|
|
504
|
+
};
|
|
505
|
+
addPluginsFromCommandOption(commandOptions.configPlugin, inputOptions);
|
|
506
|
+
const bundle = await rollup.rollup(inputOptions);
|
|
507
|
+
if (!commandOptions.silent && warnings.count > 0) {
|
|
502
508
|
stderr(bold(`loaded ${rollup.relativeId(fileName)} with warnings`));
|
|
503
509
|
warnings.flush();
|
|
504
510
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
@license
|
|
3
|
-
Rollup.js v2.
|
|
4
|
-
Fri,
|
|
3
|
+
Rollup.js v2.52.3
|
|
4
|
+
Fri, 25 Jun 2021 13:12:43 GMT - commit 9c436a7c7c368f2ff840735a30119899513ff4bd
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
https://github.com/rollup/rollup
|
|
@@ -38,7 +38,7 @@ function mergeOptions(config, rawCommandOptions = { external: [], globals: undef
|
|
|
38
38
|
if (outputOptionsArray.length === 0)
|
|
39
39
|
outputOptionsArray.push({});
|
|
40
40
|
const outputOptions = outputOptionsArray.map(singleOutputOptions => mergeOutputOptions(singleOutputOptions, command, warn));
|
|
41
|
-
rollup.warnUnknownOptions(command, Object.keys(inputOptions).concat(Object.keys(outputOptions[0]).filter(option => option !== 'sourcemapPathTransform'), Object.keys(commandAliases), 'config', 'environment', 'plugin', 'silent', 'failAfterWarnings', 'stdin', 'waitForBundleInput'), 'CLI flags', warn, /^_$|output$|config/);
|
|
41
|
+
rollup.warnUnknownOptions(command, Object.keys(inputOptions).concat(Object.keys(outputOptions[0]).filter(option => option !== 'sourcemapPathTransform'), Object.keys(commandAliases), 'config', 'environment', 'plugin', 'silent', 'failAfterWarnings', 'stdin', 'waitForBundleInput', 'configPlugin'), 'CLI flags', warn, /^_$|output$|config/);
|
|
42
42
|
inputOptions.output = outputOptions;
|
|
43
43
|
return inputOptions;
|
|
44
44
|
}
|
|
@@ -83,7 +83,7 @@ function mergeInputOptions(config, overrides, defaultOnWarnHandler) {
|
|
|
83
83
|
preserveSymlinks: getOption('preserveSymlinks'),
|
|
84
84
|
shimMissingExports: getOption('shimMissingExports'),
|
|
85
85
|
strictDeprecations: getOption('strictDeprecations'),
|
|
86
|
-
treeshake: getObjectOption(config, overrides, 'treeshake'),
|
|
86
|
+
treeshake: getObjectOption(config, overrides, 'treeshake', objectifyTreeshakeOption),
|
|
87
87
|
watch: getWatch(config, overrides, 'watch')
|
|
88
88
|
};
|
|
89
89
|
rollup.warnUnknownOptions(config, Object.keys(inputOptions), 'input options', inputOptions.onwarn, /^output$/);
|
|
@@ -98,26 +98,33 @@ const getExternal = (config, overrides) => {
|
|
|
98
98
|
const getOnWarn = (config, defaultOnWarnHandler) => config.onwarn
|
|
99
99
|
? warning => config.onwarn(warning, defaultOnWarnHandler)
|
|
100
100
|
: defaultOnWarnHandler;
|
|
101
|
-
const getObjectOption = (config, overrides, name) => {
|
|
102
|
-
const commandOption = normalizeObjectOptionValue(overrides[name]);
|
|
103
|
-
const configOption = normalizeObjectOptionValue(config[name]);
|
|
101
|
+
const getObjectOption = (config, overrides, name, objectifyValue = value => (typeof value === 'object' ? value : {})) => {
|
|
102
|
+
const commandOption = normalizeObjectOptionValue(overrides[name], objectifyValue);
|
|
103
|
+
const configOption = normalizeObjectOptionValue(config[name], objectifyValue);
|
|
104
104
|
if (commandOption !== undefined) {
|
|
105
105
|
return commandOption && { ...configOption, ...commandOption };
|
|
106
106
|
}
|
|
107
107
|
return configOption;
|
|
108
108
|
};
|
|
109
|
+
const objectifyTreeshakeOption = (value) => {
|
|
110
|
+
if (typeof value === 'string') {
|
|
111
|
+
const preset = rollup.treeshakePresets[value];
|
|
112
|
+
if (preset) {
|
|
113
|
+
return preset;
|
|
114
|
+
}
|
|
115
|
+
rollup.error(rollup.errInvalidOption('treeshake', `valid values are false, true, ${rollup.printQuotedStringList(Object.keys(rollup.treeshakePresets))}. You can also supply an object for more fine-grained control`));
|
|
116
|
+
}
|
|
117
|
+
return typeof value === 'object' ? value : {};
|
|
118
|
+
};
|
|
109
119
|
const getWatch = (config, overrides, name) => config.watch !== false && getObjectOption(config, overrides, name);
|
|
110
|
-
const normalizeObjectOptionValue = (optionValue) => {
|
|
120
|
+
const normalizeObjectOptionValue = (optionValue, objectifyValue) => {
|
|
111
121
|
if (!optionValue) {
|
|
112
122
|
return optionValue;
|
|
113
123
|
}
|
|
114
124
|
if (Array.isArray(optionValue)) {
|
|
115
|
-
return optionValue.reduce((result, value) => value && result && { ...result, ...value }, {});
|
|
116
|
-
}
|
|
117
|
-
if (typeof optionValue !== 'object') {
|
|
118
|
-
return {};
|
|
125
|
+
return optionValue.reduce((result, value) => value && result && { ...result, ...objectifyValue(value) }, {});
|
|
119
126
|
}
|
|
120
|
-
return optionValue;
|
|
127
|
+
return objectifyValue(optionValue);
|
|
121
128
|
};
|
|
122
129
|
function mergeOutputOptions(config, overrides, warn) {
|
|
123
130
|
const getOption = (name) => { var _a; return (_a = overrides[name]) !== null && _a !== void 0 ? _a : config[name]; };
|