rollup 4.25.0-0 → 4.26.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 +127 -44
- 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 +777 -877
- package/dist/es/shared/parseAst.js +9 -8
- 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 +4 -1
- 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 +8 -6
- package/dist/shared/rollup.js +774 -874
- package/dist/shared/watch-cli.js +3 -3
- package/dist/shared/watch.js +3 -3
- package/package.json +42 -42
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.26.0
|
|
5
|
+
Wed, 13 Nov 2024 06:44:29 GMT - commit ae1d14b7855ff6568a6697d37271a5eb4d8e2d3e
|
|
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
|
|
19
|
-
const require$$0 = require('fs');
|
|
18
|
+
const require$$0 = require('path');
|
|
19
|
+
const require$$0$1 = 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');
|
|
@@ -28,7 +28,7 @@ require('node:perf_hooks');
|
|
|
28
28
|
require('node:url');
|
|
29
29
|
require('../getLogFilter.js');
|
|
30
30
|
|
|
31
|
-
const help = "rollup version __VERSION__\n=====================================\n\nUsage: rollup [options] <entry file>\n\nBasic options:\n\n-c, --config <filename> Use this config file (if argument is used but value\n is unspecified, defaults to rollup.config.js)\n-d, --dir <dirname> Directory for chunks (if absent, prints to stdout)\n-e, --external <ids> Comma-separate list of module IDs to exclude\n-f, --format <format> Type of output (amd, cjs, es, iife, umd, system)\n-g, --globals <pairs> Comma-separate list of `moduleID:Global` pairs\n-h, --help Show this help message\n-i, --input <filename> Input (alternative to <entry file>)\n-m, --sourcemap Generate sourcemap (`-m inline` for inline map)\n-n, --name <name> Name for UMD export\n-o, --file <output> Single output file (if absent, prints to stdout)\n-p, --plugin <plugin> Use the plugin specified (may be repeated)\n-v, --version Show version number\n-w, --watch Watch files in bundle and rebuild on changes\n--amd.autoId Generate the AMD ID based off the chunk name\n--amd.basePath <prefix> Path to prepend to auto generated AMD ID\n--amd.define <name> Function to use in place of `define`\n--amd.forceJsExtensionForImports Use `.js` extension in AMD imports\n--amd.id <id> ID for AMD module (default is anonymous)\n--assetFileNames <pattern> Name pattern for emitted assets\n--banner <text> Code to insert at top of bundle (outside wrapper)\n--chunkFileNames <pattern> Name pattern for emitted secondary chunks\n--compact Minify wrapper code\n--context <variable> Specify top-level `this` value\n--no-dynamicImportInCjs Write external dynamic CommonJS imports as require\n--entryFileNames <pattern> Name pattern for emitted entry chunks\n--environment <values> Settings passed to config file (see example)\n--no-esModule Do not add __esModule property\n--exports <mode> Specify export mode (auto, default, named, none)\n--extend Extend global variable defined by --name\n--no-externalImportAttributes Omit import attributes in \"es\" output\n--no-externalLiveBindings Do not generate code to support live bindings\n--failAfterWarnings Exit with an error if the build produced warnings\n--filterLogs <filter> Filter log messages\n--footer <text> Code to insert at end of bundle (outside wrapper)\n--forceExit Force exit the process when done\n--no-freeze Do not freeze namespace objects\n--generatedCode <preset> Which code features to use (es5/es2015)\n--generatedCode.arrowFunctions Use arrow functions in generated code\n--generatedCode.constBindings Use \"const\" in generated code\n--generatedCode.objectShorthand Use shorthand properties in generated code\n--no-generatedCode.reservedNamesAsProps Always quote reserved names as props\n--generatedCode.symbols Use symbols in generated code\n--hashCharacters <name> Use the specified character set for file hashes\n--no-hoistTransitiveImports Do not hoist transitive imports into entry chunks\n--importAttributesKey <name> Use the specified keyword for import attributes\n--no-indent Don't indent result\n--inlineDynamicImports Create single bundle when using dynamic imports\n--no-interop Do not include interop block\n--intro <text> Code to insert at top of bundle (inside wrapper)\n--logLevel <level> Which kind of logs to display\n--no-makeAbsoluteExternalsRelative Prevent normalization of external imports\n--maxParallelFileOps <value> How many files to read in parallel\n--minifyInternalExports Force or disable minification of internal exports\n--noConflict Generate a noConflict method for UMD globals\n--outro <text> Code to insert at end of bundle (inside wrapper)\n--perf Display performance timings\n--no-preserveEntrySignatures Avoid facade chunks for entry points\n--preserveModules Preserve module structure\n--preserveModulesRoot Put preserved modules under this path at root level\n--preserveSymlinks Do not follow symlinks when resolving files\n--no-reexportProtoFromExternal Ignore `__proto__` in star re-exports\n--no-sanitizeFileName Do not replace invalid characters in file names\n--shimMissingExports Create shim variables for missing exports\n--silent Don't print warnings\n--sourcemapBaseUrl <url> Emit absolute sourcemap URLs with given base\n--sourcemapExcludeSources Do not include source code in source maps\n--sourcemapFile <file> Specify bundle position for source maps\n--sourcemapFileNames <pattern> Name pattern for emitted sourcemaps\n--stdin=ext Specify file extension used for stdin input\n--no-stdin Do not read \"-\" from stdin\n--no-strict Don't emit `\"use strict\";` in the generated modules\n--strictDeprecations Throw errors for deprecated features\n--no-systemNullSetters Do not replace empty SystemJS setters with `null`\n--no-treeshake Disable tree-shaking optimisations\n--no-treeshake.annotations Ignore pure call annotations\n--treeshake.correctVarValueBeforeDeclaration Deoptimize variables until declared\n--treeshake.manualPureFunctions <names> Manually declare functions as pure\n--no-treeshake.moduleSideEffects Assume modules have no side effects\n--no-treeshake.propertyReadSideEffects Ignore property access side effects\n--no-treeshake.tryCatchDeoptimization Do not turn off try-catch-tree-shaking\n--no-treeshake.unknownGlobalSideEffects Assume unknown globals do not throw\n--validate Validate output\n--waitForBundleInput Wait for bundle input files\n--watch.buildDelay <number> Throttle watch rebuilds\n--no-watch.clearScreen Do not clear the screen when rebuilding\n--watch.exclude <files> Exclude files from being watched\n--watch.include <files> Limit watching to specified files\n--watch.onBundleEnd <cmd> Shell command to run on `\"BUNDLE_END\"` event\n--watch.onBundleStart <cmd> Shell command to run on `\"BUNDLE_START\"` event\n--watch.onEnd <cmd> Shell command to run on `\"END\"` event\n--watch.onError <cmd> Shell command to run on `\"ERROR\"` event\n--watch.onStart <cmd> Shell command to run on `\"START\"` event\n--watch.skipWrite Do not write files to disk when watching\n\nExamples:\n\n# use settings in config file\nrollup -c\n\n# in config file, process.env.INCLUDE_DEPS === 'true'\n# and process.env.BUILD === 'production'\nrollup -c --environment INCLUDE_DEPS,BUILD:production\n\n# create CommonJS bundle.js from src/main.js\nrollup --format=cjs --file=bundle.js -- src/main.js\n\n# create self-executing IIFE using `window.jQuery`\n# and `window._` as external globals\nrollup -f iife --globals jquery:jQuery,lodash:_ \\\n -i src/app.js -o build/app.js -m build/app.js.map\n\nNotes:\n\n* When piping to stdout, only inline sourcemaps are permitted\n\nFor more information visit https://rollupjs.org\n";
|
|
31
|
+
const help = "rollup version __VERSION__\n=====================================\n\nUsage: rollup [options] <entry file>\n\nBasic options:\n\n-c, --config <filename> Use this config file (if argument is used but value\n is unspecified, defaults to rollup.config.js)\n-d, --dir <dirname> Directory for chunks (if absent, prints to stdout)\n-e, --external <ids> Comma-separate list of module IDs to exclude\n-f, --format <format> Type of output (amd, cjs, es, iife, umd, system)\n-g, --globals <pairs> Comma-separate list of `moduleID:Global` pairs\n-h, --help Show this help message\n-i, --input <filename> Input (alternative to <entry file>)\n-m, --sourcemap Generate sourcemap (`-m inline` for inline map)\n-n, --name <name> Name for UMD export\n-o, --file <output> Single output file (if absent, prints to stdout)\n-p, --plugin <plugin> Use the plugin specified (may be repeated)\n-v, --version Show version number\n-w, --watch Watch files in bundle and rebuild on changes\n--amd.autoId Generate the AMD ID based off the chunk name\n--amd.basePath <prefix> Path to prepend to auto generated AMD ID\n--amd.define <name> Function to use in place of `define`\n--amd.forceJsExtensionForImports Use `.js` extension in AMD imports\n--amd.id <id> ID for AMD module (default is anonymous)\n--assetFileNames <pattern> Name pattern for emitted assets\n--banner <text> Code to insert at top of bundle (outside wrapper)\n--chunkFileNames <pattern> Name pattern for emitted secondary chunks\n--compact Minify wrapper code\n--context <variable> Specify top-level `this` value\n--no-dynamicImportInCjs Write external dynamic CommonJS imports as require\n--entryFileNames <pattern> Name pattern for emitted entry chunks\n--environment <values> Settings passed to config file (see example)\n--no-esModule Do not add __esModule property\n--exports <mode> Specify export mode (auto, default, named, none)\n--extend Extend global variable defined by --name\n--no-externalImportAttributes Omit import attributes in \"es\" output\n--no-externalLiveBindings Do not generate code to support live bindings\n--failAfterWarnings Exit with an error if the build produced warnings\n--filterLogs <filter> Filter log messages\n--footer <text> Code to insert at end of bundle (outside wrapper)\n--forceExit Force exit the process when done\n--no-freeze Do not freeze namespace objects\n--generatedCode <preset> Which code features to use (es5/es2015)\n--generatedCode.arrowFunctions Use arrow functions in generated code\n--generatedCode.constBindings Use \"const\" in generated code\n--generatedCode.objectShorthand Use shorthand properties in generated code\n--no-generatedCode.reservedNamesAsProps Always quote reserved names as props\n--generatedCode.symbols Use symbols in generated code\n--hashCharacters <name> Use the specified character set for file hashes\n--no-hoistTransitiveImports Do not hoist transitive imports into entry chunks\n--importAttributesKey <name> Use the specified keyword for import attributes\n--no-indent Don't indent result\n--inlineDynamicImports Create single bundle when using dynamic imports\n--no-interop Do not include interop block\n--intro <text> Code to insert at top of bundle (inside wrapper)\n--logLevel <level> Which kind of logs to display\n--no-makeAbsoluteExternalsRelative Prevent normalization of external imports\n--maxParallelFileOps <value> How many files to read in parallel\n--minifyInternalExports Force or disable minification of internal exports\n--noConflict Generate a noConflict method for UMD globals\n--outro <text> Code to insert at end of bundle (inside wrapper)\n--perf Display performance timings\n--no-preserveEntrySignatures Avoid facade chunks for entry points\n--preserveModules Preserve module structure\n--preserveModulesRoot Put preserved modules under this path at root level\n--preserveSymlinks Do not follow symlinks when resolving files\n--no-reexportProtoFromExternal Ignore `__proto__` in star re-exports\n--no-sanitizeFileName Do not replace invalid characters in file names\n--shimMissingExports Create shim variables for missing exports\n--silent Don't print warnings\n--sourcemapBaseUrl <url> Emit absolute sourcemap URLs with given base\n--sourcemapDebugIds Emit unique debug ids in source and sourcemaps\n--sourcemapExcludeSources Do not include source code in source maps\n--sourcemapFile <file> Specify bundle position for source maps\n--sourcemapFileNames <pattern> Name pattern for emitted sourcemaps\n--stdin=ext Specify file extension used for stdin input\n--no-stdin Do not read \"-\" from stdin\n--no-strict Don't emit `\"use strict\";` in the generated modules\n--strictDeprecations Throw errors for deprecated features\n--no-systemNullSetters Do not replace empty SystemJS setters with `null`\n--no-treeshake Disable tree-shaking optimisations\n--no-treeshake.annotations Ignore pure call annotations\n--treeshake.correctVarValueBeforeDeclaration Deoptimize variables until declared\n--treeshake.manualPureFunctions <names> Manually declare functions as pure\n--no-treeshake.moduleSideEffects Assume modules have no side effects\n--no-treeshake.propertyReadSideEffects Ignore property access side effects\n--no-treeshake.tryCatchDeoptimization Do not turn off try-catch-tree-shaking\n--no-treeshake.unknownGlobalSideEffects Assume unknown globals do not throw\n--validate Validate output\n--waitForBundleInput Wait for bundle input files\n--watch.buildDelay <number> Throttle watch rebuilds\n--no-watch.clearScreen Do not clear the screen when rebuilding\n--watch.exclude <files> Exclude files from being watched\n--watch.include <files> Limit watching to specified files\n--watch.onBundleEnd <cmd> Shell command to run on `\"BUNDLE_END\"` event\n--watch.onBundleStart <cmd> Shell command to run on `\"BUNDLE_START\"` event\n--watch.onEnd <cmd> Shell command to run on `\"END\"` event\n--watch.onError <cmd> Shell command to run on `\"ERROR\"` event\n--watch.onStart <cmd> Shell command to run on `\"START\"` event\n--watch.skipWrite Do not write files to disk when watching\n\nExamples:\n\n# use settings in config file\nrollup -c\n\n# in config file, process.env.INCLUDE_DEPS === 'true'\n# and process.env.BUILD === 'production'\nrollup -c --environment INCLUDE_DEPS,BUILD:production\n\n# create CommonJS bundle.js from src/main.js\nrollup --format=cjs --file=bundle.js -- src/main.js\n\n# create self-executing IIFE using `window.jQuery`\n# and `window._` as external globals\nrollup -f iife --globals jquery:jQuery,lodash:_ \\\n -i src/app.js -o build/app.js -m build/app.js.map\n\nNotes:\n\n* When piping to stdout, only inline sourcemaps are permitted\n\nFor more information visit https://rollupjs.org\n";
|
|
32
32
|
|
|
33
33
|
/**
|
|
34
34
|
* @license
|
|
@@ -1219,8 +1219,8 @@ const parser = new YargsParser({
|
|
|
1219
1219
|
return env;
|
|
1220
1220
|
},
|
|
1221
1221
|
format: require$$2.format,
|
|
1222
|
-
normalize: require$$0
|
|
1223
|
-
resolve: require$$0
|
|
1222
|
+
normalize: require$$0.normalize,
|
|
1223
|
+
resolve: require$$0.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.readFileSync(path, 'utf8'));
|
|
1232
|
+
return JSON.parse(require$$0$1.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