rollup 2.61.1 → 2.65.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 +96 -0
- package/LICENSE.md +0 -7
- package/dist/bin/rollup +14 -68
- package/dist/es/rollup.browser.js +3 -3
- package/dist/es/rollup.js +4 -2
- package/dist/es/shared/rollup.js +453 -294
- package/dist/es/shared/watch.js +31 -19
- package/dist/loadConfigFile.js +3 -2
- package/dist/rollup.browser.js +3 -3
- package/dist/rollup.browser.js.map +1 -1
- package/dist/rollup.d.ts +21 -3
- package/dist/rollup.js +4 -2
- package/dist/shared/index.js +24 -14
- package/dist/shared/loadConfigFile.js +10 -11
- package/dist/shared/mergeOptions.js +12 -5
- package/dist/shared/rollup.js +502 -340
- package/dist/shared/watch-cli.js +21 -30
- package/dist/shared/watch.js +8 -18
- package/package.json +18 -20
package/dist/rollup.d.ts
CHANGED
|
@@ -101,7 +101,7 @@ export interface SourceDescription extends Partial<PartialNull<ModuleOptions>> {
|
|
|
101
101
|
map?: SourceMapInput;
|
|
102
102
|
}
|
|
103
103
|
|
|
104
|
-
export interface TransformModuleJSON
|
|
104
|
+
export interface TransformModuleJSON {
|
|
105
105
|
ast?: AcornNode;
|
|
106
106
|
code: string;
|
|
107
107
|
// note if plugins use new this.cache to opt-out auto transform cache
|
|
@@ -113,7 +113,7 @@ export interface TransformModuleJSON extends Partial<PartialNull<ModuleOptions>>
|
|
|
113
113
|
transformDependencies: string[];
|
|
114
114
|
}
|
|
115
115
|
|
|
116
|
-
export interface ModuleJSON extends TransformModuleJSON {
|
|
116
|
+
export interface ModuleJSON extends TransformModuleJSON, ModuleOptions {
|
|
117
117
|
ast: AcornNode;
|
|
118
118
|
dependencies: string[];
|
|
119
119
|
id: string;
|
|
@@ -160,15 +160,18 @@ interface ModuleInfo {
|
|
|
160
160
|
ast: AcornNode | null;
|
|
161
161
|
code: string | null;
|
|
162
162
|
dynamicImporters: readonly string[];
|
|
163
|
+
dynamicallyImportedIdResolutions: readonly ResolvedId[];
|
|
163
164
|
dynamicallyImportedIds: readonly string[];
|
|
164
165
|
hasModuleSideEffects: boolean | 'no-treeshake';
|
|
165
166
|
id: string;
|
|
166
167
|
implicitlyLoadedAfterOneOf: readonly string[];
|
|
167
168
|
implicitlyLoadedBefore: readonly string[];
|
|
169
|
+
importedIdResolutions: readonly ResolvedId[];
|
|
168
170
|
importedIds: readonly string[];
|
|
169
171
|
importers: readonly string[];
|
|
170
172
|
isEntry: boolean;
|
|
171
173
|
isExternal: boolean;
|
|
174
|
+
isIncluded: boolean | null;
|
|
172
175
|
meta: CustomPluginOptions;
|
|
173
176
|
syntheticNamedExports: boolean | string;
|
|
174
177
|
}
|
|
@@ -241,6 +244,18 @@ export type ResolveIdHook = (
|
|
|
241
244
|
options: { custom?: CustomPluginOptions; isEntry: boolean }
|
|
242
245
|
) => Promise<ResolveIdResult> | ResolveIdResult;
|
|
243
246
|
|
|
247
|
+
export type ShouldTransformCachedModuleHook = (
|
|
248
|
+
this: PluginContext,
|
|
249
|
+
options: {
|
|
250
|
+
ast: AcornNode;
|
|
251
|
+
code: string;
|
|
252
|
+
id: string;
|
|
253
|
+
meta: CustomPluginOptions;
|
|
254
|
+
moduleSideEffects: boolean | 'no-treeshake';
|
|
255
|
+
syntheticNamedExports: boolean | string;
|
|
256
|
+
}
|
|
257
|
+
) => Promise<boolean> | boolean;
|
|
258
|
+
|
|
244
259
|
export type IsExternal = (
|
|
245
260
|
source: string,
|
|
246
261
|
importer: string | undefined,
|
|
@@ -366,6 +381,7 @@ export interface PluginHooks extends OutputPluginHooks {
|
|
|
366
381
|
) => Promise<InputOptions | null | undefined> | InputOptions | null | undefined;
|
|
367
382
|
resolveDynamicImport: ResolveDynamicImportHook;
|
|
368
383
|
resolveId: ResolveIdHook;
|
|
384
|
+
shouldTransformCachedModule: ShouldTransformCachedModuleHook;
|
|
369
385
|
transform: TransformHook;
|
|
370
386
|
watchChange: WatchChangeHook;
|
|
371
387
|
}
|
|
@@ -418,6 +434,7 @@ export type AsyncPluginHooks =
|
|
|
418
434
|
| 'renderStart'
|
|
419
435
|
| 'resolveDynamicImport'
|
|
420
436
|
| 'resolveId'
|
|
437
|
+
| 'shouldTransformCachedModule'
|
|
421
438
|
| 'transform'
|
|
422
439
|
| 'writeBundle'
|
|
423
440
|
| 'closeBundle';
|
|
@@ -433,7 +450,8 @@ export type FirstPluginHooks =
|
|
|
433
450
|
| 'resolveDynamicImport'
|
|
434
451
|
| 'resolveFileUrl'
|
|
435
452
|
| 'resolveId'
|
|
436
|
-
| 'resolveImportMeta'
|
|
453
|
+
| 'resolveImportMeta'
|
|
454
|
+
| 'shouldTransformCachedModule';
|
|
437
455
|
|
|
438
456
|
export type SequentialPluginHooks =
|
|
439
457
|
| 'augmentChunkHash'
|
package/dist/rollup.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
@license
|
|
3
|
-
Rollup.js v2.
|
|
4
|
-
|
|
3
|
+
Rollup.js v2.65.0
|
|
4
|
+
Fri, 21 Jan 2022 07:42:35 GMT - commit bebc50ddb613d240a03988d51787fd71b1a3914f
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
https://github.com/rollup/rollup
|
|
@@ -14,6 +14,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
14
14
|
|
|
15
15
|
const rollup = require('./shared/rollup.js');
|
|
16
16
|
require('path');
|
|
17
|
+
require('process');
|
|
18
|
+
require('perf_hooks');
|
|
17
19
|
require('crypto');
|
|
18
20
|
require('fs');
|
|
19
21
|
require('events');
|
package/dist/shared/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
@license
|
|
3
|
-
Rollup.js v2.
|
|
4
|
-
|
|
3
|
+
Rollup.js v2.65.0
|
|
4
|
+
Fri, 21 Jan 2022 07:42:35 GMT - commit bebc50ddb613d240a03988d51787fd71b1a3914f
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
https://github.com/rollup/rollup
|
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
*/
|
|
11
11
|
'use strict';
|
|
12
12
|
|
|
13
|
-
const require$$0$
|
|
13
|
+
const require$$0$2 = require('events');
|
|
14
14
|
const fs$4 = require('fs');
|
|
15
|
-
const
|
|
15
|
+
const require$$0$1 = require('path');
|
|
16
16
|
const require$$2 = require('util');
|
|
17
17
|
const require$$1 = require('stream');
|
|
18
18
|
const rollup = require('./rollup.js');
|
|
@@ -22,7 +22,7 @@ var chokidar$1 = {};
|
|
|
22
22
|
|
|
23
23
|
const fs$3 = fs$4;
|
|
24
24
|
const { Readable } = require$$1;
|
|
25
|
-
const sysPath$3 =
|
|
25
|
+
const sysPath$3 = require$$0$1;
|
|
26
26
|
const { promisify: promisify$3 } = require$$2;
|
|
27
27
|
const picomatch$1 = rollup.picomatch;
|
|
28
28
|
|
|
@@ -620,7 +620,7 @@ var isGlob$2 = function isGlob(str, options) {
|
|
|
620
620
|
};
|
|
621
621
|
|
|
622
622
|
var isGlob$1 = isGlob$2;
|
|
623
|
-
var pathPosixDirname =
|
|
623
|
+
var pathPosixDirname = require$$0$1.posix.dirname;
|
|
624
624
|
var isWin32 = require$$2$1.platform() === 'win32';
|
|
625
625
|
|
|
626
626
|
var slash = '/';
|
|
@@ -2343,7 +2343,7 @@ const require$$0 = [
|
|
|
2343
2343
|
|
|
2344
2344
|
var binaryExtensions$1 = require$$0;
|
|
2345
2345
|
|
|
2346
|
-
const path =
|
|
2346
|
+
const path = require$$0$1;
|
|
2347
2347
|
const binaryExtensions = binaryExtensions$1;
|
|
2348
2348
|
|
|
2349
2349
|
const extensions = new Set(binaryExtensions);
|
|
@@ -2354,7 +2354,7 @@ var constants = {};
|
|
|
2354
2354
|
|
|
2355
2355
|
(function (exports) {
|
|
2356
2356
|
|
|
2357
|
-
const {sep} =
|
|
2357
|
+
const {sep} = require$$0$1;
|
|
2358
2358
|
const {platform} = process;
|
|
2359
2359
|
const os = require$$2$1;
|
|
2360
2360
|
|
|
@@ -2420,7 +2420,7 @@ exports.isIBMi = os.type() === 'OS400';
|
|
|
2420
2420
|
}(constants));
|
|
2421
2421
|
|
|
2422
2422
|
const fs$2 = fs$4;
|
|
2423
|
-
const sysPath$2 =
|
|
2423
|
+
const sysPath$2 = require$$0$1;
|
|
2424
2424
|
const { promisify: promisify$2 } = require$$2;
|
|
2425
2425
|
const isBinaryPath = isBinaryPath$1;
|
|
2426
2426
|
const {
|
|
@@ -2830,7 +2830,15 @@ async _handleSymlink(entry, directory, path, item) {
|
|
|
2830
2830
|
if (!this.fsw.options.followSymlinks) {
|
|
2831
2831
|
// watch symlink directly (don't follow) and detect changes
|
|
2832
2832
|
this.fsw._incrReadyCount();
|
|
2833
|
-
|
|
2833
|
+
|
|
2834
|
+
let linkPath;
|
|
2835
|
+
try {
|
|
2836
|
+
linkPath = await fsrealpath(path);
|
|
2837
|
+
} catch (e) {
|
|
2838
|
+
this.fsw._emitReady();
|
|
2839
|
+
return true;
|
|
2840
|
+
}
|
|
2841
|
+
|
|
2834
2842
|
if (this.fsw.closed) return;
|
|
2835
2843
|
if (dir.has(item)) {
|
|
2836
2844
|
if (this.fsw._symlinkPaths.get(full) !== linkPath) {
|
|
@@ -3056,13 +3064,15 @@ var nodefsHandler = NodeFsHandler$1;
|
|
|
3056
3064
|
|
|
3057
3065
|
var fseventsHandler = {exports: {}};
|
|
3058
3066
|
|
|
3067
|
+
const require$$3 = /*@__PURE__*/rollup.getAugmentedNamespace(rollup.fseventsImporter);
|
|
3068
|
+
|
|
3059
3069
|
const fs$1 = fs$4;
|
|
3060
|
-
const sysPath$1 =
|
|
3070
|
+
const sysPath$1 = require$$0$1;
|
|
3061
3071
|
const { promisify: promisify$1 } = require$$2;
|
|
3062
3072
|
|
|
3063
3073
|
let fsevents;
|
|
3064
3074
|
try {
|
|
3065
|
-
fsevents = require
|
|
3075
|
+
fsevents = require$$3.getFsEvents();
|
|
3066
3076
|
} catch (error) {
|
|
3067
3077
|
if (process.env.CHOKIDAR_PRINT_FSEVENTS_REQUIRE_ERROR) console.error(error);
|
|
3068
3078
|
}
|
|
@@ -3579,9 +3589,9 @@ async _addToFsEvents(path, transform, forceAdd, priorDepth) {
|
|
|
3579
3589
|
fseventsHandler.exports = FsEventsHandler$1;
|
|
3580
3590
|
fseventsHandler.exports.canUse = canUse;
|
|
3581
3591
|
|
|
3582
|
-
const { EventEmitter } = require$$0$
|
|
3592
|
+
const { EventEmitter } = require$$0$2;
|
|
3583
3593
|
const fs = fs$4;
|
|
3584
|
-
const sysPath =
|
|
3594
|
+
const sysPath = require$$0$1;
|
|
3585
3595
|
const { promisify } = require$$2;
|
|
3586
3596
|
const readdirp = readdirp_1;
|
|
3587
3597
|
const anymatch = anymatch$2.exports.default;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
@license
|
|
3
|
-
Rollup.js v2.
|
|
4
|
-
|
|
3
|
+
Rollup.js v2.65.0
|
|
4
|
+
Fri, 21 Jan 2022 07:42:35 GMT - commit bebc50ddb613d240a03988d51787fd71b1a3914f
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
https://github.com/rollup/rollup
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
'use strict';
|
|
12
12
|
|
|
13
13
|
const fs = require('fs');
|
|
14
|
-
const
|
|
14
|
+
const require$$0 = require('path');
|
|
15
15
|
const url = require('url');
|
|
16
16
|
const process$1 = require('process');
|
|
17
17
|
const tty = require('tty');
|
|
@@ -29,8 +29,7 @@ function _interopNamespaceDefault(e) {
|
|
|
29
29
|
return n;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
const
|
|
33
|
-
const path__namespace = /*#__PURE__*/_interopNamespaceDefault(path);
|
|
32
|
+
const require$$0__namespace = /*#__PURE__*/_interopNamespaceDefault(require$$0);
|
|
34
33
|
const tty__namespace = /*#__PURE__*/_interopNamespaceDefault(tty);
|
|
35
34
|
|
|
36
35
|
const env = process.env || {};
|
|
@@ -144,7 +143,7 @@ const { bold, cyan, dim, gray, green, red, underline, yellow } = createColors({
|
|
|
144
143
|
});
|
|
145
144
|
|
|
146
145
|
// log to stderr to keep `rollup main.js > bundle.js` from breaking
|
|
147
|
-
const stderr =
|
|
146
|
+
const stderr = (...args) => process.stderr.write(`${args.join('')}\n`);
|
|
148
147
|
function handleError(err, recover = false) {
|
|
149
148
|
let description = err.message || err;
|
|
150
149
|
if (err.name)
|
|
@@ -506,7 +505,7 @@ async function loadAndRegisterPlugin(inputOptions, pluginText) {
|
|
|
506
505
|
if (!plugin) {
|
|
507
506
|
try {
|
|
508
507
|
if (pluginText[0] == '.')
|
|
509
|
-
pluginText =
|
|
508
|
+
pluginText = require$$0__namespace.resolve(pluginText);
|
|
510
509
|
plugin = await requireOrImport(pluginText);
|
|
511
510
|
}
|
|
512
511
|
catch (err) {
|
|
@@ -564,7 +563,7 @@ async function loadAndParseConfigFile(fileName, commandOptions = {}) {
|
|
|
564
563
|
}
|
|
565
564
|
}
|
|
566
565
|
async function loadConfigFile(fileName, commandOptions) {
|
|
567
|
-
const extension =
|
|
566
|
+
const extension = require$$0.extname(fileName);
|
|
568
567
|
const configFileExport = commandOptions.configPlugin ||
|
|
569
568
|
!(extension === '.cjs' || (extension === '.mjs' && supportsNativeESM()))
|
|
570
569
|
? await getDefaultFromTranspiledConfigFile(fileName, commandOptions)
|
|
@@ -579,7 +578,7 @@ function getDefaultFromCjs(namespace) {
|
|
|
579
578
|
async function getDefaultFromTranspiledConfigFile(fileName, commandOptions) {
|
|
580
579
|
const warnings = batchWarnings();
|
|
581
580
|
const inputOptions = {
|
|
582
|
-
external: (id) => (id[0] !== '.' && !
|
|
581
|
+
external: (id) => (id[0] !== '.' && !require$$0.isAbsolute(id)) || id.slice(-5, id.length) === '.json',
|
|
583
582
|
input: fileName,
|
|
584
583
|
onwarn: warnings.add,
|
|
585
584
|
plugins: [],
|
|
@@ -611,8 +610,8 @@ async function getDefaultFromTranspiledConfigFile(fileName, commandOptions) {
|
|
|
611
610
|
return loadConfigFromBundledFile(fileName, code);
|
|
612
611
|
}
|
|
613
612
|
async function loadConfigFromBundledFile(fileName, bundledCode) {
|
|
614
|
-
const resolvedFileName =
|
|
615
|
-
const extension =
|
|
613
|
+
const resolvedFileName = fs.realpathSync(fileName);
|
|
614
|
+
const extension = require$$0.extname(resolvedFileName);
|
|
616
615
|
const defaultLoader = require.extensions[extension];
|
|
617
616
|
require.extensions[extension] = (module, requiredFileName) => {
|
|
618
617
|
if (requiredFileName === resolvedFileName) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
@license
|
|
3
|
-
Rollup.js v2.
|
|
4
|
-
|
|
3
|
+
Rollup.js v2.65.0
|
|
4
|
+
Fri, 21 Jan 2022 07:42:35 GMT - commit bebc50ddb613d240a03988d51787fd71b1a3914f
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
https://github.com/rollup/rollup
|
|
@@ -85,7 +85,7 @@ function mergeInputOptions(config, overrides, defaultOnWarnHandler) {
|
|
|
85
85
|
shimMissingExports: getOption('shimMissingExports'),
|
|
86
86
|
strictDeprecations: getOption('strictDeprecations'),
|
|
87
87
|
treeshake: getObjectOption(config, overrides, 'treeshake', rollup.objectifyOptionWithPresets(rollup.treeshakePresets, 'treeshake', 'false, true, ')),
|
|
88
|
-
watch: getWatch(config, overrides
|
|
88
|
+
watch: getWatch(config, overrides)
|
|
89
89
|
};
|
|
90
90
|
rollup.warnUnknownOptions(config, Object.keys(inputOptions), 'input options', inputOptions.onwarn, /^output$/);
|
|
91
91
|
return inputOptions;
|
|
@@ -99,7 +99,7 @@ const getExternal = (config, overrides) => {
|
|
|
99
99
|
const getOnWarn = (config, defaultOnWarnHandler) => config.onwarn
|
|
100
100
|
? warning => config.onwarn(warning, defaultOnWarnHandler)
|
|
101
101
|
: defaultOnWarnHandler;
|
|
102
|
-
const getObjectOption = (config, overrides, name, objectifyValue =
|
|
102
|
+
const getObjectOption = (config, overrides, name, objectifyValue = rollup.objectifyOption) => {
|
|
103
103
|
const commandOption = normalizeObjectOptionValue(overrides[name], objectifyValue);
|
|
104
104
|
const configOption = normalizeObjectOptionValue(config[name], objectifyValue);
|
|
105
105
|
if (commandOption !== undefined) {
|
|
@@ -107,7 +107,13 @@ const getObjectOption = (config, overrides, name, objectifyValue = value => (typ
|
|
|
107
107
|
}
|
|
108
108
|
return configOption;
|
|
109
109
|
};
|
|
110
|
-
const getWatch = (config, overrides
|
|
110
|
+
const getWatch = (config, overrides) => config.watch !== false && getObjectOption(config, overrides, 'watch');
|
|
111
|
+
const isWatchEnabled = (optionValue) => {
|
|
112
|
+
if (Array.isArray(optionValue)) {
|
|
113
|
+
return optionValue.reduce((result, value) => (typeof value === 'boolean' ? value : result), false);
|
|
114
|
+
}
|
|
115
|
+
return optionValue === true;
|
|
116
|
+
};
|
|
111
117
|
const normalizeObjectOptionValue = (optionValue, objectifyValue) => {
|
|
112
118
|
if (!optionValue) {
|
|
113
119
|
return optionValue;
|
|
@@ -168,5 +174,6 @@ function mergeOutputOptions(config, overrides, warn) {
|
|
|
168
174
|
}
|
|
169
175
|
|
|
170
176
|
exports.commandAliases = commandAliases;
|
|
177
|
+
exports.isWatchEnabled = isWatchEnabled;
|
|
171
178
|
exports.mergeOptions = mergeOptions;
|
|
172
179
|
//# sourceMappingURL=mergeOptions.js.map
|