rollup 3.0.0-7 → 3.0.0-8
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/LICENSE.md +7 -0
- package/dist/bin/rollup +3 -3
- package/dist/es/rollup.js +2 -2
- package/dist/es/shared/rollup.js +740 -267
- package/dist/es/shared/watch.js +7 -6
- package/dist/loadConfigFile.js +2 -2
- package/dist/rollup.d.ts +14 -3
- package/dist/rollup.js +2 -2
- package/dist/shared/index.js +2 -2
- package/dist/shared/loadConfigFile.js +6 -10
- package/dist/shared/mergeOptions.js +6 -4
- package/dist/shared/rollup.js +745 -283
- package/dist/shared/watch-cli.js +2 -2
- package/dist/shared/watch.js +3 -4
- package/package.json +22 -21
package/dist/es/shared/watch.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
@license
|
|
3
|
-
Rollup.js v3.0.0-
|
|
4
|
-
|
|
3
|
+
Rollup.js v3.0.0-7
|
|
4
|
+
Tue, 11 Oct 2022 04:31:14 GMT - commit d9237e8c942d96e21de8f275df8d7c9aa2f620f4
|
|
5
5
|
|
|
6
6
|
https://github.com/rollup/rollup
|
|
7
7
|
|
|
@@ -72,7 +72,7 @@ function getCommandOptions(rawCommandOptions) {
|
|
|
72
72
|
};
|
|
73
73
|
}
|
|
74
74
|
function mergeInputOptions(config, overrides, defaultOnWarnHandler) {
|
|
75
|
-
const getOption = (name) =>
|
|
75
|
+
const getOption = (name) => overrides[name] ?? config[name];
|
|
76
76
|
const inputOptions = {
|
|
77
77
|
acorn: getOption('acorn'),
|
|
78
78
|
acornInjectPlugins: config.acornInjectPlugins,
|
|
@@ -129,7 +129,7 @@ const normalizeObjectOptionValue = (optionValue, objectifyValue) => {
|
|
|
129
129
|
return objectifyValue(optionValue);
|
|
130
130
|
};
|
|
131
131
|
function mergeOutputOptions(config, overrides, warn) {
|
|
132
|
-
const getOption = (name) =>
|
|
132
|
+
const getOption = (name) => overrides[name] ?? config[name];
|
|
133
133
|
const outputOptions = {
|
|
134
134
|
amd: getObjectOption(config, overrides, 'amd'),
|
|
135
135
|
assetFileNames: getOption('assetFileNames'),
|
|
@@ -138,10 +138,12 @@ function mergeOutputOptions(config, overrides, warn) {
|
|
|
138
138
|
compact: getOption('compact'),
|
|
139
139
|
dir: getOption('dir'),
|
|
140
140
|
dynamicImportFunction: getOption('dynamicImportFunction'),
|
|
141
|
+
dynamicImportInCjs: getOption('dynamicImportInCjs'),
|
|
141
142
|
entryFileNames: getOption('entryFileNames'),
|
|
142
143
|
esModule: getOption('esModule'),
|
|
143
144
|
exports: getOption('exports'),
|
|
144
145
|
extend: getOption('extend'),
|
|
146
|
+
externalImportAssertions: getOption('externalImportAssertions'),
|
|
145
147
|
externalLiveBindings: getOption('externalLiveBindings'),
|
|
146
148
|
file: getOption('file'),
|
|
147
149
|
footer: getOption('footer'),
|
|
@@ -4748,9 +4750,8 @@ class FileWatcher {
|
|
|
4748
4750
|
}
|
|
4749
4751
|
}
|
|
4750
4752
|
watch(id, isTransformDependency) {
|
|
4751
|
-
var _a;
|
|
4752
4753
|
if (isTransformDependency) {
|
|
4753
|
-
const watcher =
|
|
4754
|
+
const watcher = this.transformWatchers.get(id) ?? this.createWatcher(id);
|
|
4754
4755
|
watcher.add(id);
|
|
4755
4756
|
this.transformWatchers.set(id, watcher);
|
|
4756
4757
|
}
|
package/dist/loadConfigFile.js
CHANGED
package/dist/rollup.d.ts
CHANGED
|
@@ -83,6 +83,7 @@ type PartialNull<T> = {
|
|
|
83
83
|
};
|
|
84
84
|
|
|
85
85
|
interface ModuleOptions {
|
|
86
|
+
assertions: Record<string, string>;
|
|
86
87
|
meta: CustomPluginOptions;
|
|
87
88
|
moduleSideEffects: boolean | 'no-treeshake';
|
|
88
89
|
syntheticNamedExports: boolean | string;
|
|
@@ -189,7 +190,12 @@ export interface PluginContext extends MinimalPluginContext {
|
|
|
189
190
|
resolve: (
|
|
190
191
|
source: string,
|
|
191
192
|
importer?: string,
|
|
192
|
-
options?: {
|
|
193
|
+
options?: {
|
|
194
|
+
assertions?: Record<string, string>;
|
|
195
|
+
custom?: CustomPluginOptions;
|
|
196
|
+
isEntry?: boolean;
|
|
197
|
+
skipSelf?: boolean;
|
|
198
|
+
}
|
|
193
199
|
) => Promise<ResolvedId | null>;
|
|
194
200
|
setAssetSource: (assetReferenceId: string, source: string | Uint8Array) => void;
|
|
195
201
|
warn: (warning: RollupWarning | string, pos?: number | { column: number; line: number }) => void;
|
|
@@ -220,7 +226,7 @@ export type ResolveIdHook = (
|
|
|
220
226
|
this: PluginContext,
|
|
221
227
|
source: string,
|
|
222
228
|
importer: string | undefined,
|
|
223
|
-
options: { custom?: CustomPluginOptions; isEntry: boolean }
|
|
229
|
+
options: { assertions: Record<string, string>; custom?: CustomPluginOptions; isEntry: boolean }
|
|
224
230
|
) => ResolveIdResult;
|
|
225
231
|
|
|
226
232
|
export type ShouldTransformCachedModuleHook = (
|
|
@@ -275,7 +281,8 @@ export type RenderChunkHook = (
|
|
|
275
281
|
export type ResolveDynamicImportHook = (
|
|
276
282
|
this: PluginContext,
|
|
277
283
|
specifier: string | AcornNode,
|
|
278
|
-
importer: string
|
|
284
|
+
importer: string,
|
|
285
|
+
options: { assertions: Record<string, string> }
|
|
279
286
|
) => ResolveIdResult;
|
|
280
287
|
|
|
281
288
|
export type ResolveImportMetaHook = (
|
|
@@ -613,10 +620,12 @@ export interface OutputOptions {
|
|
|
613
620
|
dir?: string;
|
|
614
621
|
/** @deprecated Use the "renderDynamicImport" plugin hook instead. */
|
|
615
622
|
dynamicImportFunction?: string;
|
|
623
|
+
dynamicImportInCjs?: boolean;
|
|
616
624
|
entryFileNames?: string | ((chunkInfo: PreRenderedChunk) => string);
|
|
617
625
|
esModule?: boolean | 'if-default-prop';
|
|
618
626
|
exports?: 'default' | 'named' | 'none' | 'auto';
|
|
619
627
|
extend?: boolean;
|
|
628
|
+
externalImportAssertions?: boolean;
|
|
620
629
|
externalLiveBindings?: boolean;
|
|
621
630
|
// only required for bundle.write
|
|
622
631
|
file?: string;
|
|
@@ -663,10 +672,12 @@ export interface NormalizedOutputOptions {
|
|
|
663
672
|
dir: string | undefined;
|
|
664
673
|
/** @deprecated Use the "renderDynamicImport" plugin hook instead. */
|
|
665
674
|
dynamicImportFunction: string | undefined;
|
|
675
|
+
dynamicImportInCjs: boolean;
|
|
666
676
|
entryFileNames: string | ((chunkInfo: PreRenderedChunk) => string);
|
|
667
677
|
esModule: boolean | 'if-default-prop';
|
|
668
678
|
exports: 'default' | 'named' | 'none' | 'auto';
|
|
669
679
|
extend: boolean;
|
|
680
|
+
externalImportAssertions: boolean;
|
|
670
681
|
externalLiveBindings: boolean;
|
|
671
682
|
file: string | undefined;
|
|
672
683
|
footer: AddonFunction;
|
package/dist/rollup.js
CHANGED
package/dist/shared/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
@license
|
|
3
|
-
Rollup.js v3.0.0-
|
|
4
|
-
|
|
3
|
+
Rollup.js v3.0.0-7
|
|
4
|
+
Tue, 11 Oct 2022 04:31:14 GMT - commit d9237e8c942d96e21de8f275df8d7c9aa2f620f4
|
|
5
5
|
|
|
6
6
|
https://github.com/rollup/rollup
|
|
7
7
|
|
|
@@ -146,8 +146,7 @@ const { bold, cyan, dim, gray, green, red, underline, yellow } = createColors({
|
|
|
146
146
|
// log to stderr to keep `rollup main.js > bundle.js` from breaking
|
|
147
147
|
const stderr = (...args) => process$1.stderr.write(`${args.join('')}\n`);
|
|
148
148
|
function handleError(err, recover = false) {
|
|
149
|
-
|
|
150
|
-
const name = err.name || ((_a = err.cause) === null || _a === void 0 ? void 0 : _a.name);
|
|
149
|
+
const name = err.name || err.cause?.name;
|
|
151
150
|
const nameSection = name ? `${name}: ` : '';
|
|
152
151
|
const pluginSection = err.plugin ? `(plugin ${err.plugin}) ` : '';
|
|
153
152
|
const message = `${pluginSection}${nameSection}${err.message}`;
|
|
@@ -178,7 +177,6 @@ function batchWarnings() {
|
|
|
178
177
|
let warningOccurred = false;
|
|
179
178
|
return {
|
|
180
179
|
add(warning) {
|
|
181
|
-
var _a;
|
|
182
180
|
count += 1;
|
|
183
181
|
warningOccurred = true;
|
|
184
182
|
if (warning.code in deferredHandlers) {
|
|
@@ -191,7 +189,7 @@ function batchWarnings() {
|
|
|
191
189
|
title(warning.message);
|
|
192
190
|
if (warning.url)
|
|
193
191
|
info(warning.url);
|
|
194
|
-
const id =
|
|
192
|
+
const id = warning.loc?.file || warning.id;
|
|
195
193
|
if (id) {
|
|
196
194
|
const loc = warning.loc
|
|
197
195
|
? `${rollup.relativeId(id)} (${warning.loc.line}:${warning.loc.column})`
|
|
@@ -288,7 +286,6 @@ const deferredHandlers = {
|
|
|
288
286
|
}
|
|
289
287
|
},
|
|
290
288
|
PLUGIN_WARNING(warnings) {
|
|
291
|
-
var _a;
|
|
292
289
|
const nestedByPlugin = nest(warnings, 'plugin');
|
|
293
290
|
for (const { key: plugin, items } of nestedByPlugin) {
|
|
294
291
|
const nestedByMessage = nest(items, 'message');
|
|
@@ -298,7 +295,7 @@ const deferredHandlers = {
|
|
|
298
295
|
for (const warning of items) {
|
|
299
296
|
if (warning.url && warning.url !== lastUrl)
|
|
300
297
|
info((lastUrl = warning.url));
|
|
301
|
-
const id = warning.id ||
|
|
298
|
+
const id = warning.id || warning.loc?.file;
|
|
302
299
|
if (id) {
|
|
303
300
|
let loc = rollup.relativeId(id);
|
|
304
301
|
if (warning.loc) {
|
|
@@ -528,8 +525,7 @@ async function loadAndRegisterPlugin(inputOptions, pluginText) {
|
|
|
528
525
|
inputOptions.plugins.push(typeof plugin === 'function' ? plugin.call(plugin, pluginArg) : plugin);
|
|
529
526
|
}
|
|
530
527
|
function getCamelizedPluginBaseName(pluginText) {
|
|
531
|
-
|
|
532
|
-
return (((_a = pluginText.match(/(@rollup\/plugin-|rollup-plugin-)(.+)$/)) === null || _a === void 0 ? void 0 : _a[2]) || pluginText)
|
|
528
|
+
return (pluginText.match(/(@rollup\/plugin-|rollup-plugin-)(.+)$/)?.[2] || pluginText)
|
|
533
529
|
.split(/[\\/]/)
|
|
534
530
|
.slice(-1)[0]
|
|
535
531
|
.split('.')[0]
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
@license
|
|
3
|
-
Rollup.js v3.0.0-
|
|
4
|
-
|
|
3
|
+
Rollup.js v3.0.0-7
|
|
4
|
+
Tue, 11 Oct 2022 04:31:14 GMT - commit d9237e8c942d96e21de8f275df8d7c9aa2f620f4
|
|
5
5
|
|
|
6
6
|
https://github.com/rollup/rollup
|
|
7
7
|
|
|
@@ -61,7 +61,7 @@ function getCommandOptions(rawCommandOptions) {
|
|
|
61
61
|
};
|
|
62
62
|
}
|
|
63
63
|
function mergeInputOptions(config, overrides, defaultOnWarnHandler) {
|
|
64
|
-
const getOption = (name) =>
|
|
64
|
+
const getOption = (name) => overrides[name] ?? config[name];
|
|
65
65
|
const inputOptions = {
|
|
66
66
|
acorn: getOption('acorn'),
|
|
67
67
|
acornInjectPlugins: config.acornInjectPlugins,
|
|
@@ -124,7 +124,7 @@ const normalizeObjectOptionValue = (optionValue, objectifyValue) => {
|
|
|
124
124
|
return objectifyValue(optionValue);
|
|
125
125
|
};
|
|
126
126
|
function mergeOutputOptions(config, overrides, warn) {
|
|
127
|
-
const getOption = (name) =>
|
|
127
|
+
const getOption = (name) => overrides[name] ?? config[name];
|
|
128
128
|
const outputOptions = {
|
|
129
129
|
amd: getObjectOption(config, overrides, 'amd'),
|
|
130
130
|
assetFileNames: getOption('assetFileNames'),
|
|
@@ -133,10 +133,12 @@ function mergeOutputOptions(config, overrides, warn) {
|
|
|
133
133
|
compact: getOption('compact'),
|
|
134
134
|
dir: getOption('dir'),
|
|
135
135
|
dynamicImportFunction: getOption('dynamicImportFunction'),
|
|
136
|
+
dynamicImportInCjs: getOption('dynamicImportInCjs'),
|
|
136
137
|
entryFileNames: getOption('entryFileNames'),
|
|
137
138
|
esModule: getOption('esModule'),
|
|
138
139
|
exports: getOption('exports'),
|
|
139
140
|
extend: getOption('extend'),
|
|
141
|
+
externalImportAssertions: getOption('externalImportAssertions'),
|
|
140
142
|
externalLiveBindings: getOption('externalLiveBindings'),
|
|
141
143
|
file: getOption('file'),
|
|
142
144
|
footer: getOption('footer'),
|