rollup 3.29.0 → 3.29.1
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/dist/bin/rollup +2 -2
- package/dist/es/getLogFilter.js +2 -2
- package/dist/es/rollup.js +2 -2
- package/dist/es/shared/node-entry.js +32 -11
- package/dist/es/shared/watch.js +2 -2
- package/dist/getLogFilter.js +2 -2
- package/dist/loadConfigFile.js +2 -2
- package/dist/rollup.js +2 -2
- package/dist/shared/fsevents-importer.js +2 -2
- package/dist/shared/index.js +2 -2
- package/dist/shared/loadConfigFile.js +2 -2
- package/dist/shared/rollup.js +32 -11
- package/dist/shared/watch-cli.js +2 -2
- package/dist/shared/watch-proxy.js +2 -2
- package/dist/shared/watch.js +2 -2
- package/package.json +9 -9
package/dist/bin/rollup
CHANGED
package/dist/es/getLogFilter.js
CHANGED
package/dist/es/rollup.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
@license
|
|
3
|
-
Rollup.js v3.29.
|
|
4
|
-
|
|
3
|
+
Rollup.js v3.29.1
|
|
4
|
+
Sun, 10 Sep 2023 05:55:18 GMT - commit 40da6f85525c2ce48d9fd8d5c3579c41d8ef47a8
|
|
5
5
|
|
|
6
6
|
https://github.com/rollup/rollup
|
|
7
7
|
|
|
@@ -15,7 +15,7 @@ import { createHash as createHash$1 } from 'node:crypto';
|
|
|
15
15
|
import { lstat, realpath, readdir, readFile, mkdir, writeFile } from 'node:fs/promises';
|
|
16
16
|
import * as tty from 'tty';
|
|
17
17
|
|
|
18
|
-
var version$1 = "3.29.
|
|
18
|
+
var version$1 = "3.29.1";
|
|
19
19
|
|
|
20
20
|
const comma = ','.charCodeAt(0);
|
|
21
21
|
const semicolon = ';'.charCodeAt(0);
|
|
@@ -11019,6 +11019,7 @@ const INTEROP_NAMESPACE_COMPAT_VARIABLE = '_interopNamespaceCompat';
|
|
|
11019
11019
|
const INTEROP_NAMESPACE_DEFAULT_VARIABLE = '_interopNamespaceDefault';
|
|
11020
11020
|
const INTEROP_NAMESPACE_DEFAULT_ONLY_VARIABLE = '_interopNamespaceDefaultOnly';
|
|
11021
11021
|
const MERGE_NAMESPACES_VARIABLE = '_mergeNamespaces';
|
|
11022
|
+
const DOCUMENT_CURRENT_SCRIPT = '_documentCurrentScript';
|
|
11022
11023
|
const defaultInteropHelpersByInteropType = {
|
|
11023
11024
|
auto: INTEROP_DEFAULT_VARIABLE,
|
|
11024
11025
|
compat: INTEROP_DEFAULT_COMPAT_VARIABLE,
|
|
@@ -11048,6 +11049,9 @@ const getHelpersBlock = (additionalHelpers, accessedGlobals, indent, snippets, l
|
|
|
11048
11049
|
: '').join('');
|
|
11049
11050
|
};
|
|
11050
11051
|
const HELPER_GENERATORS = {
|
|
11052
|
+
[DOCUMENT_CURRENT_SCRIPT](_t, { _, n }) {
|
|
11053
|
+
return `var${_}${DOCUMENT_CURRENT_SCRIPT}${_}=${_}typeof${_}document${_}!==${_}'undefined'${_}?${_}document.currentScript${_}:${_}null;${n}`;
|
|
11054
|
+
},
|
|
11051
11055
|
[INTEROP_DEFAULT_COMPAT_VARIABLE](_t, snippets, liveBindings) {
|
|
11052
11056
|
const { _, getDirectReturnFunction, n } = snippets;
|
|
11053
11057
|
const [left, right] = getDirectReturnFunction(['e'], {
|
|
@@ -11791,8 +11795,10 @@ class MetaProperty extends NodeBase {
|
|
|
11791
11795
|
}
|
|
11792
11796
|
}
|
|
11793
11797
|
}
|
|
11794
|
-
render(code,
|
|
11795
|
-
const {
|
|
11798
|
+
render(code, renderOptions) {
|
|
11799
|
+
const { format, pluginDriver, snippets } = renderOptions;
|
|
11800
|
+
const { context: { module }, meta: { name }, metaProperty, parent, preliminaryChunkId, referenceId, start, end } = this;
|
|
11801
|
+
const { id: moduleId } = module;
|
|
11796
11802
|
if (name !== IMPORT)
|
|
11797
11803
|
return;
|
|
11798
11804
|
const chunkId = preliminaryChunkId;
|
|
@@ -11805,10 +11811,14 @@ class MetaProperty extends NodeBase {
|
|
|
11805
11811
|
code.overwrite(parent.start, parent.end, replacement, { contentOnly: true });
|
|
11806
11812
|
return;
|
|
11807
11813
|
}
|
|
11808
|
-
|
|
11814
|
+
let replacement = pluginDriver.hookFirstSync('resolveImportMeta', [
|
|
11809
11815
|
metaProperty,
|
|
11810
11816
|
{ chunkId, format, moduleId }
|
|
11811
|
-
])
|
|
11817
|
+
]);
|
|
11818
|
+
if (!replacement) {
|
|
11819
|
+
replacement = importMetaMechanisms[format]?.(metaProperty, { chunkId, snippets });
|
|
11820
|
+
renderOptions.accessedDocumentCurrentScript || (renderOptions.accessedDocumentCurrentScript = formatsMaybeAccessDocumentCurrentScript.includes(format) && replacement !== 'undefined');
|
|
11821
|
+
}
|
|
11812
11822
|
if (typeof replacement === 'string') {
|
|
11813
11823
|
if (parent instanceof MemberExpression) {
|
|
11814
11824
|
code.overwrite(parent.start, parent.end, replacement, { contentOnly: true });
|
|
@@ -11826,13 +11836,14 @@ class MetaProperty extends NodeBase {
|
|
|
11826
11836
|
}
|
|
11827
11837
|
}
|
|
11828
11838
|
}
|
|
11839
|
+
const formatsMaybeAccessDocumentCurrentScript = ['cjs', 'iife', 'umd'];
|
|
11829
11840
|
const accessedMetaUrlGlobals = {
|
|
11830
11841
|
amd: ['document', 'module', 'URL'],
|
|
11831
|
-
cjs: ['document', 'require', 'URL'],
|
|
11842
|
+
cjs: ['document', 'require', 'URL', DOCUMENT_CURRENT_SCRIPT],
|
|
11832
11843
|
es: [],
|
|
11833
|
-
iife: ['document', 'URL'],
|
|
11844
|
+
iife: ['document', 'URL', DOCUMENT_CURRENT_SCRIPT],
|
|
11834
11845
|
system: ['module'],
|
|
11835
|
-
umd: ['document', 'require', 'URL']
|
|
11846
|
+
umd: ['document', 'require', 'URL', DOCUMENT_CURRENT_SCRIPT]
|
|
11836
11847
|
};
|
|
11837
11848
|
const accessedFileUrlGlobals = {
|
|
11838
11849
|
amd: ['document', 'require', 'URL'],
|
|
@@ -11854,7 +11865,7 @@ const getGenericImportMetaMechanism = (getUrl) => (property, { chunkId }) => {
|
|
|
11854
11865
|
};
|
|
11855
11866
|
const getFileUrlFromFullPath = (path) => `require('u' + 'rl').pathToFileURL(${path}).href`;
|
|
11856
11867
|
const getFileUrlFromRelativePath = (path) => getFileUrlFromFullPath(`__dirname + '/${path}'`);
|
|
11857
|
-
const getUrlFromDocument = (chunkId, umd = false) => `${umd ? `typeof document === 'undefined' ? location.href : ` : ''}(
|
|
11868
|
+
const getUrlFromDocument = (chunkId, umd = false) => `${umd ? `typeof document === 'undefined' ? location.href : ` : ''}(${DOCUMENT_CURRENT_SCRIPT} && ${DOCUMENT_CURRENT_SCRIPT}.src || new URL('${escapeId(chunkId)}', document.baseURI).href)`;
|
|
11858
11869
|
const relativeUrlMechanisms = {
|
|
11859
11870
|
amd: relativePath => {
|
|
11860
11871
|
if (relativePath[0] !== '.')
|
|
@@ -13477,6 +13488,9 @@ const TIMED_PLUGIN_HOOKS = [
|
|
|
13477
13488
|
'writeBundle'
|
|
13478
13489
|
];
|
|
13479
13490
|
function getPluginWithTimers(plugin, index) {
|
|
13491
|
+
if (plugin._hasTimer)
|
|
13492
|
+
return plugin;
|
|
13493
|
+
plugin._hasTimer = true;
|
|
13480
13494
|
for (const hook of TIMED_PLUGIN_HOOKS) {
|
|
13481
13495
|
if (hook in plugin) {
|
|
13482
13496
|
let timerLabel = `plugin ${index}`;
|
|
@@ -16506,6 +16520,7 @@ class Chunk {
|
|
|
16506
16520
|
const accessedGlobals = new Set();
|
|
16507
16521
|
const renderedModuleSources = new Map();
|
|
16508
16522
|
const renderOptions = {
|
|
16523
|
+
accessedDocumentCurrentScript: false,
|
|
16509
16524
|
dynamicImportFunction,
|
|
16510
16525
|
exportNamesByVariable,
|
|
16511
16526
|
format,
|
|
@@ -16522,6 +16537,12 @@ class Chunk {
|
|
|
16522
16537
|
let source;
|
|
16523
16538
|
if (module.isIncluded() || includedNamespaces.has(module)) {
|
|
16524
16539
|
const rendered = module.render(renderOptions);
|
|
16540
|
+
if (!renderOptions.accessedDocumentCurrentScript &&
|
|
16541
|
+
formatsMaybeAccessDocumentCurrentScript.includes(format)) {
|
|
16542
|
+
// eslint-disable-next-line unicorn/consistent-destructuring
|
|
16543
|
+
this.accessedGlobalsByScope.get(module.scope)?.delete(DOCUMENT_CURRENT_SCRIPT);
|
|
16544
|
+
}
|
|
16545
|
+
renderOptions.accessedDocumentCurrentScript = false;
|
|
16525
16546
|
({ source } = rendered);
|
|
16526
16547
|
usesTopLevelAwait || (usesTopLevelAwait = rendered.usesTopLevelAwait);
|
|
16527
16548
|
renderedLength = source.length();
|
package/dist/es/shared/watch.js
CHANGED
package/dist/getLogFilter.js
CHANGED
package/dist/loadConfigFile.js
CHANGED
package/dist/rollup.js
CHANGED
package/dist/shared/index.js
CHANGED
package/dist/shared/rollup.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
@license
|
|
3
|
-
Rollup.js v3.29.
|
|
4
|
-
|
|
3
|
+
Rollup.js v3.29.1
|
|
4
|
+
Sun, 10 Sep 2023 05:55:18 GMT - commit 40da6f85525c2ce48d9fd8d5c3579c41d8ef47a8
|
|
5
5
|
|
|
6
6
|
https://github.com/rollup/rollup
|
|
7
7
|
|
|
@@ -30,7 +30,7 @@ function _interopNamespaceDefault(e) {
|
|
|
30
30
|
|
|
31
31
|
const tty__namespace = /*#__PURE__*/_interopNamespaceDefault(tty);
|
|
32
32
|
|
|
33
|
-
var version$1 = "3.29.
|
|
33
|
+
var version$1 = "3.29.1";
|
|
34
34
|
|
|
35
35
|
function ensureArray$1(items) {
|
|
36
36
|
if (Array.isArray(items)) {
|
|
@@ -12518,6 +12518,7 @@ const INTEROP_NAMESPACE_COMPAT_VARIABLE = '_interopNamespaceCompat';
|
|
|
12518
12518
|
const INTEROP_NAMESPACE_DEFAULT_VARIABLE = '_interopNamespaceDefault';
|
|
12519
12519
|
const INTEROP_NAMESPACE_DEFAULT_ONLY_VARIABLE = '_interopNamespaceDefaultOnly';
|
|
12520
12520
|
const MERGE_NAMESPACES_VARIABLE = '_mergeNamespaces';
|
|
12521
|
+
const DOCUMENT_CURRENT_SCRIPT = '_documentCurrentScript';
|
|
12521
12522
|
const defaultInteropHelpersByInteropType = {
|
|
12522
12523
|
auto: INTEROP_DEFAULT_VARIABLE,
|
|
12523
12524
|
compat: INTEROP_DEFAULT_COMPAT_VARIABLE,
|
|
@@ -12547,6 +12548,9 @@ const getHelpersBlock = (additionalHelpers, accessedGlobals, indent, snippets, l
|
|
|
12547
12548
|
: '').join('');
|
|
12548
12549
|
};
|
|
12549
12550
|
const HELPER_GENERATORS = {
|
|
12551
|
+
[DOCUMENT_CURRENT_SCRIPT](_t, { _, n }) {
|
|
12552
|
+
return `var${_}${DOCUMENT_CURRENT_SCRIPT}${_}=${_}typeof${_}document${_}!==${_}'undefined'${_}?${_}document.currentScript${_}:${_}null;${n}`;
|
|
12553
|
+
},
|
|
12550
12554
|
[INTEROP_DEFAULT_COMPAT_VARIABLE](_t, snippets, liveBindings) {
|
|
12551
12555
|
const { _, getDirectReturnFunction, n } = snippets;
|
|
12552
12556
|
const [left, right] = getDirectReturnFunction(['e'], {
|
|
@@ -13290,8 +13294,10 @@ class MetaProperty extends NodeBase {
|
|
|
13290
13294
|
}
|
|
13291
13295
|
}
|
|
13292
13296
|
}
|
|
13293
|
-
render(code,
|
|
13294
|
-
const {
|
|
13297
|
+
render(code, renderOptions) {
|
|
13298
|
+
const { format, pluginDriver, snippets } = renderOptions;
|
|
13299
|
+
const { context: { module }, meta: { name }, metaProperty, parent, preliminaryChunkId, referenceId, start, end } = this;
|
|
13300
|
+
const { id: moduleId } = module;
|
|
13295
13301
|
if (name !== IMPORT)
|
|
13296
13302
|
return;
|
|
13297
13303
|
const chunkId = preliminaryChunkId;
|
|
@@ -13304,10 +13310,14 @@ class MetaProperty extends NodeBase {
|
|
|
13304
13310
|
code.overwrite(parent.start, parent.end, replacement, { contentOnly: true });
|
|
13305
13311
|
return;
|
|
13306
13312
|
}
|
|
13307
|
-
|
|
13313
|
+
let replacement = pluginDriver.hookFirstSync('resolveImportMeta', [
|
|
13308
13314
|
metaProperty,
|
|
13309
13315
|
{ chunkId, format, moduleId }
|
|
13310
|
-
])
|
|
13316
|
+
]);
|
|
13317
|
+
if (!replacement) {
|
|
13318
|
+
replacement = importMetaMechanisms[format]?.(metaProperty, { chunkId, snippets });
|
|
13319
|
+
renderOptions.accessedDocumentCurrentScript || (renderOptions.accessedDocumentCurrentScript = formatsMaybeAccessDocumentCurrentScript.includes(format) && replacement !== 'undefined');
|
|
13320
|
+
}
|
|
13311
13321
|
if (typeof replacement === 'string') {
|
|
13312
13322
|
if (parent instanceof MemberExpression) {
|
|
13313
13323
|
code.overwrite(parent.start, parent.end, replacement, { contentOnly: true });
|
|
@@ -13325,13 +13335,14 @@ class MetaProperty extends NodeBase {
|
|
|
13325
13335
|
}
|
|
13326
13336
|
}
|
|
13327
13337
|
}
|
|
13338
|
+
const formatsMaybeAccessDocumentCurrentScript = ['cjs', 'iife', 'umd'];
|
|
13328
13339
|
const accessedMetaUrlGlobals = {
|
|
13329
13340
|
amd: ['document', 'module', 'URL'],
|
|
13330
|
-
cjs: ['document', 'require', 'URL'],
|
|
13341
|
+
cjs: ['document', 'require', 'URL', DOCUMENT_CURRENT_SCRIPT],
|
|
13331
13342
|
es: [],
|
|
13332
|
-
iife: ['document', 'URL'],
|
|
13343
|
+
iife: ['document', 'URL', DOCUMENT_CURRENT_SCRIPT],
|
|
13333
13344
|
system: ['module'],
|
|
13334
|
-
umd: ['document', 'require', 'URL']
|
|
13345
|
+
umd: ['document', 'require', 'URL', DOCUMENT_CURRENT_SCRIPT]
|
|
13335
13346
|
};
|
|
13336
13347
|
const accessedFileUrlGlobals = {
|
|
13337
13348
|
amd: ['document', 'require', 'URL'],
|
|
@@ -13353,7 +13364,7 @@ const getGenericImportMetaMechanism = (getUrl) => (property, { chunkId }) => {
|
|
|
13353
13364
|
};
|
|
13354
13365
|
const getFileUrlFromFullPath = (path) => `require('u' + 'rl').pathToFileURL(${path}).href`;
|
|
13355
13366
|
const getFileUrlFromRelativePath = (path) => getFileUrlFromFullPath(`__dirname + '/${path}'`);
|
|
13356
|
-
const getUrlFromDocument = (chunkId, umd = false) => `${umd ? `typeof document === 'undefined' ? location.href : ` : ''}(
|
|
13367
|
+
const getUrlFromDocument = (chunkId, umd = false) => `${umd ? `typeof document === 'undefined' ? location.href : ` : ''}(${DOCUMENT_CURRENT_SCRIPT} && ${DOCUMENT_CURRENT_SCRIPT}.src || new URL('${escapeId(chunkId)}', document.baseURI).href)`;
|
|
13357
13368
|
const relativeUrlMechanisms = {
|
|
13358
13369
|
amd: relativePath => {
|
|
13359
13370
|
if (relativePath[0] !== '.')
|
|
@@ -14969,6 +14980,9 @@ const TIMED_PLUGIN_HOOKS = [
|
|
|
14969
14980
|
'writeBundle'
|
|
14970
14981
|
];
|
|
14971
14982
|
function getPluginWithTimers(plugin, index) {
|
|
14983
|
+
if (plugin._hasTimer)
|
|
14984
|
+
return plugin;
|
|
14985
|
+
plugin._hasTimer = true;
|
|
14972
14986
|
for (const hook of TIMED_PLUGIN_HOOKS) {
|
|
14973
14987
|
if (hook in plugin) {
|
|
14974
14988
|
let timerLabel = `plugin ${index}`;
|
|
@@ -17893,6 +17907,7 @@ class Chunk {
|
|
|
17893
17907
|
const accessedGlobals = new Set();
|
|
17894
17908
|
const renderedModuleSources = new Map();
|
|
17895
17909
|
const renderOptions = {
|
|
17910
|
+
accessedDocumentCurrentScript: false,
|
|
17896
17911
|
dynamicImportFunction,
|
|
17897
17912
|
exportNamesByVariable,
|
|
17898
17913
|
format,
|
|
@@ -17909,6 +17924,12 @@ class Chunk {
|
|
|
17909
17924
|
let source;
|
|
17910
17925
|
if (module.isIncluded() || includedNamespaces.has(module)) {
|
|
17911
17926
|
const rendered = module.render(renderOptions);
|
|
17927
|
+
if (!renderOptions.accessedDocumentCurrentScript &&
|
|
17928
|
+
formatsMaybeAccessDocumentCurrentScript.includes(format)) {
|
|
17929
|
+
// eslint-disable-next-line unicorn/consistent-destructuring
|
|
17930
|
+
this.accessedGlobalsByScope.get(module.scope)?.delete(DOCUMENT_CURRENT_SCRIPT);
|
|
17931
|
+
}
|
|
17932
|
+
renderOptions.accessedDocumentCurrentScript = false;
|
|
17912
17933
|
({ source } = rendered);
|
|
17913
17934
|
usesTopLevelAwait || (usesTopLevelAwait = rendered.usesTopLevelAwait);
|
|
17914
17935
|
renderedLength = source.length();
|
package/dist/shared/watch-cli.js
CHANGED
package/dist/shared/watch.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rollup",
|
|
3
|
-
"version": "3.29.
|
|
3
|
+
"version": "3.29.1",
|
|
4
4
|
"description": "Next-generation ES module bundler",
|
|
5
5
|
"main": "dist/rollup.js",
|
|
6
6
|
"module": "dist/es/rollup.js",
|
|
@@ -71,9 +71,9 @@
|
|
|
71
71
|
"@codemirror/language": "^6.9.0",
|
|
72
72
|
"@codemirror/search": "^6.5.2",
|
|
73
73
|
"@codemirror/state": "^6.2.1",
|
|
74
|
-
"@codemirror/view": "^6.17.
|
|
74
|
+
"@codemirror/view": "^6.17.1",
|
|
75
75
|
"@jridgewell/sourcemap-codec": "^1.4.15",
|
|
76
|
-
"@mermaid-js/mermaid-cli": "^10.
|
|
76
|
+
"@mermaid-js/mermaid-cli": "^10.4.0",
|
|
77
77
|
"@rollup/plugin-alias": "^5.0.0",
|
|
78
78
|
"@rollup/plugin-buble": "^1.0.2",
|
|
79
79
|
"@rollup/plugin-commonjs": "^25.0.4",
|
|
@@ -85,10 +85,10 @@
|
|
|
85
85
|
"@rollup/pluginutils": "^5.0.4",
|
|
86
86
|
"@types/estree": "1.0.1",
|
|
87
87
|
"@types/mocha": "^10.0.1",
|
|
88
|
-
"@types/node": "~14.18.
|
|
88
|
+
"@types/node": "~14.18.58",
|
|
89
89
|
"@types/yargs-parser": "^21.0.0",
|
|
90
|
-
"@typescript-eslint/eslint-plugin": "^6.
|
|
91
|
-
"@typescript-eslint/parser": "^6.
|
|
90
|
+
"@typescript-eslint/eslint-plugin": "^6.6.0",
|
|
91
|
+
"@typescript-eslint/parser": "^6.6.0",
|
|
92
92
|
"@vue/eslint-config-prettier": "^8.0.0",
|
|
93
93
|
"@vue/eslint-config-typescript": "^11.0.3",
|
|
94
94
|
"acorn": "^8.10.0",
|
|
@@ -124,12 +124,12 @@
|
|
|
124
124
|
"mocha": "^10.2.0",
|
|
125
125
|
"nyc": "^15.1.0",
|
|
126
126
|
"pinia": "^2.1.6",
|
|
127
|
-
"prettier": "^3.0.
|
|
127
|
+
"prettier": "^3.0.3",
|
|
128
128
|
"pretty-bytes": "^6.1.1",
|
|
129
129
|
"pretty-ms": "^8.0.0",
|
|
130
130
|
"requirejs": "^2.3.6",
|
|
131
131
|
"rollup": "^3.28.1",
|
|
132
|
-
"rollup-plugin-license": "^3.0
|
|
132
|
+
"rollup-plugin-license": "^3.1.0",
|
|
133
133
|
"rollup-plugin-string": "^3.0.0",
|
|
134
134
|
"rollup-plugin-thatworks": "^1.0.4",
|
|
135
135
|
"semver": "^7.5.4",
|
|
@@ -138,7 +138,7 @@
|
|
|
138
138
|
"source-map": "^0.7.4",
|
|
139
139
|
"source-map-support": "^0.5.21",
|
|
140
140
|
"systemjs": "^6.14.2",
|
|
141
|
-
"terser": "^5.19.
|
|
141
|
+
"terser": "^5.19.4",
|
|
142
142
|
"tslib": "^2.6.2",
|
|
143
143
|
"typescript": "^5.2.2",
|
|
144
144
|
"vite": "^4.4.9",
|