@rollup/wasm-node 4.9.6 → 4.10.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/dist/bin/rollup +88 -50
- package/dist/es/getLogFilter.js +2 -2
- package/dist/es/parseAst.js +2 -2
- package/dist/es/rollup.js +2 -2
- package/dist/es/shared/node-entry.js +78 -37
- package/dist/es/shared/parseAst.js +6 -2
- package/dist/es/shared/watch.js +6 -3
- package/dist/getLogFilter.js +2 -2
- package/dist/loadConfigFile.js +2 -2
- package/dist/native.js +8 -1
- package/dist/parseAst.js +2 -2
- package/dist/rollup.d.ts +4 -0
- package/dist/rollup.js +2 -2
- package/dist/shared/fsevents-importer.js +2 -2
- package/dist/shared/index.js +6 -3
- package/dist/shared/loadConfigFile.js +2 -2
- package/dist/shared/parseAst.js +6 -2
- package/dist/shared/rollup.js +77 -36
- package/dist/shared/watch-cli.js +2 -2
- package/dist/shared/watch.js +2 -2
- package/dist/wasm-node/bindings_wasm.js +57 -14
- package/dist/wasm-node/bindings_wasm_bg.wasm +0 -0
- package/package.json +27 -26
package/dist/getLogFilter.js
CHANGED
package/dist/loadConfigFile.js
CHANGED
package/dist/native.js
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
|
-
const {
|
|
1
|
+
const {
|
|
2
|
+
parse,
|
|
3
|
+
xxhashBase64Url,
|
|
4
|
+
xxhashBase36,
|
|
5
|
+
xxhashBase16
|
|
6
|
+
} = require('./wasm-node/bindings_wasm.js');
|
|
2
7
|
|
|
3
8
|
exports.parse = parse;
|
|
4
9
|
exports.parseAsync = async (code, allowReturnOutsideFunction, _signal) =>
|
|
5
10
|
parse(code, allowReturnOutsideFunction);
|
|
6
11
|
exports.xxhashBase64Url = xxhashBase64Url;
|
|
12
|
+
exports.xxhashBase36 = xxhashBase36;
|
|
13
|
+
exports.xxhashBase16 = xxhashBase16;
|
package/dist/parseAst.js
CHANGED
package/dist/rollup.d.ts
CHANGED
|
@@ -683,6 +683,8 @@ type AddonFunction = (chunk: RenderedChunk) => string | Promise<string>;
|
|
|
683
683
|
|
|
684
684
|
type OutputPluginOption = MaybePromise<OutputPlugin | NullValue | false | OutputPluginOption[]>;
|
|
685
685
|
|
|
686
|
+
type HashCharacters = 'base64' | 'base36' | 'hex';
|
|
687
|
+
|
|
686
688
|
export interface OutputOptions {
|
|
687
689
|
amd?: AmdOptions;
|
|
688
690
|
assetFileNames?: string | ((chunkInfo: PreRenderedAsset) => string);
|
|
@@ -708,6 +710,7 @@ export interface OutputOptions {
|
|
|
708
710
|
freeze?: boolean;
|
|
709
711
|
generatedCode?: GeneratedCodePreset | GeneratedCodeOptions;
|
|
710
712
|
globals?: GlobalsOption;
|
|
713
|
+
hashCharacters?: HashCharacters;
|
|
711
714
|
hoistTransitiveImports?: boolean;
|
|
712
715
|
indent?: string | boolean;
|
|
713
716
|
inlineDynamicImports?: boolean;
|
|
@@ -758,6 +761,7 @@ export interface NormalizedOutputOptions {
|
|
|
758
761
|
freeze: boolean;
|
|
759
762
|
generatedCode: NormalizedGeneratedCodeOptions;
|
|
760
763
|
globals: GlobalsOption;
|
|
764
|
+
hashCharacters: HashCharacters;
|
|
761
765
|
hoistTransitiveImports: boolean;
|
|
762
766
|
indent: true | string;
|
|
763
767
|
inlineDynamicImports: boolean;
|
package/dist/rollup.js
CHANGED
package/dist/shared/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
@license
|
|
3
|
-
Rollup.js v4.
|
|
4
|
-
|
|
3
|
+
Rollup.js v4.10.0
|
|
4
|
+
Sat, 10 Feb 2024 05:58:12 GMT - commit 762420860765e8e46e24d48b38f5b98ca31735fa
|
|
5
5
|
|
|
6
6
|
https://github.com/rollup/rollup
|
|
7
7
|
|
|
@@ -2382,6 +2382,7 @@ var constants = {};
|
|
|
2382
2382
|
exports.FSEVENT_MOVED = 'moved';
|
|
2383
2383
|
exports.FSEVENT_CLONED = 'cloned';
|
|
2384
2384
|
exports.FSEVENT_UNKNOWN = 'unknown';
|
|
2385
|
+
exports.FSEVENT_FLAG_MUST_SCAN_SUBDIRS = 1;
|
|
2385
2386
|
exports.FSEVENT_TYPE_FILE = 'file';
|
|
2386
2387
|
exports.FSEVENT_TYPE_DIRECTORY = 'directory';
|
|
2387
2388
|
exports.FSEVENT_TYPE_SYMLINK = 'symlink';
|
|
@@ -3107,6 +3108,7 @@ const {
|
|
|
3107
3108
|
FSEVENT_MOVED,
|
|
3108
3109
|
// FSEVENT_CLONED,
|
|
3109
3110
|
FSEVENT_UNKNOWN,
|
|
3111
|
+
FSEVENT_FLAG_MUST_SCAN_SUBDIRS,
|
|
3110
3112
|
FSEVENT_TYPE_FILE,
|
|
3111
3113
|
FSEVENT_TYPE_DIRECTORY,
|
|
3112
3114
|
FSEVENT_TYPE_SYMLINK,
|
|
@@ -3218,6 +3220,7 @@ function setFSEventsListener(path, realPath, listener, rawEmitter) {
|
|
|
3218
3220
|
rawEmitter,
|
|
3219
3221
|
watcher: createFSEventsInstance(watchPath, (fullPath, flags) => {
|
|
3220
3222
|
if (!cont.listeners.size) return;
|
|
3223
|
+
if (flags & FSEVENT_FLAG_MUST_SCAN_SUBDIRS) return;
|
|
3221
3224
|
const info = fsevents.getInfo(fullPath, flags);
|
|
3222
3225
|
cont.listeners.forEach(list => {
|
|
3223
3226
|
list(fullPath, flags, info);
|
|
@@ -4036,7 +4039,7 @@ add(paths_, _origAdd, _internal) {
|
|
|
4036
4039
|
|
|
4037
4040
|
if (this.options.useFsEvents && this._fsEventsHandler) {
|
|
4038
4041
|
if (!this._readyCount) this._readyCount = paths.length;
|
|
4039
|
-
if (this.options.persistent) this._readyCount
|
|
4042
|
+
if (this.options.persistent) this._readyCount += paths.length;
|
|
4040
4043
|
paths.forEach((path) => this._fsEventsHandler._addToFsEvents(path));
|
|
4041
4044
|
} else {
|
|
4042
4045
|
if (!this._readyCount) this._readyCount = 0;
|
package/dist/shared/parseAst.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
@license
|
|
3
|
-
Rollup.js v4.
|
|
4
|
-
|
|
3
|
+
Rollup.js v4.10.0
|
|
4
|
+
Sat, 10 Feb 2024 05:58:12 GMT - commit 762420860765e8e46e24d48b38f5b98ca31735fa
|
|
5
5
|
|
|
6
6
|
https://github.com/rollup/rollup
|
|
7
7
|
|
|
@@ -1034,6 +1034,10 @@ const nodeConverters = [
|
|
|
1034
1034
|
const message = convertString(position, buffer, readString);
|
|
1035
1035
|
error(logParseError(message, pos));
|
|
1036
1036
|
},
|
|
1037
|
+
function panicError(position, buffer, readString) {
|
|
1038
|
+
const message = convertString(position, buffer, readString);
|
|
1039
|
+
error(logParseError(message));
|
|
1040
|
+
},
|
|
1037
1041
|
function arrayExpression(position, buffer, readString) {
|
|
1038
1042
|
const start = buffer[position++];
|
|
1039
1043
|
const end = buffer[position++];
|
package/dist/shared/rollup.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
@license
|
|
3
|
-
Rollup.js v4.
|
|
4
|
-
|
|
3
|
+
Rollup.js v4.10.0
|
|
4
|
+
Sat, 10 Feb 2024 05:58:12 GMT - commit 762420860765e8e46e24d48b38f5b98ca31735fa
|
|
5
5
|
|
|
6
6
|
https://github.com/rollup/rollup
|
|
7
7
|
|
|
@@ -31,7 +31,7 @@ function _interopNamespaceDefault(e) {
|
|
|
31
31
|
|
|
32
32
|
const tty__namespace = /*#__PURE__*/_interopNamespaceDefault(tty);
|
|
33
33
|
|
|
34
|
-
var version = "4.
|
|
34
|
+
var version = "4.10.0";
|
|
35
35
|
|
|
36
36
|
function ensureArray$1(items) {
|
|
37
37
|
if (Array.isArray(items)) {
|
|
@@ -51,21 +51,23 @@ var BuildPhase;
|
|
|
51
51
|
})(BuildPhase || (BuildPhase = {}));
|
|
52
52
|
|
|
53
53
|
let textEncoder;
|
|
54
|
-
|
|
55
|
-
|
|
54
|
+
const getHash64 = input => native_js.xxhashBase64Url(ensureBuffer(input));
|
|
55
|
+
const getHash36 = input => native_js.xxhashBase36(ensureBuffer(input));
|
|
56
|
+
const getHash16 = input => native_js.xxhashBase16(ensureBuffer(input));
|
|
57
|
+
const hasherByType = {
|
|
58
|
+
base36: getHash36,
|
|
59
|
+
base64: getHash64,
|
|
60
|
+
hex: getHash16
|
|
61
|
+
};
|
|
62
|
+
function ensureBuffer(input) {
|
|
56
63
|
if (typeof input === 'string') {
|
|
57
64
|
if (typeof Buffer === 'undefined') {
|
|
58
65
|
textEncoder ??= new TextEncoder();
|
|
59
|
-
|
|
60
|
-
}
|
|
61
|
-
else {
|
|
62
|
-
buffer = Buffer.from(input);
|
|
66
|
+
return textEncoder.encode(input);
|
|
63
67
|
}
|
|
68
|
+
return Buffer.from(input);
|
|
64
69
|
}
|
|
65
|
-
|
|
66
|
-
buffer = input;
|
|
67
|
-
}
|
|
68
|
-
return native_js.xxhashBase64Url(buffer);
|
|
70
|
+
return input;
|
|
69
71
|
}
|
|
70
72
|
|
|
71
73
|
function getOrCreate(map, key, init) {
|
|
@@ -102,13 +104,13 @@ const hashPlaceholderLeft = '!~{';
|
|
|
102
104
|
const hashPlaceholderRight = '}~';
|
|
103
105
|
const hashPlaceholderOverhead = hashPlaceholderLeft.length + hashPlaceholderRight.length;
|
|
104
106
|
// This is the size of a 128-bits xxhash with base64url encoding
|
|
105
|
-
const
|
|
106
|
-
const
|
|
107
|
+
const MAX_HASH_SIZE = 22;
|
|
108
|
+
const DEFAULT_HASH_SIZE = 8;
|
|
107
109
|
const getHashPlaceholderGenerator = () => {
|
|
108
110
|
let nextIndex = 0;
|
|
109
|
-
return (optionName, hashSize
|
|
110
|
-
if (hashSize >
|
|
111
|
-
return parseAst_js.error(parseAst_js.logFailedValidation(`Hashes cannot be longer than ${
|
|
111
|
+
return (optionName, hashSize) => {
|
|
112
|
+
if (hashSize > MAX_HASH_SIZE) {
|
|
113
|
+
return parseAst_js.error(parseAst_js.logFailedValidation(`Hashes cannot be longer than ${MAX_HASH_SIZE} characters, received ${hashSize}. Check the "${optionName}" option.`));
|
|
112
114
|
}
|
|
113
115
|
const placeholder = `${hashPlaceholderLeft}${toBase64(++nextIndex).padStart(hashSize - hashPlaceholderOverhead, '0')}${hashPlaceholderRight}`;
|
|
114
116
|
if (placeholder.length > hashSize) {
|
|
@@ -117,7 +119,7 @@ const getHashPlaceholderGenerator = () => {
|
|
|
117
119
|
return placeholder;
|
|
118
120
|
};
|
|
119
121
|
};
|
|
120
|
-
const REPLACER_REGEX = new RegExp(`${hashPlaceholderLeft}[0-9a-zA-Z_$]{1,${
|
|
122
|
+
const REPLACER_REGEX = new RegExp(`${hashPlaceholderLeft}[0-9a-zA-Z_$]{1,${MAX_HASH_SIZE - hashPlaceholderOverhead}}${hashPlaceholderRight}`, 'g');
|
|
121
123
|
const replacePlaceholders = (code, hashesByPlaceholder) => code.replace(REPLACER_REGEX, placeholder => hashesByPlaceholder.get(placeholder) || placeholder);
|
|
122
124
|
const replaceSinglePlaceholder = (code, placeholder, value) => code.replace(REPLACER_REGEX, match => (match === placeholder ? value : match));
|
|
123
125
|
const replacePlaceholdersWithDefaultAndGetContainedPlaceholders = (code, placeholders) => {
|
|
@@ -208,7 +210,7 @@ function generateAssetFileName(name, source, sourceHash, outputOptions, bundle)
|
|
|
208
210
|
: outputOptions.assetFileNames, 'output.assetFileNames', {
|
|
209
211
|
ext: () => node_path.extname(emittedName).slice(1),
|
|
210
212
|
extname: () => node_path.extname(emittedName),
|
|
211
|
-
hash: size => sourceHash.slice(0, Math.max(0, size ||
|
|
213
|
+
hash: size => sourceHash.slice(0, Math.max(0, size || DEFAULT_HASH_SIZE)),
|
|
212
214
|
name: () => emittedName.slice(0, Math.max(0, emittedName.length - node_path.extname(emittedName).length))
|
|
213
215
|
}), bundle);
|
|
214
216
|
}
|
|
@@ -317,9 +319,11 @@ class FileEmitter {
|
|
|
317
319
|
this.facadeChunkByModule = facadeChunkByModule;
|
|
318
320
|
};
|
|
319
321
|
this.setOutputBundle = (bundle, outputOptions) => {
|
|
322
|
+
const getHash = hasherByType[outputOptions.hashCharacters];
|
|
320
323
|
const output = (this.output = {
|
|
321
324
|
bundle,
|
|
322
325
|
fileNamesBySource: new Map(),
|
|
326
|
+
getHash,
|
|
323
327
|
outputOptions
|
|
324
328
|
});
|
|
325
329
|
for (const emittedFile of this.filesByReferenceId.values()) {
|
|
@@ -334,7 +338,7 @@ class FileEmitter {
|
|
|
334
338
|
this.finalizeAdditionalAsset(consumedFile, consumedFile.source, output);
|
|
335
339
|
}
|
|
336
340
|
else {
|
|
337
|
-
const sourceHash =
|
|
341
|
+
const sourceHash = getHash(consumedFile.source);
|
|
338
342
|
getOrCreate(consumedAssetsByHash, sourceHash, () => []).push(consumedFile);
|
|
339
343
|
}
|
|
340
344
|
}
|
|
@@ -357,7 +361,7 @@ class FileEmitter {
|
|
|
357
361
|
assignReferenceId(file, idBase) {
|
|
358
362
|
let referenceId = idBase;
|
|
359
363
|
do {
|
|
360
|
-
referenceId =
|
|
364
|
+
referenceId = getHash64(referenceId).slice(0, 8).replaceAll('-', '$');
|
|
361
365
|
} while (this.filesByReferenceId.has(referenceId) ||
|
|
362
366
|
this.outputFileEmitters.some(({ filesByReferenceId }) => filesByReferenceId.has(referenceId)));
|
|
363
367
|
file.referenceId = referenceId;
|
|
@@ -468,11 +472,11 @@ class FileEmitter {
|
|
|
468
472
|
}
|
|
469
473
|
return referenceId;
|
|
470
474
|
}
|
|
471
|
-
finalizeAdditionalAsset(consumedFile, source, { bundle, fileNamesBySource, outputOptions }) {
|
|
475
|
+
finalizeAdditionalAsset(consumedFile, source, { bundle, fileNamesBySource, getHash, outputOptions }) {
|
|
472
476
|
let { fileName, needsCodeReference, referenceId } = consumedFile;
|
|
473
477
|
// Deduplicate assets if an explicit fileName is not provided
|
|
474
478
|
if (!fileName) {
|
|
475
|
-
const sourceHash =
|
|
479
|
+
const sourceHash = getHash(source);
|
|
476
480
|
fileName = fileNamesBySource.get(sourceHash);
|
|
477
481
|
if (!fileName) {
|
|
478
482
|
fileName = generateAssetFileName(consumedFile.name, source, sourceHash, outputOptions, bundle);
|
|
@@ -1275,6 +1279,7 @@ async function mergeOutputOptions(config, overrides, log) {
|
|
|
1275
1279
|
freeze: getOption('freeze'),
|
|
1276
1280
|
generatedCode: getObjectOption(config, overrides, 'generatedCode', objectifyOptionWithPresets(generatedCodePresets, 'output.generatedCode', parseAst_js.URL_OUTPUT_GENERATEDCODE, '')),
|
|
1277
1281
|
globals: getOption('globals'),
|
|
1282
|
+
hashCharacters: getOption('hashCharacters'),
|
|
1278
1283
|
hoistTransitiveImports: getOption('hoistTransitiveImports'),
|
|
1279
1284
|
indent: getOption('indent'),
|
|
1280
1285
|
inlineDynamicImports: getOption('inlineDynamicImports'),
|
|
@@ -1745,6 +1750,16 @@ let Chunk$1 = class Chunk {
|
|
|
1745
1750
|
this.intro = content + this.intro;
|
|
1746
1751
|
}
|
|
1747
1752
|
|
|
1753
|
+
reset() {
|
|
1754
|
+
this.intro = '';
|
|
1755
|
+
this.outro = '';
|
|
1756
|
+
if (this.edited) {
|
|
1757
|
+
this.content = this.original;
|
|
1758
|
+
this.storeName = false;
|
|
1759
|
+
this.edited = false;
|
|
1760
|
+
}
|
|
1761
|
+
}
|
|
1762
|
+
|
|
1748
1763
|
split(index) {
|
|
1749
1764
|
const sliceIndex = index - this.start;
|
|
1750
1765
|
|
|
@@ -1835,8 +1850,8 @@ let Chunk$1 = class Chunk {
|
|
|
1835
1850
|
};
|
|
1836
1851
|
|
|
1837
1852
|
function getBtoa() {
|
|
1838
|
-
if (typeof
|
|
1839
|
-
return (str) =>
|
|
1853
|
+
if (typeof globalThis !== 'undefined' && typeof globalThis.btoa === 'function') {
|
|
1854
|
+
return (str) => globalThis.btoa(unescape(encodeURIComponent(str)));
|
|
1840
1855
|
} else if (typeof Buffer === 'function') {
|
|
1841
1856
|
return (str) => Buffer.from(str, 'utf-8').toString('base64');
|
|
1842
1857
|
} else {
|
|
@@ -2513,6 +2528,28 @@ class MagicString {
|
|
|
2513
2528
|
return this;
|
|
2514
2529
|
}
|
|
2515
2530
|
|
|
2531
|
+
reset(start, end) {
|
|
2532
|
+
while (start < 0) start += this.original.length;
|
|
2533
|
+
while (end < 0) end += this.original.length;
|
|
2534
|
+
|
|
2535
|
+
if (start === end) return this;
|
|
2536
|
+
|
|
2537
|
+
if (start < 0 || end > this.original.length) throw new Error('Character is out of bounds');
|
|
2538
|
+
if (start > end) throw new Error('end must be greater than start');
|
|
2539
|
+
|
|
2540
|
+
this._split(start);
|
|
2541
|
+
this._split(end);
|
|
2542
|
+
|
|
2543
|
+
let chunk = this.byStart[start];
|
|
2544
|
+
|
|
2545
|
+
while (chunk) {
|
|
2546
|
+
chunk.reset();
|
|
2547
|
+
|
|
2548
|
+
chunk = end > chunk.end ? this.byStart[chunk.end] : null;
|
|
2549
|
+
}
|
|
2550
|
+
return this;
|
|
2551
|
+
}
|
|
2552
|
+
|
|
2516
2553
|
lastChar() {
|
|
2517
2554
|
if (this.outro.length) return this.outro[this.outro.length - 1];
|
|
2518
2555
|
let chunk = this.lastChunk;
|
|
@@ -14202,7 +14239,7 @@ class Module {
|
|
|
14202
14239
|
this.ast.bind();
|
|
14203
14240
|
}
|
|
14204
14241
|
error(properties, pos) {
|
|
14205
|
-
this.addLocationToLogProps(properties, pos);
|
|
14242
|
+
pos !== undefined && this.addLocationToLogProps(properties, pos);
|
|
14206
14243
|
return parseAst_js.error(properties);
|
|
14207
14244
|
}
|
|
14208
14245
|
// sum up the length of all ast nodes that are included
|
|
@@ -16379,7 +16416,8 @@ class Chunk {
|
|
|
16379
16416
|
: [chunkFileNames, 'output.chunkFileNames'];
|
|
16380
16417
|
fileName = renderNamePattern(typeof pattern === 'function' ? pattern(this.getPreRenderedChunkInfo()) : pattern, patternName, {
|
|
16381
16418
|
format: () => format,
|
|
16382
|
-
hash: size => hashPlaceholder ||
|
|
16419
|
+
hash: size => hashPlaceholder ||
|
|
16420
|
+
(hashPlaceholder = this.getPlaceholder(patternName, size || DEFAULT_HASH_SIZE)),
|
|
16383
16421
|
name: () => this.getChunkName()
|
|
16384
16422
|
});
|
|
16385
16423
|
if (!hashPlaceholder) {
|
|
@@ -16407,7 +16445,8 @@ class Chunk {
|
|
|
16407
16445
|
sourcemapFileName = renderNamePattern(typeof pattern === 'function' ? pattern(this.getPreRenderedChunkInfo()) : pattern, patternName, {
|
|
16408
16446
|
chunkhash: () => this.getPreliminaryFileName().hashPlaceholder || '',
|
|
16409
16447
|
format: () => format,
|
|
16410
|
-
hash: size => hashPlaceholder ||
|
|
16448
|
+
hash: size => hashPlaceholder ||
|
|
16449
|
+
(hashPlaceholder = this.getPlaceholder(patternName, size || DEFAULT_HASH_SIZE)),
|
|
16411
16450
|
name: () => this.getChunkName()
|
|
16412
16451
|
});
|
|
16413
16452
|
if (!hashPlaceholder) {
|
|
@@ -18116,9 +18155,10 @@ async function renderChunks(chunks, bundle, pluginDriver, outputOptions, log) {
|
|
|
18116
18155
|
const renderedChunks = await Promise.all(chunks.map(chunk => chunk.render()));
|
|
18117
18156
|
timeEnd('render chunks', 2);
|
|
18118
18157
|
timeStart('transform chunks', 2);
|
|
18158
|
+
const getHash = hasherByType[outputOptions.hashCharacters];
|
|
18119
18159
|
const chunkGraph = getChunkGraph(chunks);
|
|
18120
|
-
const { initialHashesByPlaceholder, nonHashedChunksWithPlaceholders, renderedChunksByPlaceholder, hashDependenciesByPlaceholder } = await transformChunksAndGenerateContentHashes(renderedChunks, chunkGraph, outputOptions, pluginDriver, log);
|
|
18121
|
-
const hashesByPlaceholder = generateFinalHashes(renderedChunksByPlaceholder, hashDependenciesByPlaceholder, initialHashesByPlaceholder, bundle);
|
|
18160
|
+
const { initialHashesByPlaceholder, nonHashedChunksWithPlaceholders, renderedChunksByPlaceholder, hashDependenciesByPlaceholder } = await transformChunksAndGenerateContentHashes(renderedChunks, chunkGraph, outputOptions, pluginDriver, getHash, log);
|
|
18161
|
+
const hashesByPlaceholder = generateFinalHashes(renderedChunksByPlaceholder, hashDependenciesByPlaceholder, initialHashesByPlaceholder, bundle, getHash);
|
|
18122
18162
|
addChunksToBundle(renderedChunksByPlaceholder, hashesByPlaceholder, bundle, nonHashedChunksWithPlaceholders, pluginDriver, outputOptions);
|
|
18123
18163
|
timeEnd('transform chunks', 2);
|
|
18124
18164
|
}
|
|
@@ -18198,7 +18238,7 @@ async function transformChunk(magicString, fileName, usedModules, chunkGraph, op
|
|
|
18198
18238
|
map
|
|
18199
18239
|
};
|
|
18200
18240
|
}
|
|
18201
|
-
async function transformChunksAndGenerateContentHashes(renderedChunks, chunkGraph, outputOptions, pluginDriver, log) {
|
|
18241
|
+
async function transformChunksAndGenerateContentHashes(renderedChunks, chunkGraph, outputOptions, pluginDriver, getHash, log) {
|
|
18202
18242
|
const nonHashedChunksWithPlaceholders = [];
|
|
18203
18243
|
const renderedChunksByPlaceholder = new Map();
|
|
18204
18244
|
const hashDependenciesByPlaceholder = new Map();
|
|
@@ -18233,7 +18273,7 @@ async function transformChunksAndGenerateContentHashes(renderedChunks, chunkGrap
|
|
|
18233
18273
|
renderedChunksByPlaceholder.set(hashPlaceholder, transformedChunk);
|
|
18234
18274
|
hashDependenciesByPlaceholder.set(hashPlaceholder, {
|
|
18235
18275
|
containedPlaceholders,
|
|
18236
|
-
contentHash:
|
|
18276
|
+
contentHash: getHash(contentToHash)
|
|
18237
18277
|
});
|
|
18238
18278
|
}
|
|
18239
18279
|
else {
|
|
@@ -18241,7 +18281,7 @@ async function transformChunksAndGenerateContentHashes(renderedChunks, chunkGrap
|
|
|
18241
18281
|
}
|
|
18242
18282
|
const sourcemapHashPlaceholder = preliminarySourcemapFileName?.hashPlaceholder;
|
|
18243
18283
|
if (map && sourcemapHashPlaceholder) {
|
|
18244
|
-
initialHashesByPlaceholder.set(preliminarySourcemapFileName.hashPlaceholder,
|
|
18284
|
+
initialHashesByPlaceholder.set(preliminarySourcemapFileName.hashPlaceholder, getHash(map.toString()).slice(0, preliminarySourcemapFileName.hashPlaceholder.length));
|
|
18245
18285
|
}
|
|
18246
18286
|
}));
|
|
18247
18287
|
return {
|
|
@@ -18251,7 +18291,7 @@ async function transformChunksAndGenerateContentHashes(renderedChunks, chunkGrap
|
|
|
18251
18291
|
renderedChunksByPlaceholder
|
|
18252
18292
|
};
|
|
18253
18293
|
}
|
|
18254
|
-
function generateFinalHashes(renderedChunksByPlaceholder, hashDependenciesByPlaceholder, initialHashesByPlaceholder, bundle) {
|
|
18294
|
+
function generateFinalHashes(renderedChunksByPlaceholder, hashDependenciesByPlaceholder, initialHashesByPlaceholder, bundle, getHash) {
|
|
18255
18295
|
const hashesByPlaceholder = new Map(initialHashesByPlaceholder);
|
|
18256
18296
|
for (const [placeholder, { fileName }] of renderedChunksByPlaceholder) {
|
|
18257
18297
|
let contentToHash = '';
|
|
@@ -18271,7 +18311,7 @@ function generateFinalHashes(renderedChunksByPlaceholder, hashDependenciesByPlac
|
|
|
18271
18311
|
if (finalHash) {
|
|
18272
18312
|
contentToHash = finalHash;
|
|
18273
18313
|
}
|
|
18274
|
-
finalHash =
|
|
18314
|
+
finalHash = getHash(contentToHash).slice(0, placeholder.length);
|
|
18275
18315
|
finalFileName = replaceSinglePlaceholder(fileName, placeholder, finalHash);
|
|
18276
18316
|
} while (bundle[lowercaseBundleKeys].has(finalFileName.toLowerCase()));
|
|
18277
18317
|
bundle[finalFileName] = FILE_PLACEHOLDER;
|
|
@@ -19636,6 +19676,7 @@ async function normalizeOutputOptions(config, inputOptions, unsetInputOptions) {
|
|
|
19636
19676
|
freeze: config.freeze ?? true,
|
|
19637
19677
|
generatedCode,
|
|
19638
19678
|
globals: config.globals || {},
|
|
19679
|
+
hashCharacters: config.hashCharacters ?? 'base64',
|
|
19639
19680
|
hoistTransitiveImports: config.hoistTransitiveImports ?? true,
|
|
19640
19681
|
indent: getIndent(config, compact),
|
|
19641
19682
|
inlineDynamicImports,
|
package/dist/shared/watch-cli.js
CHANGED
package/dist/shared/watch.js
CHANGED
|
@@ -99,6 +99,7 @@ function passStringToWasm0(arg, malloc, realloc) {
|
|
|
99
99
|
const ret = encodeString(arg, view);
|
|
100
100
|
|
|
101
101
|
offset += ret.written;
|
|
102
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
102
103
|
}
|
|
103
104
|
|
|
104
105
|
WASM_VECTOR_LEN = offset;
|
|
@@ -160,6 +161,48 @@ module.exports.xxhashBase64Url = function(input) {
|
|
|
160
161
|
}
|
|
161
162
|
};
|
|
162
163
|
|
|
164
|
+
/**
|
|
165
|
+
* @param {Uint8Array} input
|
|
166
|
+
* @returns {string}
|
|
167
|
+
*/
|
|
168
|
+
module.exports.xxhashBase36 = function(input) {
|
|
169
|
+
let deferred1_0;
|
|
170
|
+
let deferred1_1;
|
|
171
|
+
try {
|
|
172
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
173
|
+
wasm.xxhashBase36(retptr, addHeapObject(input));
|
|
174
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
175
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
176
|
+
deferred1_0 = r0;
|
|
177
|
+
deferred1_1 = r1;
|
|
178
|
+
return getStringFromWasm0(r0, r1);
|
|
179
|
+
} finally {
|
|
180
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
181
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
182
|
+
}
|
|
183
|
+
};
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* @param {Uint8Array} input
|
|
187
|
+
* @returns {string}
|
|
188
|
+
*/
|
|
189
|
+
module.exports.xxhashBase16 = function(input) {
|
|
190
|
+
let deferred1_0;
|
|
191
|
+
let deferred1_1;
|
|
192
|
+
try {
|
|
193
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
194
|
+
wasm.xxhashBase16(retptr, addHeapObject(input));
|
|
195
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
196
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
197
|
+
deferred1_0 = r0;
|
|
198
|
+
deferred1_1 = r1;
|
|
199
|
+
return getStringFromWasm0(r0, r1);
|
|
200
|
+
} finally {
|
|
201
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
202
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
203
|
+
}
|
|
204
|
+
};
|
|
205
|
+
|
|
163
206
|
function handleError(f, args) {
|
|
164
207
|
try {
|
|
165
208
|
return f.apply(this, args);
|
|
@@ -231,12 +274,12 @@ module.exports.__wbg_getRandomValues_7e42b4fb8779dc6d = function() { return hand
|
|
|
231
274
|
getObject(arg0).getRandomValues(getObject(arg1));
|
|
232
275
|
}, arguments) };
|
|
233
276
|
|
|
234
|
-
module.exports.
|
|
277
|
+
module.exports.__wbg_newnoargs_cfecb3965268594c = function(arg0, arg1) {
|
|
235
278
|
const ret = new Function(getStringFromWasm0(arg0, arg1));
|
|
236
279
|
return addHeapObject(ret);
|
|
237
280
|
};
|
|
238
281
|
|
|
239
|
-
module.exports.
|
|
282
|
+
module.exports.__wbg_call_3f093dd26d5569f8 = function() { return handleError(function (arg0, arg1) {
|
|
240
283
|
const ret = getObject(arg0).call(getObject(arg1));
|
|
241
284
|
return addHeapObject(ret);
|
|
242
285
|
}, arguments) };
|
|
@@ -246,22 +289,22 @@ module.exports.__wbindgen_object_clone_ref = function(arg0) {
|
|
|
246
289
|
return addHeapObject(ret);
|
|
247
290
|
};
|
|
248
291
|
|
|
249
|
-
module.exports.
|
|
292
|
+
module.exports.__wbg_self_05040bd9523805b9 = function() { return handleError(function () {
|
|
250
293
|
const ret = self.self;
|
|
251
294
|
return addHeapObject(ret);
|
|
252
295
|
}, arguments) };
|
|
253
296
|
|
|
254
|
-
module.exports.
|
|
297
|
+
module.exports.__wbg_window_adc720039f2cb14f = function() { return handleError(function () {
|
|
255
298
|
const ret = window.window;
|
|
256
299
|
return addHeapObject(ret);
|
|
257
300
|
}, arguments) };
|
|
258
301
|
|
|
259
|
-
module.exports.
|
|
302
|
+
module.exports.__wbg_globalThis_622105db80c1457d = function() { return handleError(function () {
|
|
260
303
|
const ret = globalThis.globalThis;
|
|
261
304
|
return addHeapObject(ret);
|
|
262
305
|
}, arguments) };
|
|
263
306
|
|
|
264
|
-
module.exports.
|
|
307
|
+
module.exports.__wbg_global_f56b013ed9bcf359 = function() { return handleError(function () {
|
|
265
308
|
const ret = global.global;
|
|
266
309
|
return addHeapObject(ret);
|
|
267
310
|
}, arguments) };
|
|
@@ -271,41 +314,41 @@ module.exports.__wbindgen_is_undefined = function(arg0) {
|
|
|
271
314
|
return ret;
|
|
272
315
|
};
|
|
273
316
|
|
|
274
|
-
module.exports.
|
|
317
|
+
module.exports.__wbg_call_67f2111acd2dfdb6 = function() { return handleError(function (arg0, arg1, arg2) {
|
|
275
318
|
const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
|
|
276
319
|
return addHeapObject(ret);
|
|
277
320
|
}, arguments) };
|
|
278
321
|
|
|
279
|
-
module.exports.
|
|
322
|
+
module.exports.__wbg_buffer_b914fb8b50ebbc3e = function(arg0) {
|
|
280
323
|
const ret = getObject(arg0).buffer;
|
|
281
324
|
return addHeapObject(ret);
|
|
282
325
|
};
|
|
283
326
|
|
|
284
|
-
module.exports.
|
|
327
|
+
module.exports.__wbg_newwithbyteoffsetandlength_0de9ee56e9f6ee6e = function(arg0, arg1, arg2) {
|
|
285
328
|
const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
|
|
286
329
|
return addHeapObject(ret);
|
|
287
330
|
};
|
|
288
331
|
|
|
289
|
-
module.exports.
|
|
332
|
+
module.exports.__wbg_new_b1f2d6842d615181 = function(arg0) {
|
|
290
333
|
const ret = new Uint8Array(getObject(arg0));
|
|
291
334
|
return addHeapObject(ret);
|
|
292
335
|
};
|
|
293
336
|
|
|
294
|
-
module.exports.
|
|
337
|
+
module.exports.__wbg_set_7d988c98e6ced92d = function(arg0, arg1, arg2) {
|
|
295
338
|
getObject(arg0).set(getObject(arg1), arg2 >>> 0);
|
|
296
339
|
};
|
|
297
340
|
|
|
298
|
-
module.exports.
|
|
341
|
+
module.exports.__wbg_length_21c4b0ae73cba59d = function(arg0) {
|
|
299
342
|
const ret = getObject(arg0).length;
|
|
300
343
|
return ret;
|
|
301
344
|
};
|
|
302
345
|
|
|
303
|
-
module.exports.
|
|
346
|
+
module.exports.__wbg_newwithlength_0d03cef43b68a530 = function(arg0) {
|
|
304
347
|
const ret = new Uint8Array(arg0 >>> 0);
|
|
305
348
|
return addHeapObject(ret);
|
|
306
349
|
};
|
|
307
350
|
|
|
308
|
-
module.exports.
|
|
351
|
+
module.exports.__wbg_subarray_adc418253d76e2f1 = function(arg0, arg1, arg2) {
|
|
309
352
|
const ret = getObject(arg0).subarray(arg1 >>> 0, arg2 >>> 0);
|
|
310
353
|
return addHeapObject(ret);
|
|
311
354
|
};
|
|
Binary file
|