rollup 2.63.0 → 2.66.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,77 @@
1
1
  # rollup changelog
2
2
 
3
+ ## 2.66.1
4
+
5
+ _2022-01-25_
6
+
7
+ ### Bug Fixes
8
+
9
+ - Only warn for conflicting names in namespace reexports if it actually causes problems (#4363)
10
+ - Only allow explicit exports or reexports as synthetic namespaces and hide them from namespace reexports (#4364)
11
+
12
+ ### Pull Requests
13
+
14
+ - [#4362](https://github.com/rollup/rollup/pull/4362): refactor: convert exportsByName object to map (@lukastaegert)
15
+ - [#4363](https://github.com/rollup/rollup/pull/4363): Do not warn unnecessarily for namespace conflicts (@lukastaegert)
16
+ - [#4364](https://github.com/rollup/rollup/pull/4364): Do not expose synthetic namespace export in entries and namespaces (@lukastaegert)
17
+
18
+ ## 2.66.0
19
+
20
+ _2022-01-22_
21
+
22
+ ### Features
23
+
24
+ - Note if a module has a default export in ModuleInfo to allow writing better proxy modules (#4356)
25
+ - Add option to wait until all imported ids have been resolved when awaiting `this.load` (#4358)
26
+
27
+ ### Pull Requests
28
+
29
+ - [#4356](https://github.com/rollup/rollup/pull/4356): Add hasDefaultExport to ModuleInfo (@lukastaegert)
30
+ - [#4358](https://github.com/rollup/rollup/pull/4358): Add "resolveDependencies" option to "this.load" (@lukastaegert)
31
+
32
+ ## 2.65.0
33
+
34
+ _2022-01-21_
35
+
36
+ ### Features
37
+
38
+ - Add complete import resolution objects to ModuleInfo for use in `this.load` (#4354)
39
+
40
+ ### Bug Fixes
41
+
42
+ - Use correct context in plugin hooks with `perf: true` (#4357)
43
+
44
+ ### Pull Requests
45
+
46
+ - [#4351](https://github.com/rollup/rollup/pull/4351): refactor: re-use source mapping url (@dnalborczyk)
47
+ - [#4352](https://github.com/rollup/rollup/pull/4352): refactor: replace require-relative with built-in require.resolve (@dnalborczyk)
48
+ - [#4353](https://github.com/rollup/rollup/pull/4353): chore: bump deps (@dnalborczyk)
49
+ - [#4354](https://github.com/rollup/rollup/pull/4354): Add importedIdResolutions to moduleInfo (@lukastaegert)
50
+ - [#4355](https://github.com/rollup/rollup/pull/4355): chore: remove external from config (@dnalborczyk)
51
+ - [#4357](https://github.com/rollup/rollup/pull/4357): fix: timed plugin context (@dnalborczyk)
52
+
53
+ ## 2.64.0
54
+
55
+ _2022-01-14_
56
+
57
+ ### Features
58
+
59
+ - Allow inspecting cached modules and forcing them to be transformed again via shouldTransformCachedModule (#4320)
60
+ - Do not wait for the config file to be parsed in watch mode if it is updated before that (#4344)
61
+
62
+ ### Bug Fixes
63
+
64
+ - Do not mutate objects returned as `meta` from the resolveId hook (#4347)
65
+
66
+ ### Pull Requests
67
+
68
+ - [#4326](https://github.com/rollup/rollup/pull/4326): refactor: type fixes (@dnalborczyk)
69
+ - [#4339](https://github.com/rollup/rollup/pull/4339): More watch test stabilization (@lukastaegert)
70
+ - [#4340](https://github.com/rollup/rollup/pull/4340): refactor: performance timers for node.js and browser (@dnalborczyk)
71
+ - [#4341](https://github.com/rollup/rollup/pull/4341): Implement shouldTransformCachedModule hook (@lukastaegert)
72
+ - [#4344](https://github.com/rollup/rollup/pull/4344): Directly restart Rollup when config file change is detected in watch mode (@lukastaegert)
73
+ - [#4347](https://github.com/rollup/rollup/pull/4347): Create a shallow copy when returning meta from resolveId (@lukastaegert)
74
+
3
75
  ## 2.63.0
4
76
 
5
77
  _2022-01-04_
package/LICENSE.md CHANGED
@@ -583,13 +583,6 @@ Repository: git://github.com/paulmillr/readdirp.git
583
583
 
584
584
  ---------------------------------------
585
585
 
586
- ## require-relative
587
- License: MIT
588
- By: Valerio Proietti
589
- Repository: git://github.com/kamicane/require-relative.git
590
-
591
- ---------------------------------------
592
-
593
586
  ## signal-exit
594
587
  License: ISC
595
588
  By: Ben Coe
package/dist/bin/rollup CHANGED
@@ -2,8 +2,8 @@
2
2
 
3
3
  /*
4
4
  @license
5
- Rollup.js v2.63.0
6
- Tue, 04 Jan 2022 07:30:25 GMT - commit ae674c9edde5efb8ce6d8ef845598a805938178c
5
+ Rollup.js v2.66.1
6
+ Tue, 25 Jan 2022 07:58:28 GMT - commit f523f0098d3e98f87abef54f48f39d06a7cc7eec
7
7
 
8
8
 
9
9
  https://github.com/rollup/rollup
@@ -17,29 +17,16 @@ Object.defineProperty(exports, '__esModule', { value: true });
17
17
  const rollup = require('../shared/rollup.js');
18
18
  const require$$2 = require('util');
19
19
  const fs = require('fs');
20
- const path$1 = require('path');
20
+ const require$$0 = require('path');
21
21
  const mergeOptions = require('../shared/mergeOptions.js');
22
22
  const loadConfigFile_js = require('../shared/loadConfigFile.js');
23
- const require$$1 = require('module');
23
+ const process$1 = require('process');
24
+ require('perf_hooks');
24
25
  require('crypto');
25
26
  require('events');
26
27
  require('url');
27
- require('process');
28
28
  require('tty');
29
29
 
30
- function _interopNamespaceDefault(e) {
31
- const n = Object.create(null);
32
- if (e) {
33
- for (const k in e) {
34
- n[k] = e[k];
35
- }
36
- }
37
- n.default = e;
38
- return n;
39
- }
40
-
41
- const path__namespace = /*#__PURE__*/_interopNamespaceDefault(path$1);
42
-
43
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--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--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--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";
44
31
 
45
32
  /**
@@ -1221,8 +1208,8 @@ const parser = new YargsParser({
1221
1208
  return env;
1222
1209
  },
1223
1210
  format: require$$2.format,
1224
- normalize: path$1.normalize,
1225
- resolve: path$1.resolve,
1211
+ normalize: require$$0.normalize,
1212
+ resolve: require$$0.resolve,
1226
1213
  // TODO: figure out a way to combine ESM and CJS coverage, such that
1227
1214
  // we can exercise all the lines below:
1228
1215
  require: (path) => {
@@ -1394,10 +1381,6 @@ var prettyMs = (milliseconds, options = {}) => {
1394
1381
 
1395
1382
  const ms = prettyMs;
1396
1383
 
1397
- let SOURCEMAPPING_URL = 'sourceMa';
1398
- SOURCEMAPPING_URL += 'ppingURL';
1399
- const SOURCEMAPPING_URL$1 = SOURCEMAPPING_URL;
1400
-
1401
1384
  const BYTE_UNITS = [
1402
1385
  'B',
1403
1386
  'kB',
@@ -1562,7 +1545,7 @@ async function build(inputOptions, warnings, silent = false) {
1562
1545
  else {
1563
1546
  source = file.code;
1564
1547
  if (output.sourcemap === 'inline') {
1565
- source += `\n//# ${SOURCEMAPPING_URL$1}=${file.map.toUrl()}\n`;
1548
+ source += `\n//# ${rollup.SOURCEMAPPING_URL}=${file.map.toUrl()}\n`;
1566
1549
  }
1567
1550
  }
1568
1551
  if (outputs.length > 1)
@@ -1585,56 +1568,19 @@ async function build(inputOptions, warnings, silent = false) {
1585
1568
  }
1586
1569
  }
1587
1570
 
1588
- /*
1589
- relative require
1590
- */
1591
-
1592
- var path = path$1;
1593
- var Module = require$$1;
1594
-
1595
- var modules = {};
1596
-
1597
- var getModule = function(dir) {
1598
- var rootPath = dir ? path.resolve(dir) : process.cwd();
1599
- var rootName = path.join(rootPath, '@root');
1600
- var root = modules[rootName];
1601
- if (!root) {
1602
- root = new Module(rootName);
1603
- root.filename = rootName;
1604
- root.paths = Module._nodeModulePaths(rootPath);
1605
- modules[rootName] = root;
1606
- }
1607
- return root;
1608
- };
1609
-
1610
- var requireRelative = function(requested, relativeTo) {
1611
- var root = getModule(relativeTo);
1612
- return root.require(requested);
1613
- };
1614
-
1615
- requireRelative.resolve = function(requested, relativeTo) {
1616
- var root = getModule(relativeTo);
1617
- return Module._resolveFilename(requested, root);
1618
- };
1619
-
1620
- var requireRelative_1 = requireRelative;
1621
-
1622
- const relative = requireRelative_1;
1623
-
1624
1571
  const DEFAULT_CONFIG_BASE = 'rollup.config';
1625
1572
  function getConfigPath(commandConfig) {
1626
- const cwd = process.cwd();
1627
1573
  if (commandConfig === true) {
1628
- return path__namespace.resolve(findConfigFileNameInCwd());
1574
+ return require$$0.resolve(findConfigFileNameInCwd());
1629
1575
  }
1630
1576
  if (commandConfig.slice(0, 5) === 'node:') {
1631
1577
  const pkgName = commandConfig.slice(5);
1632
1578
  try {
1633
- return relative.resolve(`rollup-config-${pkgName}`, cwd);
1579
+ return require.resolve(`rollup-config-${pkgName}`, { paths: [process$1.cwd()] });
1634
1580
  }
1635
1581
  catch (_a) {
1636
1582
  try {
1637
- return relative.resolve(pkgName, cwd);
1583
+ return require.resolve(pkgName, { paths: [process$1.cwd()] });
1638
1584
  }
1639
1585
  catch (err) {
1640
1586
  if (err.code === 'MODULE_NOT_FOUND') {
@@ -1647,10 +1593,10 @@ function getConfigPath(commandConfig) {
1647
1593
  }
1648
1594
  }
1649
1595
  }
1650
- return path__namespace.resolve(commandConfig);
1596
+ return require$$0.resolve(commandConfig);
1651
1597
  }
1652
1598
  function findConfigFileNameInCwd() {
1653
- const filesInWorkingDir = new Set(fs.readdirSync(process.cwd()));
1599
+ const filesInWorkingDir = new Set(fs.readdirSync(process$1.cwd()));
1654
1600
  for (const extension of ['mjs', 'cjs', 'ts']) {
1655
1601
  const fileName = `${DEFAULT_CONFIG_BASE}.${extension}`;
1656
1602
  if (filesInWorkingDir.has(fileName))