rollup 2.75.7 → 2.76.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/rollup.d.ts CHANGED
@@ -692,6 +692,7 @@ export interface OutputOptions {
692
692
  preserveModulesRoot?: string;
693
693
  sanitizeFileName?: boolean | ((fileName: string) => string);
694
694
  sourcemap?: boolean | 'inline' | 'hidden';
695
+ sourcemapBaseUrl?: string;
695
696
  sourcemapExcludeSources?: boolean;
696
697
  sourcemapFile?: string;
697
698
  sourcemapPathTransform?: SourcemapPathTransformOption;
@@ -739,6 +740,7 @@ export interface NormalizedOutputOptions {
739
740
  preserveModulesRoot: string | undefined;
740
741
  sanitizeFileName: (fileName: string) => string;
741
742
  sourcemap: boolean | 'inline' | 'hidden';
743
+ sourcemapBaseUrl: string | undefined;
742
744
  sourcemapExcludeSources: boolean;
743
745
  sourcemapFile: string | undefined;
744
746
  sourcemapPathTransform: SourcemapPathTransformOption | undefined;
package/dist/rollup.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v2.75.7
4
- Mon, 20 Jun 2022 07:24:02 GMT - commit 057171c2d3bc2092b7f543fc05ead01f12595f12
3
+ Rollup.js v2.76.0
4
+ Fri, 08 Jul 2022 08:35:58 GMT - commit 0eb042740eb41812b9e96e0e7b6ed8aa4cab04a7
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v2.75.7
4
- Mon, 20 Jun 2022 07:24:02 GMT - commit 057171c2d3bc2092b7f543fc05ead01f12595f12
3
+ Rollup.js v2.76.0
4
+ Fri, 08 Jul 2022 08:35:58 GMT - commit 0eb042740eb41812b9e96e0e7b6ed8aa4cab04a7
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v2.75.7
4
- Mon, 20 Jun 2022 07:24:02 GMT - commit 057171c2d3bc2092b7f543fc05ead01f12595f12
3
+ Rollup.js v2.76.0
4
+ Fri, 08 Jul 2022 08:35:58 GMT - commit 0eb042740eb41812b9e96e0e7b6ed8aa4cab04a7
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -12,8 +12,8 @@
12
12
  const require$$0 = require('path');
13
13
  const process$1 = require('process');
14
14
  const url = require('url');
15
- const rollup = require('./rollup.js');
16
15
  const tty = require('tty');
16
+ const rollup = require('./rollup.js');
17
17
  const mergeOptions = require('./mergeOptions.js');
18
18
 
19
19
  function _interopNamespaceDefault(e) {
@@ -29,12 +29,15 @@ function _interopNamespaceDefault(e) {
29
29
 
30
30
  const tty__namespace = /*#__PURE__*/_interopNamespaceDefault(tty);
31
31
 
32
- const env = process.env || {};
33
- const argv = process.argv || [];
32
+ const {
33
+ env = {},
34
+ argv = [],
35
+ platform = "",
36
+ } = typeof process === "undefined" ? {} : process;
34
37
 
35
38
  const isDisabled = "NO_COLOR" in env || argv.includes("--no-color");
36
39
  const isForced = "FORCE_COLOR" in env || argv.includes("--color");
37
- const isWindows = process.platform === "win32";
40
+ const isWindows = platform === "win32";
38
41
  const isDumbTerminal = env.TERM === "dumb";
39
42
 
40
43
  const isCompatibleTerminal =
@@ -45,7 +48,8 @@ const isCI =
45
48
  ("GITHUB_ACTIONS" in env || "GITLAB_CI" in env || "CIRCLECI" in env);
46
49
 
47
50
  const isColorSupported =
48
- !isDisabled && (isForced || (isWindows && !isDumbTerminal) || isCompatibleTerminal || isCI);
51
+ !isDisabled &&
52
+ (isForced || (isWindows && !isDumbTerminal) || isCompatibleTerminal || isCI);
49
53
 
50
54
  const replaceClose = (
51
55
  index,
@@ -473,7 +477,7 @@ async function loadAndRegisterPlugin(inputOptions, pluginText) {
473
477
  plugin = new Function('return ' + pluginText);
474
478
  }
475
479
  else {
476
- const match = pluginText.match(/^([@./\\\w|^{}-]+)(=(.*))?$/);
480
+ const match = pluginText.match(/^([@.:/\\\w|^{}-]+)(=(.*))?$/);
477
481
  if (match) {
478
482
  // -p plugin
479
483
  // -p plugin=arg
@@ -500,6 +504,11 @@ async function loadAndRegisterPlugin(inputOptions, pluginText) {
500
504
  try {
501
505
  if (pluginText[0] == '.')
502
506
  pluginText = require$$0.resolve(pluginText);
507
+ // Windows absolute paths must be specified as file:// protocol URL
508
+ // Note that we do not have coverage for Windows-only code paths
509
+ else if (pluginText.match(/^[A-Za-z]:\\/)) {
510
+ pluginText = url.pathToFileURL(require$$0.resolve(pluginText)).href;
511
+ }
503
512
  plugin = await requireOrImport(pluginText);
504
513
  }
505
514
  catch (err) {
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v2.75.7
4
- Mon, 20 Jun 2022 07:24:02 GMT - commit 057171c2d3bc2092b7f543fc05ead01f12595f12
3
+ Rollup.js v2.76.0
4
+ Fri, 08 Jul 2022 08:35:58 GMT - commit 0eb042740eb41812b9e96e0e7b6ed8aa4cab04a7
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -161,6 +161,7 @@ function mergeOutputOptions(config, overrides, warn) {
161
161
  preserveModulesRoot: getOption('preserveModulesRoot'),
162
162
  sanitizeFileName: getOption('sanitizeFileName'),
163
163
  sourcemap: getOption('sourcemap'),
164
+ sourcemapBaseUrl: getOption('sourcemapBaseUrl'),
164
165
  sourcemapExcludeSources: getOption('sourcemapExcludeSources'),
165
166
  sourcemapFile: getOption('sourcemapFile'),
166
167
  sourcemapPathTransform: getOption('sourcemapPathTransform'),
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v2.75.7
4
- Mon, 20 Jun 2022 07:24:02 GMT - commit 057171c2d3bc2092b7f543fc05ead01f12595f12
3
+ Rollup.js v2.76.0
4
+ Fri, 08 Jul 2022 08:35:58 GMT - commit 0eb042740eb41812b9e96e0e7b6ed8aa4cab04a7
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -27,7 +27,7 @@ function _interopNamespaceDefault(e) {
27
27
  return n;
28
28
  }
29
29
 
30
- var version$1 = "2.75.7";
30
+ var version$1 = "2.76.0";
31
31
 
32
32
  function ensureArray$1(items) {
33
33
  if (Array.isArray(items)) {
@@ -14465,7 +14465,7 @@ function renderChunk({ code, options, outputPluginDriver, renderChunk, sourcemap
14465
14465
 
14466
14466
  function renderNamePattern(pattern, patternName, replacements) {
14467
14467
  if (isPathFragment(pattern))
14468
- return error(errFailedValidation(`Invalid pattern "${pattern}" for "${patternName}", patterns can be neither absolute nor relative paths.`));
14468
+ return error(errFailedValidation(`Invalid pattern "${pattern}" for "${patternName}", patterns can be neither absolute nor relative paths. If you want your files to be stored in a subdirectory, write its name without a leading slash like this: subdirectory/pattern.`));
14469
14469
  return pattern.replace(/\[(\w+)\]/g, (_match, type) => {
14470
14470
  if (!replacements.hasOwnProperty(type)) {
14471
14471
  return error(errFailedValidation(`"[${type}]" is not a valid placeholder in "${patternName}" pattern.`));
@@ -23368,6 +23368,16 @@ function sanitizeFileName(name) {
23368
23368
  return driveLetter + name.substr(driveLetter.length).replace(INVALID_CHAR_REGEX, '_');
23369
23369
  }
23370
23370
 
23371
+ function isValidUrl(url) {
23372
+ try {
23373
+ new URL(url);
23374
+ }
23375
+ catch (_) {
23376
+ return false;
23377
+ }
23378
+ return true;
23379
+ }
23380
+
23371
23381
  function normalizeOutputOptions(config, inputOptions, unsetInputOptions) {
23372
23382
  var _a, _b, _c, _d, _e, _f, _g;
23373
23383
  // These are options that may trigger special warnings or behaviour later
@@ -23421,6 +23431,7 @@ function normalizeOutputOptions(config, inputOptions, unsetInputOptions) {
23421
23431
  ? id => id
23422
23432
  : sanitizeFileName,
23423
23433
  sourcemap: config.sourcemap || false,
23434
+ sourcemapBaseUrl: getSourcemapBaseUrl(config),
23424
23435
  sourcemapExcludeSources: config.sourcemapExcludeSources || false,
23425
23436
  sourcemapFile: config.sourcemapFile,
23426
23437
  sourcemapPathTransform: config.sourcemapPathTransform,
@@ -23646,6 +23657,15 @@ const getNamespaceToStringTag = (config, generatedCode, inputOptions) => {
23646
23657
  }
23647
23658
  return generatedCode.symbols || false;
23648
23659
  };
23660
+ const getSourcemapBaseUrl = (config) => {
23661
+ const { sourcemapBaseUrl } = config;
23662
+ if (sourcemapBaseUrl) {
23663
+ if (isValidUrl(sourcemapBaseUrl)) {
23664
+ return sourcemapBaseUrl;
23665
+ }
23666
+ return error(errInvalidOption('output.sourcemapBaseUrl', 'outputsourcemapbaseurl', `must be a valid URL, received ${JSON.stringify(sourcemapBaseUrl)}`));
23667
+ }
23668
+ };
23649
23669
 
23650
23670
  function rollup(rawInputOptions) {
23651
23671
  return rollupInternal(rawInputOptions, null);
@@ -23808,7 +23828,11 @@ async function writeOutputFile(outputFile, outputOptions) {
23808
23828
  url = outputFile.map.toUrl();
23809
23829
  }
23810
23830
  else {
23811
- url = `${require$$0.basename(outputFile.fileName)}.map`;
23831
+ const { sourcemapBaseUrl } = outputOptions;
23832
+ const sourcemapFileName = `${require$$0.basename(outputFile.fileName)}.map`;
23833
+ url = sourcemapBaseUrl
23834
+ ? new URL(sourcemapFileName, sourcemapBaseUrl).toString()
23835
+ : sourcemapFileName;
23812
23836
  writeSourceMapPromise = require$$0$1.promises.writeFile(`${fileName}.map`, outputFile.map.toString());
23813
23837
  }
23814
23838
  if (outputOptions.sourcemap !== 'hidden') {
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v2.75.7
4
- Mon, 20 Jun 2022 07:24:02 GMT - commit 057171c2d3bc2092b7f543fc05ead01f12595f12
3
+ Rollup.js v2.76.0
4
+ Fri, 08 Jul 2022 08:35:58 GMT - commit 0eb042740eb41812b9e96e0e7b6ed8aa4cab04a7
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -18,7 +18,7 @@ const cli = require('../bin/rollup');
18
18
  const rollup = require('./rollup.js');
19
19
  const require$$0 = require('assert');
20
20
  const require$$0$1 = require('events');
21
- const loadConfigFile = require('./loadConfigFile.js');
21
+ const loadConfigFile_js = require('./loadConfigFile.js');
22
22
  const child_process = require('child_process');
23
23
  require('util');
24
24
  require('stream');
@@ -347,12 +347,12 @@ function getResetScreen(configs, allowClearScreen) {
347
347
  }
348
348
  }
349
349
  if (clearScreen) {
350
- return (heading) => loadConfigFile.stderr(CLEAR_SCREEN + heading);
350
+ return (heading) => loadConfigFile_js.stderr(CLEAR_SCREEN + heading);
351
351
  }
352
352
  let firstRun = true;
353
353
  return (heading) => {
354
354
  if (firstRun) {
355
- loadConfigFile.stderr(heading);
355
+ loadConfigFile_js.stderr(heading);
356
356
  firstRun = false;
357
357
  }
358
358
  };
@@ -371,7 +371,7 @@ function createWatchHooks(command) {
371
371
  if (watchHooks[hook]) {
372
372
  const cmd = watchHooks[hook];
373
373
  if (!command.silent) {
374
- loadConfigFile.stderr(loadConfigFile.cyan(`watch.${hook} ${loadConfigFile.bold(`$ ${cmd}`)}`));
374
+ loadConfigFile_js.stderr(loadConfigFile_js.cyan(`watch.${hook} ${loadConfigFile_js.bold(`$ ${cmd}`)}`));
375
375
  }
376
376
  try {
377
377
  // !! important - use stderr for all writes from execSync
@@ -379,7 +379,7 @@ function createWatchHooks(command) {
379
379
  child_process.execSync(cmd, { stdio: command.silent ? 'ignore' : stdio });
380
380
  }
381
381
  catch (e) {
382
- loadConfigFile.stderr(e.message);
382
+ loadConfigFile_js.stderr(e.message);
383
383
  }
384
384
  }
385
385
  };
@@ -414,10 +414,10 @@ async function watch(command) {
414
414
  configFileRevision++;
415
415
  const currentConfigFileRevision = configFileRevision;
416
416
  if (configFileData) {
417
- loadConfigFile.stderr(`\nReloading updated config...`);
417
+ loadConfigFile_js.stderr(`\nReloading updated config...`);
418
418
  }
419
419
  configFileData = newConfigFileData;
420
- const { options, warnings } = await loadConfigFile.loadAndParseConfigFile(configFile, command);
420
+ const { options, warnings } = await loadConfigFile_js.loadAndParseConfigFile(configFile, command);
421
421
  if (currentConfigFileRevision !== configFileRevision) {
422
422
  return;
423
423
  }
@@ -427,7 +427,7 @@ async function watch(command) {
427
427
  start(options, warnings);
428
428
  }
429
429
  catch (err) {
430
- loadConfigFile.handleError(err, true);
430
+ loadConfigFile_js.handleError(err, true);
431
431
  }
432
432
  }
433
433
  }
@@ -443,13 +443,13 @@ async function watch(command) {
443
443
  watcher = rollup.watch(configs);
444
444
  }
445
445
  catch (err) {
446
- return loadConfigFile.handleError(err);
446
+ return loadConfigFile_js.handleError(err);
447
447
  }
448
448
  watcher.on('event', event => {
449
449
  switch (event.code) {
450
450
  case 'ERROR':
451
451
  warnings.flush();
452
- loadConfigFile.handleError(event.error, true);
452
+ loadConfigFile_js.handleError(event.error, true);
453
453
  runWatchHook('onError');
454
454
  break;
455
455
  case 'START':
@@ -457,7 +457,7 @@ async function watch(command) {
457
457
  if (!resetScreen) {
458
458
  resetScreen = getResetScreen(configs, isTTY);
459
459
  }
460
- resetScreen(loadConfigFile.underline(`rollup v${rollup.version}`));
460
+ resetScreen(loadConfigFile_js.underline(`rollup v${rollup.version}`));
461
461
  }
462
462
  runWatchHook('onStart');
463
463
  break;
@@ -469,14 +469,14 @@ async function watch(command) {
469
469
  ? input.join(', ')
470
470
  : Object.values(input).join(', ');
471
471
  }
472
- loadConfigFile.stderr(loadConfigFile.cyan(`bundles ${loadConfigFile.bold(input)} → ${loadConfigFile.bold(event.output.map(rollup.relativeId).join(', '))}...`));
472
+ loadConfigFile_js.stderr(loadConfigFile_js.cyan(`bundles ${loadConfigFile_js.bold(input)} → ${loadConfigFile_js.bold(event.output.map(rollup.relativeId).join(', '))}...`));
473
473
  }
474
474
  runWatchHook('onBundleStart');
475
475
  break;
476
476
  case 'BUNDLE_END':
477
477
  warnings.flush();
478
478
  if (!silent)
479
- loadConfigFile.stderr(loadConfigFile.green(`created ${loadConfigFile.bold(event.output.map(rollup.relativeId).join(', '))} in ${loadConfigFile.bold(cli.ms(event.duration))}`));
479
+ loadConfigFile_js.stderr(loadConfigFile_js.green(`created ${loadConfigFile_js.bold(event.output.map(rollup.relativeId).join(', '))} in ${loadConfigFile_js.bold(cli.ms(event.duration))}`));
480
480
  runWatchHook('onBundleEnd');
481
481
  if (event.result && event.result.getTimings) {
482
482
  cli.printTimings(event.result.getTimings());
@@ -485,11 +485,11 @@ async function watch(command) {
485
485
  case 'END':
486
486
  runWatchHook('onEnd');
487
487
  if (!silent && isTTY) {
488
- loadConfigFile.stderr(`\n[${dateTime()}] waiting for changes...`);
488
+ loadConfigFile_js.stderr(`\n[${dateTime()}] waiting for changes...`);
489
489
  }
490
490
  }
491
491
  if ('result' in event && event.result) {
492
- event.result.close().catch(error => loadConfigFile.handleError(error, true));
492
+ event.result.close().catch(error => loadConfigFile_js.handleError(error, true));
493
493
  }
494
494
  });
495
495
  }
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v2.75.7
4
- Mon, 20 Jun 2022 07:24:02 GMT - commit 057171c2d3bc2092b7f543fc05ead01f12595f12
3
+ Rollup.js v2.76.0
4
+ Fri, 08 Jul 2022 08:35:58 GMT - commit 0eb042740eb41812b9e96e0e7b6ed8aa4cab04a7
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": "2.75.7",
3
+ "version": "2.76.0",
4
4
  "description": "Next-generation ES module bundler",
5
5
  "main": "dist/rollup.js",
6
6
  "module": "dist/es/rollup.js",
@@ -59,32 +59,32 @@
59
59
  "devDependencies": {
60
60
  "@rollup/plugin-alias": "^3.1.9",
61
61
  "@rollup/plugin-buble": "^0.21.3",
62
- "@rollup/plugin-commonjs": "^22.0.0",
62
+ "@rollup/plugin-commonjs": "^22.0.1",
63
63
  "@rollup/plugin-json": "^4.1.0",
64
64
  "@rollup/plugin-node-resolve": "^13.3.0",
65
65
  "@rollup/plugin-replace": "^4.0.0",
66
- "@rollup/plugin-typescript": "^8.3.2",
66
+ "@rollup/plugin-typescript": "^8.3.3",
67
67
  "@rollup/pluginutils": "^4.2.1",
68
- "@types/estree": "0.0.51",
68
+ "@types/estree": "0.0.52",
69
69
  "@types/node": "^10.17.60",
70
70
  "@types/signal-exit": "^3.0.1",
71
71
  "@types/yargs-parser": "^20.2.2",
72
- "@typescript-eslint/eslint-plugin": "^5.27.1",
73
- "@typescript-eslint/parser": "^5.27.1",
72
+ "@typescript-eslint/eslint-plugin": "^5.30.5",
73
+ "@typescript-eslint/parser": "^5.30.5",
74
74
  "acorn": "^8.7.1",
75
75
  "acorn-jsx": "^5.3.2",
76
76
  "acorn-walk": "^8.2.0",
77
77
  "buble": "^0.20.0",
78
78
  "chokidar": "^3.5.3",
79
- "colorette": "^2.0.17",
80
- "core-js": "^3.22.8",
79
+ "colorette": "^2.0.19",
80
+ "core-js": "^3.23.3",
81
81
  "date-time": "^4.0.0",
82
82
  "es5-shim": "^4.6.7",
83
83
  "es6-shim": "^0.35.6",
84
- "eslint": "^8.17.0",
84
+ "eslint": "^8.19.0",
85
85
  "eslint-config-prettier": "^8.5.0",
86
86
  "eslint-plugin-import": "^2.26.0",
87
- "eslint-plugin-prettier": "^4.0.0",
87
+ "eslint-plugin-prettier": "^4.2.1",
88
88
  "execa": "^5.1.1",
89
89
  "fixturify": "^2.1.1",
90
90
  "fs-extra": "^10.1.0",
@@ -96,12 +96,12 @@
96
96
  "magic-string": "^0.26.2",
97
97
  "mocha": "^9.2.2",
98
98
  "nyc": "^15.1.0",
99
- "prettier": "^2.6.2",
99
+ "prettier": "^2.7.1",
100
100
  "pretty-bytes": "^5.6.0",
101
101
  "pretty-ms": "^7.0.1",
102
102
  "requirejs": "^2.3.6",
103
- "rollup": "^2.75.6",
104
- "rollup-plugin-license": "^2.8.0",
103
+ "rollup": "^2.75.7",
104
+ "rollup-plugin-license": "^2.8.1",
105
105
  "rollup-plugin-string": "^3.0.0",
106
106
  "rollup-plugin-terser": "^7.0.2",
107
107
  "rollup-plugin-thatworks": "^1.0.4",
@@ -111,9 +111,9 @@
111
111
  "source-map-support": "^0.5.21",
112
112
  "sourcemap-codec": "^1.4.8",
113
113
  "systemjs": "^6.12.1",
114
- "terser": "^5.14.0",
114
+ "terser": "^5.14.1",
115
115
  "tslib": "^2.4.0",
116
- "typescript": "^4.7.3",
116
+ "typescript": "^4.7.4",
117
117
  "weak-napi": "^2.0.2",
118
118
  "yargs-parser": "^20.2.9"
119
119
  },