rollup 3.0.0-0 → 3.0.0-3
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 +29 -49
- package/README.md +2 -4
- package/dist/bin/rollup +25 -36
- package/dist/es/rollup.js +2 -2
- package/dist/es/shared/rollup.js +499 -476
- package/dist/es/shared/watch.js +4 -2
- package/dist/loadConfigFile.js +8 -5
- package/dist/rollup.d.ts +16 -18
- package/dist/rollup.js +2 -2
- package/dist/shared/index.js +2 -2
- package/dist/shared/loadConfigFile.js +160 -49
- package/dist/shared/mergeOptions.js +4 -2
- package/dist/shared/rollup.js +541 -475
- package/dist/shared/watch-cli.js +3 -3
- package/dist/shared/watch.js +2 -2
- package/package.json +23 -27
- package/dist/es/rollup.browser.js +0 -10
- package/dist/rollup.browser.js +0 -11
- package/dist/rollup.browser.js.map +0 -1
package/LICENSE.md
CHANGED
|
@@ -240,6 +240,35 @@ Repository: jonschlinkert/fill-range
|
|
|
240
240
|
|
|
241
241
|
---------------------------------------
|
|
242
242
|
|
|
243
|
+
## get-package-type
|
|
244
|
+
License: MIT
|
|
245
|
+
By: Corey Farrell
|
|
246
|
+
Repository: git+https://github.com/cfware/get-package-type.git
|
|
247
|
+
|
|
248
|
+
> MIT License
|
|
249
|
+
>
|
|
250
|
+
> Copyright (c) 2020 CFWare, LLC
|
|
251
|
+
>
|
|
252
|
+
> Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
253
|
+
> of this software and associated documentation files (the "Software"), to deal
|
|
254
|
+
> in the Software without restriction, including without limitation the rights
|
|
255
|
+
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
256
|
+
> copies of the Software, and to permit persons to whom the Software is
|
|
257
|
+
> furnished to do so, subject to the following conditions:
|
|
258
|
+
>
|
|
259
|
+
> The above copyright notice and this permission notice shall be included in all
|
|
260
|
+
> copies or substantial portions of the Software.
|
|
261
|
+
>
|
|
262
|
+
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
263
|
+
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
264
|
+
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
265
|
+
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
266
|
+
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
267
|
+
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
268
|
+
> SOFTWARE.
|
|
269
|
+
|
|
270
|
+
---------------------------------------
|
|
271
|
+
|
|
243
272
|
## glob-parent
|
|
244
273
|
License: ISC
|
|
245
274
|
By: Gulp Team, Elan Shanker, Blaine Bublitz
|
|
@@ -263,35 +292,6 @@ Repository: gulpjs/glob-parent
|
|
|
263
292
|
|
|
264
293
|
---------------------------------------
|
|
265
294
|
|
|
266
|
-
## hash.js
|
|
267
|
-
License: MIT
|
|
268
|
-
By: Fedor Indutny
|
|
269
|
-
Repository: git@github.com:indutny/hash.js
|
|
270
|
-
|
|
271
|
-
---------------------------------------
|
|
272
|
-
|
|
273
|
-
## inherits
|
|
274
|
-
License: ISC
|
|
275
|
-
Repository: git://github.com/isaacs/inherits
|
|
276
|
-
|
|
277
|
-
> The ISC License
|
|
278
|
-
>
|
|
279
|
-
> Copyright (c) Isaac Z. Schlueter
|
|
280
|
-
>
|
|
281
|
-
> Permission to use, copy, modify, and/or distribute this software for any
|
|
282
|
-
> purpose with or without fee is hereby granted, provided that the above
|
|
283
|
-
> copyright notice and this permission notice appear in all copies.
|
|
284
|
-
>
|
|
285
|
-
> THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
286
|
-
> REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
|
287
|
-
> FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
288
|
-
> INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
289
|
-
> LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
290
|
-
> OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
291
|
-
> PERFORMANCE OF THIS SOFTWARE.
|
|
292
|
-
|
|
293
|
-
---------------------------------------
|
|
294
|
-
|
|
295
295
|
## is-binary-path
|
|
296
296
|
License: MIT
|
|
297
297
|
By: Sindre Sorhus
|
|
@@ -425,26 +425,6 @@ Repository: https://github.com/rich-harris/magic-string
|
|
|
425
425
|
|
|
426
426
|
---------------------------------------
|
|
427
427
|
|
|
428
|
-
## minimalistic-assert
|
|
429
|
-
License: ISC
|
|
430
|
-
Repository: https://github.com/calvinmetcalf/minimalistic-assert.git
|
|
431
|
-
|
|
432
|
-
> Copyright 2015 Calvin Metcalf
|
|
433
|
-
>
|
|
434
|
-
> Permission to use, copy, modify, and/or distribute this software for any purpose
|
|
435
|
-
> with or without fee is hereby granted, provided that the above copyright notice
|
|
436
|
-
> and this permission notice appear in all copies.
|
|
437
|
-
>
|
|
438
|
-
> THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
439
|
-
> REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
|
440
|
-
> FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
441
|
-
> INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
442
|
-
> LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
|
|
443
|
-
> OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
444
|
-
> PERFORMANCE OF THIS SOFTWARE.
|
|
445
|
-
|
|
446
|
-
---------------------------------------
|
|
447
|
-
|
|
448
428
|
## normalize-path
|
|
449
429
|
License: MIT
|
|
450
430
|
By: Jon Schlinkert, Blaine Bublitz
|
package/README.md
CHANGED
|
@@ -21,9 +21,7 @@
|
|
|
21
21
|
<a href="https://github.com/rollup/rollup/blob/master/LICENSE.md">
|
|
22
22
|
<img src="https://img.shields.io/npm/l/rollup.svg" alt="license">
|
|
23
23
|
</a>
|
|
24
|
-
|
|
25
|
-
<img src="https://david-dm.org/rollup/rollup/status.svg" alt="dependency status">
|
|
26
|
-
</a>
|
|
24
|
+
|
|
27
25
|
<a href='https://is.gd/rollup_chat?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge'>
|
|
28
26
|
<img src='https://img.shields.io/discord/466787075518365708?color=778cd1&label=chat' alt='Join the chat at https://is.gd/rollup_chat'>
|
|
29
27
|
</a>
|
|
@@ -37,7 +35,7 @@ Rollup is a module bundler for JavaScript which compiles small pieces of code in
|
|
|
37
35
|
|
|
38
36
|
## Quick Start Guide
|
|
39
37
|
|
|
40
|
-
Install with `npm install --global rollup`. Rollup can be used either through a [command line interface](https://rollupjs.org/#command-line-reference) with an optional configuration file
|
|
38
|
+
Install with `npm install --global rollup`. Rollup can be used either through a [command line interface](https://rollupjs.org/#command-line-reference) with an optional configuration file or else through its [JavaScript API](https://rollupjs.org/guide/en/#javascript-api). Run `rollup --help` to see the available options and parameters. The starter project templates, [rollup-starter-lib](https://github.com/rollup/rollup-starter-lib) and [rollup-starter-app](https://github.com/rollup/rollup-starter-app), demonstrate common configuration options, and more detailed instructions are available throughout the [user guide](https://rollupjs.org/).
|
|
41
39
|
|
|
42
40
|
### Commands
|
|
43
41
|
|
package/dist/bin/rollup
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
/*
|
|
4
4
|
@license
|
|
5
|
-
Rollup.js v3.0.0-
|
|
6
|
-
|
|
5
|
+
Rollup.js v3.0.0-2
|
|
6
|
+
Sat, 30 Jul 2022 12:51:34 GMT - commit 41906cedefbc03640d6e8ca23ce6975f3bb5c6a1
|
|
7
7
|
|
|
8
8
|
https://github.com/rollup/rollup
|
|
9
9
|
|
|
@@ -26,7 +26,7 @@ require('events');
|
|
|
26
26
|
require('url');
|
|
27
27
|
require('tty');
|
|
28
28
|
|
|
29
|
-
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.id <id> ID for AMD module (default is anonymous)\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--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--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-externalLiveBindings Do not generate code to support live bindings\n--failAfterWarnings Exit with an error if the build produced warnings\n--footer <text> Code to insert at end of bundle (outside wrapper)\n--no-freeze Do not freeze namespace objects\n--generatedCode <preset> Which code features to use (es5/es2015)\n--no-hoistTransitiveImports Do not hoist transitive imports into entry chunks\n--no-indent Don't indent result\n--no-interop Do not include interop block\n--inlineDynamicImports Create single bundle when using dynamic imports\n--intro <text> Code to insert at top of bundle (inside wrapper)\n--no-makeAbsoluteExternalsRelative Prevent normalization of external imports\n--maxParallelFileReads <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-sanitizeFileName Do not replace invalid characters in file names\n--shimMissingExports Create shim variables for missing exports\n--silent Don't print warnings\n--sourcemapExcludeSources Do not include source code in source maps\n--sourcemapFile <file> Specify bundle position for source maps\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--systemNullSetters Replace empty SystemJS setters with `null`\n--no-treeshake Disable tree-shaking optimisations\n--no-treeshake.annotations Ignore pure call annotations\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--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.skipWrite Do not write files to disk when watching\n--watch.exclude <files> Exclude files from being watched\n--watch.include <files> Limit watching to specified files\n--watch.onStart <cmd> Shell command to run on `\"START\"` event\n--watch.onBundleStart <cmd> Shell command to run on `\"BUNDLE_START\"` event\n--watch.onBundleEnd <cmd> Shell command to run on `\"BUNDLE_END\"` event\n--watch.onEnd <cmd> Shell command to run on `\"END\"` event\n--watch.onError <cmd> Shell command to run on `\"ERROR\"` event\n--validate Validate output\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";
|
|
29
|
+
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.id <id> ID for AMD module (default is anonymous)\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--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--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-externalLiveBindings Do not generate code to support live bindings\n--failAfterWarnings Exit with an error if the build produced warnings\n--footer <text> Code to insert at end of bundle (outside wrapper)\n--no-freeze Do not freeze namespace objects\n--generatedCode <preset> Which code features to use (es5/es2015)\n--no-hoistTransitiveImports Do not hoist transitive imports into entry chunks\n--no-indent Don't indent result\n--no-interop Do not include interop block\n--inlineDynamicImports Create single bundle when using dynamic imports\n--intro <text> Code to insert at top of bundle (inside wrapper)\n--no-makeAbsoluteExternalsRelative Prevent normalization of external imports\n--maxParallelFileReads <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-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--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--systemNullSetters Replace empty SystemJS setters with `null`\n--no-treeshake Disable tree-shaking optimisations\n--no-treeshake.annotations Ignore pure call annotations\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--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.skipWrite Do not write files to disk when watching\n--watch.exclude <files> Exclude files from being watched\n--watch.include <files> Limit watching to specified files\n--watch.onStart <cmd> Shell command to run on `\"START\"` event\n--watch.onBundleStart <cmd> Shell command to run on `\"BUNDLE_START\"` event\n--watch.onBundleEnd <cmd> Shell command to run on `\"BUNDLE_END\"` event\n--watch.onEnd <cmd> Shell command to run on `\"END\"` event\n--watch.onError <cmd> Shell command to run on `\"ERROR\"` event\n--validate Validate output\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";
|
|
30
30
|
|
|
31
31
|
/**
|
|
32
32
|
* @license
|
|
@@ -1394,7 +1394,7 @@ const BYTE_UNITS = [
|
|
|
1394
1394
|
'PB',
|
|
1395
1395
|
'EB',
|
|
1396
1396
|
'ZB',
|
|
1397
|
-
'YB'
|
|
1397
|
+
'YB',
|
|
1398
1398
|
];
|
|
1399
1399
|
|
|
1400
1400
|
const BIBYTE_UNITS = [
|
|
@@ -1406,7 +1406,7 @@ const BIBYTE_UNITS = [
|
|
|
1406
1406
|
'PiB',
|
|
1407
1407
|
'EiB',
|
|
1408
1408
|
'ZiB',
|
|
1409
|
-
'YiB'
|
|
1409
|
+
'YiB',
|
|
1410
1410
|
];
|
|
1411
1411
|
|
|
1412
1412
|
const BIT_UNITS = [
|
|
@@ -1418,7 +1418,7 @@ const BIT_UNITS = [
|
|
|
1418
1418
|
'Pbit',
|
|
1419
1419
|
'Ebit',
|
|
1420
1420
|
'Zbit',
|
|
1421
|
-
'Ybit'
|
|
1421
|
+
'Ybit',
|
|
1422
1422
|
];
|
|
1423
1423
|
|
|
1424
1424
|
const BIBIT_UNITS = [
|
|
@@ -1430,7 +1430,7 @@ const BIBIT_UNITS = [
|
|
|
1430
1430
|
'Pibit',
|
|
1431
1431
|
'Eibit',
|
|
1432
1432
|
'Zibit',
|
|
1433
|
-
'Yibit'
|
|
1433
|
+
'Yibit',
|
|
1434
1434
|
];
|
|
1435
1435
|
|
|
1436
1436
|
/*
|
|
@@ -1450,16 +1450,20 @@ const toLocaleString = (number, locale, options) => {
|
|
|
1450
1450
|
return result;
|
|
1451
1451
|
};
|
|
1452
1452
|
|
|
1453
|
-
|
|
1453
|
+
function prettyBytes(number, options) {
|
|
1454
1454
|
if (!Number.isFinite(number)) {
|
|
1455
1455
|
throw new TypeError(`Expected a finite number, got ${typeof number}: ${number}`);
|
|
1456
1456
|
}
|
|
1457
1457
|
|
|
1458
|
-
options =
|
|
1458
|
+
options = {
|
|
1459
|
+
bits: false,
|
|
1460
|
+
binary: false,
|
|
1461
|
+
...options,
|
|
1462
|
+
};
|
|
1459
1463
|
|
|
1460
|
-
const UNITS = options.bits
|
|
1461
|
-
(options.binary ? BIBIT_UNITS : BIT_UNITS)
|
|
1462
|
-
(options.binary ? BIBYTE_UNITS : BYTE_UNITS);
|
|
1464
|
+
const UNITS = options.bits
|
|
1465
|
+
? (options.binary ? BIBIT_UNITS : BIT_UNITS)
|
|
1466
|
+
: (options.binary ? BIBYTE_UNITS : BYTE_UNITS);
|
|
1463
1467
|
|
|
1464
1468
|
if (options.signed && number === 0) {
|
|
1465
1469
|
return ` 0 ${UNITS[0]}`;
|
|
@@ -1479,7 +1483,7 @@ var prettyBytes = (number, options) => {
|
|
|
1479
1483
|
}
|
|
1480
1484
|
|
|
1481
1485
|
if (options.maximumFractionDigits !== undefined) {
|
|
1482
|
-
localeOptions =
|
|
1486
|
+
localeOptions = {maximumFractionDigits: options.maximumFractionDigits, ...localeOptions};
|
|
1483
1487
|
}
|
|
1484
1488
|
|
|
1485
1489
|
if (number < 1) {
|
|
@@ -1488,8 +1492,7 @@ var prettyBytes = (number, options) => {
|
|
|
1488
1492
|
}
|
|
1489
1493
|
|
|
1490
1494
|
const exponent = Math.min(Math.floor(options.binary ? Math.log(number) / Math.log(1024) : Math.log10(number) / 3), UNITS.length - 1);
|
|
1491
|
-
|
|
1492
|
-
number /= Math.pow(options.binary ? 1024 : 1000, exponent);
|
|
1495
|
+
number /= (options.binary ? 1024 : 1000) ** exponent;
|
|
1493
1496
|
|
|
1494
1497
|
if (!localeOptions) {
|
|
1495
1498
|
number = number.toPrecision(3);
|
|
@@ -1500,14 +1503,12 @@ var prettyBytes = (number, options) => {
|
|
|
1500
1503
|
const unit = UNITS[exponent];
|
|
1501
1504
|
|
|
1502
1505
|
return prefix + numberString + ' ' + unit;
|
|
1503
|
-
}
|
|
1504
|
-
|
|
1505
|
-
const prettyBytes$1 = prettyBytes;
|
|
1506
|
+
}
|
|
1506
1507
|
|
|
1507
1508
|
function printTimings(timings) {
|
|
1508
1509
|
Object.entries(timings).forEach(([label, [time, memory, total]]) => {
|
|
1509
1510
|
const appliedColor = label[0] === '#' ? (label[1] !== '#' ? loadConfigFile_js.underline : loadConfigFile_js.bold) : (text) => text;
|
|
1510
|
-
const row = `${label}: ${time.toFixed(0)}ms, ${prettyBytes
|
|
1511
|
+
const row = `${label}: ${time.toFixed(0)}ms, ${prettyBytes(memory)} / ${prettyBytes(total)}`;
|
|
1511
1512
|
console.info(appliedColor(row));
|
|
1512
1513
|
});
|
|
1513
1514
|
}
|
|
@@ -1534,10 +1535,7 @@ async function build(inputOptions, warnings, silent = false) {
|
|
|
1534
1535
|
if (useStdout) {
|
|
1535
1536
|
const output = outputOptions[0];
|
|
1536
1537
|
if (output.sourcemap && output.sourcemap !== 'inline') {
|
|
1537
|
-
loadConfigFile_js.handleError(
|
|
1538
|
-
code: 'ONLY_INLINE_SOURCEMAPS',
|
|
1539
|
-
message: 'Only inline sourcemaps are supported when bundling to stdout.'
|
|
1540
|
-
});
|
|
1538
|
+
loadConfigFile_js.handleError(rollup.errOnlyInlineSourcemapsForStdout());
|
|
1541
1539
|
}
|
|
1542
1540
|
const { output: outputs } = await bundle.generate(output);
|
|
1543
1541
|
for (const file of outputs) {
|
|
@@ -1587,10 +1585,7 @@ async function getConfigPath(commandConfig) {
|
|
|
1587
1585
|
}
|
|
1588
1586
|
catch (err) {
|
|
1589
1587
|
if (err.code === 'MODULE_NOT_FOUND') {
|
|
1590
|
-
loadConfigFile_js.handleError(
|
|
1591
|
-
code: 'MISSING_EXTERNAL_CONFIG',
|
|
1592
|
-
message: `Could not resolve config file "${commandConfig}"`
|
|
1593
|
-
});
|
|
1588
|
+
loadConfigFile_js.handleError(rollup.errMissingExternalConfig(commandConfig));
|
|
1594
1589
|
}
|
|
1595
1590
|
throw err;
|
|
1596
1591
|
}
|
|
@@ -1622,10 +1617,7 @@ async function runRollup(command) {
|
|
|
1622
1617
|
let inputSource;
|
|
1623
1618
|
if (command._.length > 0) {
|
|
1624
1619
|
if (command.input) {
|
|
1625
|
-
loadConfigFile_js.handleError(
|
|
1626
|
-
code: 'DUPLICATE_IMPORT_OPTIONS',
|
|
1627
|
-
message: 'Either use --input, or pass input path as argument'
|
|
1628
|
-
});
|
|
1620
|
+
loadConfigFile_js.handleError(rollup.errDuplicateImportOptions());
|
|
1629
1621
|
}
|
|
1630
1622
|
inputSource = command._;
|
|
1631
1623
|
}
|
|
@@ -1674,10 +1666,7 @@ async function runRollup(command) {
|
|
|
1674
1666
|
}
|
|
1675
1667
|
if (command.failAfterWarnings && warnings.warningOccurred) {
|
|
1676
1668
|
warnings.flush();
|
|
1677
|
-
loadConfigFile_js.handleError(
|
|
1678
|
-
code: 'FAIL_AFTER_WARNINGS',
|
|
1679
|
-
message: 'Warnings occurred and --failAfterWarnings flag present'
|
|
1680
|
-
});
|
|
1669
|
+
loadConfigFile_js.handleError(rollup.errFailAfterWarnings());
|
|
1681
1670
|
}
|
|
1682
1671
|
}
|
|
1683
1672
|
catch (err) {
|
|
@@ -1693,7 +1682,7 @@ async function runRollup(command) {
|
|
|
1693
1682
|
async function getConfigs(command) {
|
|
1694
1683
|
if (command.config) {
|
|
1695
1684
|
const configFile = await getConfigPath(command.config);
|
|
1696
|
-
const { options, warnings } = await loadConfigFile_js.
|
|
1685
|
+
const { options, warnings } = await loadConfigFile_js.loadConfigFile(configFile, command);
|
|
1697
1686
|
return { options, warnings };
|
|
1698
1687
|
}
|
|
1699
1688
|
return await loadConfigFromCommand(command);
|
package/dist/es/rollup.js
CHANGED