rollup 2.38.3 → 2.39.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,54 @@
1
1
  # rollup changelog
2
2
 
3
+ ## 2.39.1
4
+ *2021-02-23*
5
+
6
+ ### Bug Fixes
7
+ * Make sure local variables named Symbol, Object or Promise do not conflict with code generated by Rollup (#3971)
8
+
9
+ ### Pull Requests
10
+ * [#3964](https://github.com/rollup/rollup/pull/3964): Remove extra word (@jamonholmgren)
11
+ * [#3971](https://github.com/rollup/rollup/pull/3971): Avoid conflicts with local variables named Symbol, Object, Promise (@lukastaegert)
12
+
13
+ ## 2.39.0
14
+ *2021-02-12*
15
+
16
+ ### Features
17
+ * Add "validate" option to verify generated chunks are valid JavaScript (#3952)
18
+
19
+ ### Bug Fixes
20
+ * Always add exports properties for uninitialized named exports (#3957)
21
+ * Allow using an external namespace reexport together with named exports (#3959)
22
+ * Avoid invalid generated code in certain scenarios with SystemJS exports (#3960)
23
+
24
+ ### Pull Requests
25
+ * [#3952](https://github.com/rollup/rollup/pull/3952): implement `validate` output option and `--validate` CLI option (@kzc)
26
+ * [#3956](https://github.com/rollup/rollup/pull/3956): Update dependencies, fix fsevents issue (@lukastaegert)
27
+ * [#3957](https://github.com/rollup/rollup/pull/3957): Make sure uninitialised exports turn up via .hasOwnProperty for non-ES formats (@lukastaegert)
28
+ * [#3959](https://github.com/rollup/rollup/pull/3959): Allow overriding individual exports of reexported external namespaces (@lukastaegert)
29
+ * [#3960](https://github.com/rollup/rollup/pull/3960): Make sure system exports are valid JavaScript
30
+ (@lukastaegert)
31
+
32
+ ## 2.38.5
33
+ *2021-02-05*
34
+
35
+ ### Bug Fixes
36
+ * Prevent invalid code when simplifying assignments and delcarations (#3951)
37
+ * Prevent behaviour-changing line-breaks when simplifying assignments in return statements (#3951)
38
+ * Slightly improve white-space rendering when simplifying certain expressions (#3951)
39
+
40
+ ### Pull Requests
41
+ * [#3951](https://github.com/rollup/rollup/pull/3951): Wrap simplified assignments if necessary (@lukastaegert)
42
+
43
+ ## 2.38.4
44
+ *2021-02-02*
45
+
46
+ ### Bug Fixes
47
+ * Do not change logic when tree-shaking declarations in if statements or loops (#3947)
48
+
49
+ ### Pull Requests
50
+ * [#3947](https://github.com/rollup/rollup/pull/3947): Do not tear apart declarations in loop or if bodies (@lukastaegert)
51
+
3
52
  ## 2.38.3
4
53
  *2021-02-01*
5
54
 
package/LICENSE.md CHANGED
@@ -35,7 +35,7 @@ Repository: https://github.com/acornjs/acorn.git
35
35
 
36
36
  > MIT License
37
37
  >
38
- > Copyright (C) 2012-2018 by various contributors (see AUTHORS)
38
+ > Copyright (C) 2012-2020 by various contributors (see AUTHORS)
39
39
  >
40
40
  > Permission is hereby granted, free of charge, to any person obtaining a copy
41
41
  > of this software and associated documentation files (the "Software"), to deal
package/dist/bin/rollup CHANGED
@@ -2,8 +2,8 @@
2
2
 
3
3
  /*
4
4
  @license
5
- Rollup.js v2.38.3
6
- Mon, 01 Feb 2021 06:15:21 GMT - commit 683cf48a5278987f08ff3958074c49a80b1ae3eb
5
+ Rollup.js v2.39.1
6
+ Tue, 23 Feb 2021 05:45:51 GMT - commit a8a56fc29978cef41dde28f8f14e3b29119768d5
7
7
 
8
8
 
9
9
  https://github.com/rollup/rollup
@@ -15,17 +15,17 @@
15
15
  Object.defineProperty(exports, '__esModule', { value: true });
16
16
 
17
17
  var rollup = require('../shared/rollup.js');
18
- var util = require('util');
18
+ var require$$0 = require('util');
19
19
  var fs = require('fs');
20
- var sysPath = require('path');
20
+ var path$1 = require('path');
21
21
  var mergeOptions = require('../shared/mergeOptions.js');
22
22
  var loadConfigFile_js = require('../shared/loadConfigFile.js');
23
- var Module = require('module');
23
+ var require$$1 = require('module');
24
24
  require('crypto');
25
25
  require('events');
26
26
  require('url');
27
27
 
28
- var 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--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--minifyInternalExports Force or disable minification of internal exports\n--namespaceToStringTag Create proper `.toString` methods for namespaces\n--noConflict Generate a noConflict method for UMD globals\n--outro <text> Code to insert at end of bundle (inside wrapper)\n--preferConst Use `const` instead of `var` for exports\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--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\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";
28
+ var 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--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--minifyInternalExports Force or disable minification of internal exports\n--namespaceToStringTag Create proper `.toString` methods for namespaces\n--noConflict Generate a noConflict method for UMD globals\n--outro <text> Code to insert at end of bundle (inside wrapper)\n--preferConst Use `const` instead of `var` for exports\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--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--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
29
 
30
30
  function camelCase(str) {
31
31
  str = str.toLocaleLowerCase();
@@ -1158,9 +1158,9 @@ const parser = new YargsParser({
1158
1158
  env: () => {
1159
1159
  return env;
1160
1160
  },
1161
- format: util.format,
1162
- normalize: sysPath.normalize,
1163
- resolve: sysPath.resolve,
1161
+ format: require$$0.format,
1162
+ normalize: path$1.normalize,
1163
+ resolve: path$1.resolve,
1164
1164
  // TODO: figure out a way to combine ESM and CJS coverage, such that
1165
1165
  // we can exercise all the lines below:
1166
1166
  require: (path) => {
@@ -1204,6 +1204,8 @@ var parseMs = milliseconds => {
1204
1204
  };
1205
1205
  };
1206
1206
 
1207
+ const parseMilliseconds = parseMs;
1208
+
1207
1209
  const pluralize = (word, count) => count === 1 ? word : `${word}s`;
1208
1210
 
1209
1211
  const SECOND_ROUNDING_EPSILON = 0.0000001;
@@ -1255,7 +1257,7 @@ var prettyMs = (milliseconds, options = {}) => {
1255
1257
  result.push(prefix + valueString + suffix);
1256
1258
  };
1257
1259
 
1258
- const parsed = parseMs(milliseconds);
1260
+ const parsed = parseMilliseconds(milliseconds);
1259
1261
 
1260
1262
  add(Math.trunc(parsed.days / 365), 'year', 'y');
1261
1263
  add(parsed.days % 365, 'day', 'd');
@@ -1507,14 +1509,14 @@ async function build(inputOptions, warnings, silent = false) {
1507
1509
  relative require
1508
1510
  */
1509
1511
 
1510
-
1511
-
1512
+ var path = path$1;
1513
+ var Module = require$$1;
1512
1514
 
1513
1515
  var modules = {};
1514
1516
 
1515
1517
  var getModule = function(dir) {
1516
- var rootPath = dir ? sysPath.resolve(dir) : process.cwd();
1517
- var rootName = sysPath.join(rootPath, '@root');
1518
+ var rootPath = dir ? path.resolve(dir) : process.cwd();
1519
+ var rootName = path.join(rootPath, '@root');
1518
1520
  var root = modules[rootName];
1519
1521
  if (!root) {
1520
1522
  root = new Module(rootName);
@@ -1541,7 +1543,7 @@ const DEFAULT_CONFIG_BASE = 'rollup.config';
1541
1543
  function getConfigPath(commandConfig) {
1542
1544
  const cwd = process.cwd();
1543
1545
  if (commandConfig === true) {
1544
- return sysPath.resolve(findConfigFileNameInCwd());
1546
+ return path$1.resolve(findConfigFileNameInCwd());
1545
1547
  }
1546
1548
  if (commandConfig.slice(0, 5) === 'node:') {
1547
1549
  const pkgName = commandConfig.slice(5);
@@ -1563,7 +1565,7 @@ function getConfigPath(commandConfig) {
1563
1565
  }
1564
1566
  }
1565
1567
  }
1566
- return sysPath.resolve(commandConfig);
1568
+ return path$1.resolve(commandConfig);
1567
1569
  }
1568
1570
  function findConfigFileNameInCwd() {
1569
1571
  const filesInWorkingDir = new Set(fs.readdirSync(process.cwd()));