rollup 4.25.0 → 4.27.0-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/LICENSE.md +21 -1
- package/dist/bin/rollup +126 -43
- 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 +842 -508
- package/dist/es/shared/parseAst.js +3 -3
- package/dist/es/shared/watch.js +3 -3
- package/dist/getLogFilter.js +2 -2
- package/dist/loadConfigFile.js +2 -2
- package/dist/parseAst.js +2 -2
- package/dist/rollup.d.ts +1 -0
- package/dist/rollup.js +2 -2
- package/dist/shared/fsevents-importer.js +2 -2
- package/dist/shared/index.js +3 -3
- package/dist/shared/loadConfigFile.js +2 -2
- package/dist/shared/parseAst.js +2 -2
- package/dist/shared/rollup.js +839 -545
- package/dist/shared/watch-cli.js +4 -20
- package/dist/shared/watch.js +3 -3
- package/package.json +19 -19
package/LICENSE.md
CHANGED
|
@@ -13,7 +13,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
|
|
13
13
|
|
|
14
14
|
# Licenses of bundled dependencies
|
|
15
15
|
The published Rollup artifact additionally contains code with the following licenses:
|
|
16
|
-
MIT, ISC
|
|
16
|
+
MIT, ISC, 0BSD
|
|
17
17
|
|
|
18
18
|
# Bundled dependencies:
|
|
19
19
|
## @jridgewell/sourcemap-codec
|
|
@@ -632,6 +632,26 @@ Repository: micromatch/to-regex-range
|
|
|
632
632
|
|
|
633
633
|
---------------------------------------
|
|
634
634
|
|
|
635
|
+
## tslib
|
|
636
|
+
License: 0BSD
|
|
637
|
+
By: Microsoft Corp.
|
|
638
|
+
Repository: https://github.com/Microsoft/tslib.git
|
|
639
|
+
|
|
640
|
+
> Copyright (c) Microsoft Corporation.
|
|
641
|
+
>
|
|
642
|
+
> Permission to use, copy, modify, and/or distribute this software for any
|
|
643
|
+
> purpose with or without fee is hereby granted.
|
|
644
|
+
>
|
|
645
|
+
> THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
646
|
+
> REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
647
|
+
> AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
648
|
+
> INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
649
|
+
> LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
650
|
+
> OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
651
|
+
> PERFORMANCE OF THIS SOFTWARE.
|
|
652
|
+
|
|
653
|
+
---------------------------------------
|
|
654
|
+
|
|
635
655
|
## yargs-parser
|
|
636
656
|
License: ISC
|
|
637
657
|
By: Ben Coe
|
package/dist/bin/rollup
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/*
|
|
3
3
|
@license
|
|
4
|
-
Rollup.js v4.
|
|
5
|
-
|
|
4
|
+
Rollup.js v4.27.0-0
|
|
5
|
+
Wed, 13 Nov 2024 07:02:42 GMT - commit 5e6074f07843bcbcf26b916c557fdfd81d2adece
|
|
6
6
|
|
|
7
7
|
https://github.com/rollup/rollup
|
|
8
8
|
|
|
@@ -15,8 +15,8 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
15
15
|
const process$1 = require('node:process');
|
|
16
16
|
const rollup = require('../shared/rollup.js');
|
|
17
17
|
const require$$2 = require('util');
|
|
18
|
-
const require$$0 = require('path');
|
|
19
|
-
const require$$0
|
|
18
|
+
const require$$0$1 = require('path');
|
|
19
|
+
const require$$0 = require('fs');
|
|
20
20
|
const parseAst_js = require('../shared/parseAst.js');
|
|
21
21
|
const fseventsImporter = require('../shared/fsevents-importer.js');
|
|
22
22
|
const promises = require('node:fs/promises');
|
|
@@ -1219,8 +1219,8 @@ const parser = new YargsParser({
|
|
|
1219
1219
|
return env;
|
|
1220
1220
|
},
|
|
1221
1221
|
format: require$$2.format,
|
|
1222
|
-
normalize: require$$0.normalize,
|
|
1223
|
-
resolve: require$$0.resolve,
|
|
1222
|
+
normalize: require$$0$1.normalize,
|
|
1223
|
+
resolve: require$$0$1.resolve,
|
|
1224
1224
|
// TODO: figure out a way to combine ESM and CJS coverage, such that
|
|
1225
1225
|
// we can exercise all the lines below:
|
|
1226
1226
|
require: (path) => {
|
|
@@ -1229,7 +1229,7 @@ const parser = new YargsParser({
|
|
|
1229
1229
|
}
|
|
1230
1230
|
else if (path.match(/\.json$/)) {
|
|
1231
1231
|
// Addresses: https://github.com/yargs/yargs/issues/2040
|
|
1232
|
-
return JSON.parse(require$$0
|
|
1232
|
+
return JSON.parse(require$$0.readFileSync(path, 'utf8'));
|
|
1233
1233
|
}
|
|
1234
1234
|
else {
|
|
1235
1235
|
throw Error('only .json config files are supported in ESM');
|
|
@@ -1247,6 +1247,78 @@ yargsParser.camelCase = camelCase;
|
|
|
1247
1247
|
yargsParser.decamelize = decamelize;
|
|
1248
1248
|
yargsParser.looksLikeNumber = looksLikeNumber;
|
|
1249
1249
|
|
|
1250
|
+
/******************************************************************************
|
|
1251
|
+
Copyright (c) Microsoft Corporation.
|
|
1252
|
+
|
|
1253
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
1254
|
+
purpose with or without fee is hereby granted.
|
|
1255
|
+
|
|
1256
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
1257
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
1258
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
1259
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
1260
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
1261
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
1262
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
1263
|
+
***************************************************************************** */
|
|
1264
|
+
/* global Reflect, Promise, SuppressedError, Symbol, Iterator */
|
|
1265
|
+
|
|
1266
|
+
|
|
1267
|
+
function __addDisposableResource(env, value, async) {
|
|
1268
|
+
if (value !== null && value !== void 0) {
|
|
1269
|
+
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
|
1270
|
+
var dispose, inner;
|
|
1271
|
+
if (async) {
|
|
1272
|
+
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
|
1273
|
+
dispose = value[Symbol.asyncDispose];
|
|
1274
|
+
}
|
|
1275
|
+
if (dispose === void 0) {
|
|
1276
|
+
if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
|
|
1277
|
+
dispose = value[Symbol.dispose];
|
|
1278
|
+
if (async) inner = dispose;
|
|
1279
|
+
}
|
|
1280
|
+
if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
|
|
1281
|
+
if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };
|
|
1282
|
+
env.stack.push({ value: value, dispose: dispose, async: async });
|
|
1283
|
+
}
|
|
1284
|
+
else if (async) {
|
|
1285
|
+
env.stack.push({ async: true });
|
|
1286
|
+
}
|
|
1287
|
+
return value;
|
|
1288
|
+
|
|
1289
|
+
}
|
|
1290
|
+
|
|
1291
|
+
var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
1292
|
+
var e = new Error(message);
|
|
1293
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
1294
|
+
};
|
|
1295
|
+
|
|
1296
|
+
function __disposeResources(env) {
|
|
1297
|
+
function fail(e) {
|
|
1298
|
+
env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
|
|
1299
|
+
env.hasError = true;
|
|
1300
|
+
}
|
|
1301
|
+
var r, s = 0;
|
|
1302
|
+
function next() {
|
|
1303
|
+
while (r = env.stack.pop()) {
|
|
1304
|
+
try {
|
|
1305
|
+
if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);
|
|
1306
|
+
if (r.dispose) {
|
|
1307
|
+
var result = r.dispose.call(r.value);
|
|
1308
|
+
if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });
|
|
1309
|
+
}
|
|
1310
|
+
else s |= 1;
|
|
1311
|
+
}
|
|
1312
|
+
catch (e) {
|
|
1313
|
+
fail(e);
|
|
1314
|
+
}
|
|
1315
|
+
}
|
|
1316
|
+
if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();
|
|
1317
|
+
if (env.hasError) throw env.error;
|
|
1318
|
+
}
|
|
1319
|
+
return next();
|
|
1320
|
+
}
|
|
1321
|
+
|
|
1250
1322
|
const toZeroIfInfinity = value => Number.isFinite(value) ? value : 0;
|
|
1251
1323
|
|
|
1252
1324
|
function parseNumber(milliseconds) {
|
|
@@ -1561,48 +1633,59 @@ function printTimings(timings) {
|
|
|
1561
1633
|
}
|
|
1562
1634
|
|
|
1563
1635
|
async function build(inputOptions, warnings, silent = false) {
|
|
1564
|
-
const
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
if (
|
|
1571
|
-
inputFiles
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
if (useStdout) {
|
|
1583
|
-
const output = outputOptions[0];
|
|
1584
|
-
if (output.sourcemap && output.sourcemap !== 'inline') {
|
|
1585
|
-
rollup.handleError(parseAst_js.logOnlyInlineSourcemapsForStdout());
|
|
1636
|
+
const env_1 = { stack: [], error: void 0, hasError: false };
|
|
1637
|
+
try {
|
|
1638
|
+
const outputOptions = inputOptions.output;
|
|
1639
|
+
const useStdout = !outputOptions[0].file && !outputOptions[0].dir;
|
|
1640
|
+
const start = Date.now();
|
|
1641
|
+
const files = useStdout ? ['stdout'] : outputOptions.map(t => parseAst_js.relativeId(t.file || t.dir));
|
|
1642
|
+
if (!silent) {
|
|
1643
|
+
let inputFiles;
|
|
1644
|
+
if (typeof inputOptions.input === 'string') {
|
|
1645
|
+
inputFiles = inputOptions.input;
|
|
1646
|
+
}
|
|
1647
|
+
else if (Array.isArray(inputOptions.input)) {
|
|
1648
|
+
inputFiles = inputOptions.input.join(', ');
|
|
1649
|
+
}
|
|
1650
|
+
else if (typeof inputOptions.input === 'object' && inputOptions.input !== null) {
|
|
1651
|
+
inputFiles = Object.values(inputOptions.input).join(', ');
|
|
1652
|
+
}
|
|
1653
|
+
rollup.stderr(rollup.cyan$1(`\n${rollup.bold(inputFiles)} → ${rollup.bold(files.join(', '))}...`));
|
|
1586
1654
|
}
|
|
1587
|
-
const
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1655
|
+
const bundle = __addDisposableResource(env_1, await rollup.rollup(inputOptions), true);
|
|
1656
|
+
if (useStdout) {
|
|
1657
|
+
const output = outputOptions[0];
|
|
1658
|
+
if (output.sourcemap && output.sourcemap !== 'inline') {
|
|
1659
|
+
rollup.handleError(parseAst_js.logOnlyInlineSourcemapsForStdout());
|
|
1660
|
+
}
|
|
1661
|
+
const { output: outputs } = await bundle.generate(output);
|
|
1662
|
+
for (const file of outputs) {
|
|
1663
|
+
if (outputs.length > 1)
|
|
1664
|
+
process$1.stdout.write(`\n${rollup.cyan$1(rollup.bold(`//→ ${file.fileName}:`))}\n`);
|
|
1665
|
+
process$1.stdout.write(file.type === 'asset' ? file.source : file.code);
|
|
1666
|
+
}
|
|
1667
|
+
if (!silent) {
|
|
1668
|
+
warnings.flush();
|
|
1669
|
+
}
|
|
1670
|
+
return;
|
|
1592
1671
|
}
|
|
1672
|
+
await Promise.all(outputOptions.map(bundle.write));
|
|
1593
1673
|
if (!silent) {
|
|
1594
1674
|
warnings.flush();
|
|
1675
|
+
rollup.stderr(rollup.green(`created ${rollup.bold(files.join(', '))} in ${rollup.bold(prettyMilliseconds(Date.now() - start))}`));
|
|
1676
|
+
if (bundle && bundle.getTimings) {
|
|
1677
|
+
printTimings(bundle.getTimings());
|
|
1678
|
+
}
|
|
1595
1679
|
}
|
|
1596
|
-
return;
|
|
1597
1680
|
}
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1681
|
+
catch (e_1) {
|
|
1682
|
+
env_1.error = e_1;
|
|
1683
|
+
env_1.hasError = true;
|
|
1684
|
+
}
|
|
1685
|
+
finally {
|
|
1686
|
+
const result_1 = __disposeResources(env_1);
|
|
1687
|
+
if (result_1)
|
|
1688
|
+
await result_1;
|
|
1606
1689
|
}
|
|
1607
1690
|
}
|
|
1608
1691
|
|
package/dist/es/getLogFilter.js
CHANGED
package/dist/es/parseAst.js
CHANGED
package/dist/es/rollup.js
CHANGED