rollup 3.5.0-0 → 3.6.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/dist/bin/rollup CHANGED
@@ -2,8 +2,8 @@
2
2
 
3
3
  /*
4
4
  @license
5
- Rollup.js v3.5.0-0
6
- Fri, 25 Nov 2022 05:53:50 GMT - commit b8beb21aa83e193ed6ef82f06127e95a7ef5fe22
5
+ Rollup.js v3.6.0-0
6
+ Sun, 27 Nov 2022 06:53:45 GMT - commit 03fdcc007bd49a4c88579d93053248ebe03dcef9
7
7
 
8
8
  https://github.com/rollup/rollup
9
9
 
@@ -27,7 +27,7 @@ require('node:events');
27
27
  require('tty');
28
28
  require('node:url');
29
29
 
30
- 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--amd.forceJsExtensionForImports Use `.js` extension in AMD imports\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-externalLiveBindings Do not generate code to support live bindings\n--no-externalImportAssertions Omit import assertions in \"es\" output\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--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-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--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--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
+ 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-externalImportAssertions Omit import assertions 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--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--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--no-hoistTransitiveImports Do not hoist transitive imports into entry chunks\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--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-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--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
31
 
32
32
  /**
33
33
  * @license
package/dist/es/rollup.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.5.0-0
4
- Fri, 25 Nov 2022 05:53:50 GMT - commit b8beb21aa83e193ed6ef82f06127e95a7ef5fe22
3
+ Rollup.js v3.6.0-0
4
+ Sun, 27 Nov 2022 06:53:45 GMT - commit 03fdcc007bd49a4c88579d93053248ebe03dcef9
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.5.0-0
4
- Fri, 25 Nov 2022 05:53:50 GMT - commit b8beb21aa83e193ed6ef82f06127e95a7ef5fe22
3
+ Rollup.js v3.6.0-0
4
+ Sun, 27 Nov 2022 06:53:45 GMT - commit 03fdcc007bd49a4c88579d93053248ebe03dcef9
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -16,7 +16,7 @@ import { promises } from 'node:fs';
16
16
  import { EventEmitter } from 'node:events';
17
17
  import * as tty from 'tty';
18
18
 
19
- var version$1 = "3.5.0-0";
19
+ var version$1 = "3.6.0-0";
20
20
 
21
21
  var charToInteger = {};
22
22
  var chars$1 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
@@ -13143,7 +13143,9 @@ class Module {
13143
13143
  this.includeAllExports(false);
13144
13144
  }
13145
13145
  isIncluded() {
13146
- return this.ast.included || this.namespace.included || this.importedFromNotTreeshaken;
13146
+ // Modules where this.ast is missing have been loaded via this.load and are
13147
+ // not yet fully processed, hence they cannot be included.
13148
+ return (this.ast && (this.ast.included || this.namespace.included || this.importedFromNotTreeshaken));
13147
13149
  }
13148
13150
  linkImports() {
13149
13151
  this.addModulesToImportDescriptions(this.importDescriptions);
@@ -15954,6 +15956,18 @@ function createChunks(allEntryPoints, assignedEntryPointsByModule, minChunkSize)
15954
15956
  modules
15955
15957
  }));
15956
15958
  }
15959
+ /**
15960
+ * This function tries to get rid of small chunks by merging them with other
15961
+ * chunks. In order to merge chunks, one must obey the following rule:
15962
+ * - When merging several chunks, at most one of the chunks can have side
15963
+ * effects
15964
+ * - When one of the chunks has side effects, the entry points depending on that
15965
+ * chunk need to be a super set of the entry points depending on the other
15966
+ * chunks
15967
+ * - Pure chunks can always be merged
15968
+ * - We use the entry point dependence signature to calculate "chunk distance",
15969
+ * i.e. how likely it is that two chunks are loaded together
15970
+ */
15957
15971
  function getOptimizedChunks(chunkModulesBySignature, minChunkSize) {
15958
15972
  timeStart('optimize chunks', 3);
15959
15973
  const chunkPartition = getPartitionedChunks(chunkModulesBySignature, minChunkSize);
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.5.0-0
4
- Fri, 25 Nov 2022 05:53:50 GMT - commit b8beb21aa83e193ed6ef82f06127e95a7ef5fe22
3
+ Rollup.js v3.6.0-0
4
+ Sun, 27 Nov 2022 06:53:45 GMT - commit 03fdcc007bd49a4c88579d93053248ebe03dcef9
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.5.0-0
4
- Fri, 25 Nov 2022 05:53:50 GMT - commit b8beb21aa83e193ed6ef82f06127e95a7ef5fe22
3
+ Rollup.js v3.6.0-0
4
+ Sun, 27 Nov 2022 06:53:45 GMT - commit 03fdcc007bd49a4c88579d93053248ebe03dcef9
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
package/dist/rollup.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.5.0-0
4
- Fri, 25 Nov 2022 05:53:50 GMT - commit b8beb21aa83e193ed6ef82f06127e95a7ef5fe22
3
+ Rollup.js v3.6.0-0
4
+ Sun, 27 Nov 2022 06:53:45 GMT - commit 03fdcc007bd49a4c88579d93053248ebe03dcef9
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.5.0-0
4
- Fri, 25 Nov 2022 05:53:50 GMT - commit b8beb21aa83e193ed6ef82f06127e95a7ef5fe22
3
+ Rollup.js v3.6.0-0
4
+ Sun, 27 Nov 2022 06:53:45 GMT - commit 03fdcc007bd49a4c88579d93053248ebe03dcef9
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.5.0-0
4
- Fri, 25 Nov 2022 05:53:50 GMT - commit b8beb21aa83e193ed6ef82f06127e95a7ef5fe22
3
+ Rollup.js v3.6.0-0
4
+ Sun, 27 Nov 2022 06:53:45 GMT - commit 03fdcc007bd49a4c88579d93053248ebe03dcef9
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.5.0-0
4
- Fri, 25 Nov 2022 05:53:50 GMT - commit b8beb21aa83e193ed6ef82f06127e95a7ef5fe22
3
+ Rollup.js v3.6.0-0
4
+ Sun, 27 Nov 2022 06:53:45 GMT - commit 03fdcc007bd49a4c88579d93053248ebe03dcef9
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$1 = "3.5.0-0";
34
+ var version$1 = "3.6.0-0";
35
35
 
36
36
  function ensureArray$1(items) {
37
37
  if (Array.isArray(items)) {
@@ -13658,7 +13658,9 @@ class Module {
13658
13658
  this.includeAllExports(false);
13659
13659
  }
13660
13660
  isIncluded() {
13661
- return this.ast.included || this.namespace.included || this.importedFromNotTreeshaken;
13661
+ // Modules where this.ast is missing have been loaded via this.load and are
13662
+ // not yet fully processed, hence they cannot be included.
13663
+ return (this.ast && (this.ast.included || this.namespace.included || this.importedFromNotTreeshaken));
13662
13664
  }
13663
13665
  linkImports() {
13664
13666
  this.addModulesToImportDescriptions(this.importDescriptions);
@@ -16469,6 +16471,18 @@ function createChunks(allEntryPoints, assignedEntryPointsByModule, minChunkSize)
16469
16471
  modules
16470
16472
  }));
16471
16473
  }
16474
+ /**
16475
+ * This function tries to get rid of small chunks by merging them with other
16476
+ * chunks. In order to merge chunks, one must obey the following rule:
16477
+ * - When merging several chunks, at most one of the chunks can have side
16478
+ * effects
16479
+ * - When one of the chunks has side effects, the entry points depending on that
16480
+ * chunk need to be a super set of the entry points depending on the other
16481
+ * chunks
16482
+ * - Pure chunks can always be merged
16483
+ * - We use the entry point dependence signature to calculate "chunk distance",
16484
+ * i.e. how likely it is that two chunks are loaded together
16485
+ */
16472
16486
  function getOptimizedChunks(chunkModulesBySignature, minChunkSize) {
16473
16487
  timeStart('optimize chunks', 3);
16474
16488
  const chunkPartition = getPartitionedChunks(chunkModulesBySignature, minChunkSize);
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.5.0-0
4
- Fri, 25 Nov 2022 05:53:50 GMT - commit b8beb21aa83e193ed6ef82f06127e95a7ef5fe22
3
+ Rollup.js v3.6.0-0
4
+ Sun, 27 Nov 2022 06:53:45 GMT - commit 03fdcc007bd49a4c88579d93053248ebe03dcef9
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.5.0-0
4
- Fri, 25 Nov 2022 05:53:50 GMT - commit b8beb21aa83e193ed6ef82f06127e95a7ef5fe22
3
+ Rollup.js v3.6.0-0
4
+ Sun, 27 Nov 2022 06:53:45 GMT - commit 03fdcc007bd49a4c88579d93053248ebe03dcef9
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rollup",
3
- "version": "3.5.0-0",
3
+ "version": "3.6.0-0",
4
4
  "description": "Next-generation ES module bundler",
5
5
  "main": "dist/rollup.js",
6
6
  "module": "dist/es/rollup.js",
@@ -29,11 +29,12 @@
29
29
  "test": "npm run build && npm run test:all",
30
30
  "test:cjs": "npm run build:cjs && npm run test:only",
31
31
  "test:quick": "mocha -b test/test.js",
32
- "test:all": "concurrently --kill-others-on-fail -c green,blue,magenta,cyan,red 'npm:test:only' 'npm:test:browser' 'npm:test:typescript' 'npm:test:leak' 'npm:test:package'",
32
+ "test:all": "concurrently --kill-others-on-fail -c green,blue,magenta,cyan,red 'npm:test:only' 'npm:test:browser' 'npm:test:typescript' 'npm:test:leak' 'npm:test:package' 'npm:test:options'",
33
33
  "test:coverage": "npm run build:cjs && shx rm -rf coverage/* && nyc --reporter html mocha test/test.js",
34
34
  "test:coverage:browser": "npm run build && shx rm -rf coverage/* && nyc mocha test/browser/index.js",
35
35
  "test:leak": "node --expose-gc test/leak/index.js",
36
36
  "test:package": "node scripts/test-package.js",
37
+ "test:options": "node scripts/test-options.js",
37
38
  "test:only": "mocha test/test.js",
38
39
  "test:typescript": "shx rm -rf test/typescript/dist && shx cp -r dist test/typescript/ && tsc --noEmit -p test/typescript && tsc --noEmit",
39
40
  "test:browser": "mocha test/browser/index.js",