rollup 1.29.1 → 1.31.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,49 @@
1
1
  # rollup changelog
2
2
 
3
+ ## 1.31.1
4
+ *2020-02-14*
5
+
6
+ ### Bug Fixes
7
+ * Make sure errored files are always re-evaluated in watch mode to avoid an issue in the typescript plugin (#3388)
8
+
9
+ ### Pull Requests
10
+ * [#3366](https://github.com/rollup/rollup/pull/3366): Correct spelling minifaction to minification (@VictorHom)
11
+ * [#3371](https://github.com/rollup/rollup/pull/3371): Adjust bug template to mention REPL.it (@lukastaegert)
12
+ * [#3388](https://github.com/rollup/rollup/pull/3388): Run transform hooks again in watch mode on files that errored (@lukastaegert)
13
+
14
+ ## 1.31.0
15
+ *2020-01-31*
16
+
17
+ ### Features
18
+ * Always disable tree-shaking for asm.js functions to maintain semantics (#3362)
19
+
20
+ ### Pull Requests
21
+ * [#3362](https://github.com/rollup/rollup/pull/3362): Preserve asm.js code (@lukastaegert)
22
+
23
+ ## 1.30.1
24
+ *2020-01-27*
25
+
26
+ ### Bug Fixes
27
+ * Do not mistreat static entgry points as dynamic ones when chunking (#3357)
28
+ * Resolve a crash when chunking circular dynamic imports (#3357)
29
+
30
+ ### Pull Requests
31
+ * [#3357](https://github.com/rollup/rollup/pull/3357): Resolve issues with circular dynamic entries (@lukastaegert)
32
+
33
+ ## 1.30.0
34
+ *2020-01-27*
35
+
36
+ ### Features
37
+ * Do not split chunks when dynamically imported modules import modules that are already loaded by all dynamic importers (#3354)
38
+ * Add `hoistTransitiveImports` option to disable hoisting imports of static dependencies into entry chunks (#3353)
39
+
40
+ ### Bug Fixes
41
+ * Make sure polyfills are always loaded first when each static entry point contains them as first import (#3354)
42
+
43
+ ### Pull Requests
44
+ * [#3353](https://github.com/rollup/rollup/pull/3353): Add option to avoid hoisting transitive imports (@lukastaegert)
45
+ * [#3354](https://github.com/rollup/rollup/pull/3354): Improve chunking algorithm for dynamic imports (@tjenkinson and @lukastaegert)
46
+
3
47
  ## 1.29.1
4
48
  *2020-01-21*
5
49
 
package/dist/bin/rollup CHANGED
@@ -2,8 +2,8 @@
2
2
 
3
3
  /*
4
4
  @license
5
- Rollup.js v1.29.1
6
- Tue, 21 Jan 2020 06:50:03 GMT - commit 21a1775a019b45bebfc608c8f58f3691080106e5
5
+ Rollup.js v1.31.1
6
+ Fri, 14 Feb 2020 05:26:11 GMT - commit 6f28151f53adb7f91b3e635eeebb0eba5e5d621c
7
7
 
8
8
 
9
9
  https://github.com/rollup/rollup
@@ -12,8 +12,7 @@
12
12
  */
13
13
  'use strict';
14
14
 
15
- var index = require('../shared/index.js');
16
- var rollup_js = require('../rollup.js');
15
+ var rollup_js = require('../shared/node-entry.js');
17
16
  require('util');
18
17
  var path = require('path');
19
18
  var fs = require('fs');
@@ -23,7 +22,7 @@ var events = require('events');
23
22
  require('module');
24
23
  var assert = require('assert');
25
24
 
26
- 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, esm, iife, umd)\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-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.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--dynamicImportFunction <name> Rename the dynamic `import()` function\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--footer <text> Code to insert at end of bundle (outside wrapper)\n--no-freeze Do not freeze namespace objects\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--namespaceToStringTag Create proper `.toString` methods for namespaces\n--noConflict Generate a noConflict method for UMD globals\n--no-strict Don't emit `\"use strict\";` in the generated modules\n--outro <text> Code to insert at end of bundle (inside wrapper)\n--preferConst Use `const` instead of `var` for exports\n--preserveModules Preserve module structure\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--strictDeprecations Throw errors for deprecated features\n--no-treeshake Disable tree-shaking optimisations\n--no-treeshake.annotations Ignore pure call annotations\n--no-treeshake.propertyReadSideEffects Ignore property access side-effects\n--treeshake.pureExternalModules Assume side-effect free externals\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";
25
+ 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, esm, iife, umd)\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-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.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--dynamicImportFunction <name> Rename the dynamic `import()` function\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--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--namespaceToStringTag Create proper `.toString` methods for namespaces\n--noConflict Generate a noConflict method for UMD globals\n--no-strict Don't emit `\"use strict\";` in the generated modules\n--outro <text> Code to insert at end of bundle (inside wrapper)\n--preferConst Use `const` instead of `var` for exports\n--preserveModules Preserve module structure\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--no-stdin do not read \"-\" from stdin\n--strictDeprecations Throw errors for deprecated features\n--no-treeshake Disable tree-shaking optimisations\n--no-treeshake.annotations Ignore pure call annotations\n--no-treeshake.propertyReadSideEffects Ignore property access side-effects\n--treeshake.pureExternalModules Assume side-effect free externals\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";
27
26
 
28
27
  var minimist = function (args, opts) {
29
28
  if (!opts)
@@ -315,10 +314,10 @@ function handleError(err, recover = false) {
315
314
  stderr(turbocolor.cyan(err.url));
316
315
  }
317
316
  if (err.loc) {
318
- stderr(`${index.relativeId((err.loc.file || err.id))} (${err.loc.line}:${err.loc.column})`);
317
+ stderr(`${rollup_js.relativeId((err.loc.file || err.id))} (${err.loc.line}:${err.loc.column})`);
319
318
  }
320
319
  else if (err.id) {
321
- stderr(index.relativeId(err.id));
320
+ stderr(rollup_js.relativeId(err.id));
322
321
  }
323
322
  if (err.frame) {
324
323
  stderr(turbocolor.dim(err.frame));
@@ -355,9 +354,9 @@ function batchWarnings() {
355
354
  const id = (warning.loc && warning.loc.file) || warning.id;
356
355
  if (id) {
357
356
  const loc = warning.loc
358
- ? `${index.relativeId(id)}: (${warning.loc.line}:${warning.loc.column})`
359
- : index.relativeId(id);
360
- stderr(turbocolor.bold(index.relativeId(loc)));
357
+ ? `${rollup_js.relativeId(id)}: (${warning.loc.line}:${warning.loc.column})`
358
+ : rollup_js.relativeId(id);
359
+ stderr(turbocolor.bold(rollup_js.relativeId(loc)));
361
360
  }
362
361
  if (warning.frame)
363
362
  info(warning.frame);
@@ -433,7 +432,7 @@ const deferredHandlers = {
433
432
  stderr(turbocolor.bold('The following entry modules are using named and default exports together:'));
434
433
  const displayedWarnings = warnings.length > 5 ? warnings.slice(0, 3) : warnings;
435
434
  for (const warning of displayedWarnings) {
436
- stderr(index.relativeId(warning.id));
435
+ stderr(rollup_js.relativeId(warning.id));
437
436
  }
438
437
  if (displayedWarnings.length < warnings.length) {
439
438
  stderr(`...and ${warnings.length - displayedWarnings.length} other entry modules`);
@@ -443,7 +442,7 @@ const deferredHandlers = {
443
442
  NAMESPACE_CONFLICT(warnings) {
444
443
  title(`Conflicting re-exports`);
445
444
  for (const warning of warnings) {
446
- stderr(`${turbocolor.bold(index.relativeId(warning.reexporter))} re-exports '${warning.name}' from both ${index.relativeId(warning.sources[0])} and ${index.relativeId(warning.sources[1])} (will be ignored)`);
445
+ stderr(`${turbocolor.bold(rollup_js.relativeId(warning.reexporter))} re-exports '${warning.name}' from both ${rollup_js.relativeId(warning.sources[0])} and ${rollup_js.relativeId(warning.sources[1])} (will be ignored)`);
447
446
  }
448
447
  },
449
448
  NON_EXISTENT_EXPORT(warnings) {
@@ -461,7 +460,7 @@ const deferredHandlers = {
461
460
  if (warning.url && warning.url !== lastUrl)
462
461
  info((lastUrl = warning.url));
463
462
  if (warning.id) {
464
- let loc = index.relativeId(warning.id);
463
+ let loc = rollup_js.relativeId(warning.id);
465
464
  if (warning.loc) {
466
465
  loc += `: (${warning.loc.line}:${warning.loc.column})`;
467
466
  }
@@ -537,7 +536,7 @@ function showTruncatedWarnings(warnings) {
537
536
  const nestedByModule = nest(warnings, 'id');
538
537
  const displayedByModule = nestedByModule.length > 5 ? nestedByModule.slice(0, 3) : nestedByModule;
539
538
  for (const { key: id, items } of displayedByModule) {
540
- stderr(turbocolor.bold(index.relativeId(id)));
539
+ stderr(turbocolor.bold(rollup_js.relativeId(id)));
541
540
  stderr(turbocolor.gray(items[0].frame));
542
541
  if (items.length > 1) {
543
542
  stderr(`...and ${items.length - 1} other ${items.length > 2 ? 'occurrences' : 'occurrence'}`);
@@ -741,7 +740,7 @@ function build(inputOptions, outputOptions, warnings, silent = false) {
741
740
  const start = Date.now();
742
741
  const files = useStdout
743
742
  ? ['stdout']
744
- : outputOptions.map(t => index.relativeId(t.file || t.dir));
743
+ : outputOptions.map(t => rollup_js.relativeId(t.file || t.dir));
745
744
  if (!silent) {
746
745
  let inputFiles;
747
746
  if (typeof inputOptions.input === 'string') {
@@ -814,7 +813,7 @@ function loadConfigFile(configFile, commandOptions = {}) {
814
813
  })
815
814
  .then((bundle) => {
816
815
  if (!silent && warnings.count > 0) {
817
- stderr(turbocolor.bold(`loaded ${index.relativeId(configFile)} with warnings`));
816
+ stderr(turbocolor.bold(`loaded ${rollup_js.relativeId(configFile)} with warnings`));
818
817
  warnings.flush();
819
818
  }
820
819
  return bundle.generate({
@@ -929,7 +928,7 @@ var dateTime_1 = dateTime;
929
928
  var default_1 = dateTime;
930
929
  dateTime_1.default = default_1;
931
930
 
932
- var signals = index.createCommonjsModule(function (module) {
931
+ var signals = rollup_js.createCommonjsModule(function (module) {
933
932
  // This is not the set of all possible signals.
934
933
  //
935
934
  // It IS, however, the set of all signals that trigger
@@ -1136,7 +1135,7 @@ function watch(configFile, configs, command, silent = false) {
1136
1135
  let configWatcher;
1137
1136
  function processConfigs(configs) {
1138
1137
  return configs.map(options => {
1139
- const merged = index.mergeOptions({
1138
+ const merged = rollup_js.mergeOptions({
1140
1139
  command,
1141
1140
  config: options,
1142
1141
  defaultOnWarnHandler: warnings.add
@@ -1162,7 +1161,7 @@ function watch(configFile, configs, command, silent = false) {
1162
1161
  break;
1163
1162
  case 'START':
1164
1163
  if (!silent) {
1165
- resetScreen(turbocolor.underline(`rollup v${index.version}`));
1164
+ resetScreen(turbocolor.underline(`rollup v${rollup_js.version}`));
1166
1165
  }
1167
1166
  break;
1168
1167
  case 'BUNDLE_START':
@@ -1175,13 +1174,13 @@ function watch(configFile, configs, command, silent = false) {
1175
1174
  .map(key => input[key])
1176
1175
  .join(', ');
1177
1176
  }
1178
- stderr(turbocolor.cyan(`bundles ${turbocolor.bold(input)} → ${turbocolor.bold(event.output.map(index.relativeId).join(', '))}...`));
1177
+ stderr(turbocolor.cyan(`bundles ${turbocolor.bold(input)} → ${turbocolor.bold(event.output.map(rollup_js.relativeId).join(', '))}...`));
1179
1178
  }
1180
1179
  break;
1181
1180
  case 'BUNDLE_END':
1182
1181
  warnings.flush();
1183
1182
  if (!silent)
1184
- stderr(turbocolor.green(`created ${turbocolor.bold(event.output.map(index.relativeId).join(', '))} in ${turbocolor.bold(prettyMs(event.duration))}`));
1183
+ stderr(turbocolor.green(`created ${turbocolor.bold(event.output.map(rollup_js.relativeId).join(', '))} in ${turbocolor.bold(prettyMs(event.duration))}`));
1185
1184
  if (event.result && event.result.getTimings) {
1186
1185
  printTimings(event.result.getTimings());
1187
1186
  }
@@ -1283,7 +1282,7 @@ function runRollup(command) {
1283
1282
  const value = input.substr(equalsIndex + 1);
1284
1283
  let key = input.substr(0, equalsIndex);
1285
1284
  if (!key)
1286
- key = index.getAliasName(input);
1285
+ key = rollup_js.getAliasName(input);
1287
1286
  command.input[key] = value;
1288
1287
  });
1289
1288
  }
@@ -1312,11 +1311,11 @@ function runRollup(command) {
1312
1311
  if (configFile.slice(0, 5) === 'node:') {
1313
1312
  const pkgName = configFile.slice(5);
1314
1313
  try {
1315
- configFile = index.relative.resolve(`rollup-config-${pkgName}`, process.cwd());
1314
+ configFile = rollup_js.relative.resolve(`rollup-config-${pkgName}`, process.cwd());
1316
1315
  }
1317
1316
  catch (err) {
1318
1317
  try {
1319
- configFile = index.relative.resolve(pkgName, process.cwd());
1318
+ configFile = rollup_js.relative.resolve(pkgName, process.cwd());
1320
1319
  }
1321
1320
  catch (err) {
1322
1321
  if (err.code === 'MODULE_NOT_FOUND') {
@@ -1347,14 +1346,14 @@ function runRollup(command) {
1347
1346
  }
1348
1347
  }
1349
1348
  function execute(configFile, configs, command) {
1350
- return index.__awaiter(this, void 0, void 0, function* () {
1349
+ return rollup_js.__awaiter(this, void 0, void 0, function* () {
1351
1350
  if (command.watch) {
1352
1351
  watch(configFile, configs, command, command.silent);
1353
1352
  }
1354
1353
  else {
1355
1354
  for (const config of configs) {
1356
1355
  const warnings = batchWarnings();
1357
- const { inputOptions, outputOptions, optionError } = index.mergeOptions({
1356
+ const { inputOptions, outputOptions, optionError } = rollup_js.mergeOptions({
1358
1357
  command,
1359
1358
  config,
1360
1359
  defaultOnWarnHandler: warnings.add
@@ -1372,13 +1371,13 @@ function execute(configFile, configs, command) {
1372
1371
  }
1373
1372
 
1374
1373
  const command = minimist(process.argv.slice(2), {
1375
- alias: index.commandAliases
1374
+ alias: rollup_js.commandAliases
1376
1375
  });
1377
1376
  if (command.help || (process.argv.length <= 2 && process.stdin.isTTY)) {
1378
- console.log(`\n${help.replace('__VERSION__', index.version)}\n`);
1377
+ console.log(`\n${help.replace('__VERSION__', rollup_js.version)}\n`);
1379
1378
  }
1380
1379
  else if (command.version) {
1381
- console.log(`rollup v${index.version}`);
1380
+ console.log(`rollup v${rollup_js.version}`);
1382
1381
  }
1383
1382
  else {
1384
1383
  try {