rollup 3.0.0-0 → 3.0.0-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/dist/rollup.d.ts CHANGED
@@ -664,6 +664,7 @@ export interface OutputOptions {
664
664
  preserveModulesRoot?: string;
665
665
  sanitizeFileName?: boolean | ((fileName: string) => string);
666
666
  sourcemap?: boolean | 'inline' | 'hidden';
667
+ sourcemapBaseUrl?: string;
667
668
  sourcemapExcludeSources?: boolean;
668
669
  sourcemapFile?: string;
669
670
  sourcemapPathTransform?: SourcemapPathTransformOption;
@@ -712,6 +713,7 @@ export interface NormalizedOutputOptions {
712
713
  preserveModulesRoot: string | undefined;
713
714
  sanitizeFileName: (fileName: string) => string;
714
715
  sourcemap: boolean | 'inline' | 'hidden';
716
+ sourcemapBaseUrl: string | undefined;
715
717
  sourcemapExcludeSources: boolean;
716
718
  sourcemapFile: string | undefined;
717
719
  sourcemapPathTransform: SourcemapPathTransformOption | undefined;
package/dist/rollup.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.0.0-0
4
- Tue, 05 Jul 2022 04:32:12 GMT - commit 7a8316af2262c390e7ed72586cb83add1286dec2
3
+ Rollup.js v3.0.0-1
4
+ Fri, 08 Jul 2022 11:35:32 GMT - commit 48ce34db70ebc2b4c1be38e6b8b02881be90b9f1
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.0.0-0
4
- Tue, 05 Jul 2022 04:32:12 GMT - commit 7a8316af2262c390e7ed72586cb83add1286dec2
3
+ Rollup.js v3.0.0-1
4
+ Fri, 08 Jul 2022 11:35:32 GMT - commit 48ce34db70ebc2b4c1be38e6b8b02881be90b9f1
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.0.0-0
4
- Tue, 05 Jul 2022 04:32:12 GMT - commit 7a8316af2262c390e7ed72586cb83add1286dec2
3
+ Rollup.js v3.0.0-1
4
+ Fri, 08 Jul 2022 11:35:32 GMT - commit 48ce34db70ebc2b4c1be38e6b8b02881be90b9f1
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -477,7 +477,7 @@ async function loadAndRegisterPlugin(inputOptions, pluginText) {
477
477
  plugin = new Function('return ' + pluginText);
478
478
  }
479
479
  else {
480
- const match = pluginText.match(/^([@./\\\w|^{}-]+)(=(.*))?$/);
480
+ const match = pluginText.match(/^([@.:/\\\w|^{}-]+)(=(.*))?$/);
481
481
  if (match) {
482
482
  // -p plugin
483
483
  // -p plugin=arg
@@ -504,6 +504,11 @@ async function loadAndRegisterPlugin(inputOptions, pluginText) {
504
504
  try {
505
505
  if (pluginText[0] == '.')
506
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
+ }
507
512
  plugin = await requireOrImport(pluginText);
508
513
  }
509
514
  catch (err) {
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.0.0-0
4
- Tue, 05 Jul 2022 04:32:12 GMT - commit 7a8316af2262c390e7ed72586cb83add1286dec2
3
+ Rollup.js v3.0.0-1
4
+ Fri, 08 Jul 2022 11:35:32 GMT - commit 48ce34db70ebc2b4c1be38e6b8b02881be90b9f1
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 v3.0.0-0
4
- Tue, 05 Jul 2022 04:32:12 GMT - commit 7a8316af2262c390e7ed72586cb83add1286dec2
3
+ Rollup.js v3.0.0-1
4
+ Fri, 08 Jul 2022 11:35:32 GMT - commit 48ce34db70ebc2b4c1be38e6b8b02881be90b9f1
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 = "3.0.0-0";
30
+ var version$1 = "3.0.0-1";
31
31
 
32
32
  function ensureArray$1(items) {
33
33
  if (Array.isArray(items)) {
@@ -14079,7 +14079,7 @@ const replacePlaceholdersWithDefaultAndGetContainedPlaceholders = (code, placeho
14079
14079
 
14080
14080
  function renderNamePattern(pattern, patternName, replacements) {
14081
14081
  if (isPathFragment(pattern))
14082
- return error(errFailedValidation(`Invalid pattern "${pattern}" for "${patternName}", patterns can be neither absolute nor relative paths.`));
14082
+ 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.`));
14083
14083
  return pattern.replace(/\[(\w+)(:\d+)?]/g, (_match, type, size) => {
14084
14084
  if (!replacements.hasOwnProperty(type) || (size && type !== 'hash')) {
14085
14085
  return error(errFailedValidation(`"[${type}${size || ''}]" is not a valid placeholder in the "${patternName}" pattern.`));
@@ -22810,7 +22810,7 @@ class PluginDriver {
22810
22810
  this.finaliseAssets = this.fileEmitter.finaliseAssets.bind(this.fileEmitter);
22811
22811
  this.setChunkInformation = this.fileEmitter.setChunkInformation.bind(this.fileEmitter);
22812
22812
  this.setOutputBundle = this.fileEmitter.setOutputBundle.bind(this.fileEmitter);
22813
- this.plugins = userPlugins.concat(basePluginDriver ? basePluginDriver.plugins : []);
22813
+ this.plugins = (basePluginDriver ? basePluginDriver.plugins : []).concat(userPlugins);
22814
22814
  const existingPluginNames = new Set();
22815
22815
  this.pluginContexts = new Map(this.plugins.map(plugin => [
22816
22816
  plugin,
@@ -23432,6 +23432,16 @@ function sanitizeFileName(name) {
23432
23432
  return driveLetter + name.substr(driveLetter.length).replace(INVALID_CHAR_REGEX, '_');
23433
23433
  }
23434
23434
 
23435
+ function isValidUrl(url) {
23436
+ try {
23437
+ new URL(url);
23438
+ }
23439
+ catch (_) {
23440
+ return false;
23441
+ }
23442
+ return true;
23443
+ }
23444
+
23435
23445
  function normalizeOutputOptions(config, inputOptions, unsetInputOptions) {
23436
23446
  var _a, _b, _c, _d, _e, _f, _g;
23437
23447
  // These are options that may trigger special warnings or behaviour later
@@ -23485,6 +23495,7 @@ function normalizeOutputOptions(config, inputOptions, unsetInputOptions) {
23485
23495
  ? id => id
23486
23496
  : sanitizeFileName,
23487
23497
  sourcemap: config.sourcemap || false,
23498
+ sourcemapBaseUrl: getSourcemapBaseUrl(config),
23488
23499
  sourcemapExcludeSources: config.sourcemapExcludeSources || false,
23489
23500
  sourcemapFile: config.sourcemapFile,
23490
23501
  sourcemapPathTransform: config.sourcemapPathTransform,
@@ -23713,6 +23724,15 @@ const getNamespaceToStringTag = (config, generatedCode, inputOptions) => {
23713
23724
  }
23714
23725
  return generatedCode.symbols || false;
23715
23726
  };
23727
+ const getSourcemapBaseUrl = (config) => {
23728
+ const { sourcemapBaseUrl } = config;
23729
+ if (sourcemapBaseUrl) {
23730
+ if (isValidUrl(sourcemapBaseUrl)) {
23731
+ return sourcemapBaseUrl;
23732
+ }
23733
+ return error(errInvalidOption('output.sourcemapBaseUrl', 'outputsourcemapbaseurl', `must be a valid URL, received ${JSON.stringify(sourcemapBaseUrl)}`));
23734
+ }
23735
+ };
23716
23736
 
23717
23737
  function rollup(rawInputOptions) {
23718
23738
  return rollupInternal(rawInputOptions, null);
@@ -23875,7 +23895,11 @@ async function writeOutputFile(outputFile, outputOptions) {
23875
23895
  url = outputFile.map.toUrl();
23876
23896
  }
23877
23897
  else {
23878
- url = `${require$$0.basename(outputFile.fileName)}.map`;
23898
+ const { sourcemapBaseUrl } = outputOptions;
23899
+ const sourcemapFileName = `${require$$0.basename(outputFile.fileName)}.map`;
23900
+ url = sourcemapBaseUrl
23901
+ ? new URL(sourcemapFileName, sourcemapBaseUrl).toString()
23902
+ : sourcemapFileName;
23879
23903
  writeSourceMapPromise = require$$0$1.promises.writeFile(`${fileName}.map`, outputFile.map.toString());
23880
23904
  }
23881
23905
  if (outputOptions.sourcemap !== 'hidden') {
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.0.0-0
4
- Tue, 05 Jul 2022 04:32:12 GMT - commit 7a8316af2262c390e7ed72586cb83add1286dec2
3
+ Rollup.js v3.0.0-1
4
+ Fri, 08 Jul 2022 11:35:32 GMT - commit 48ce34db70ebc2b4c1be38e6b8b02881be90b9f1
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.0.0-0
4
- Tue, 05 Jul 2022 04:32:12 GMT - commit 7a8316af2262c390e7ed72586cb83add1286dec2
3
+ Rollup.js v3.0.0-1
4
+ Fri, 08 Jul 2022 11:35:32 GMT - commit 48ce34db70ebc2b4c1be38e6b8b02881be90b9f1
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.0.0-0",
3
+ "version": "3.0.0-1",
4
4
  "description": "Next-generation ES module bundler",
5
5
  "main": "dist/rollup.js",
6
6
  "module": "dist/es/rollup.js",
@@ -20,7 +20,6 @@
20
20
  "lint:nofix": "eslint . && prettier --check \"**/*.md\"",
21
21
  "lint:markdown": "prettier --write \"**/*.md\"",
22
22
  "perf": "npm run build:cjs && node --expose-gc scripts/perf.js",
23
- "perf:debug": "node --inspect-brk scripts/perf-debug.js",
24
23
  "perf:init": "node scripts/perf-init.js",
25
24
  "postpublish": "git push && git push --tags",
26
25
  "prepare": "husky install && npm run build",
@@ -69,8 +68,8 @@
69
68
  "@types/node": "^14.18.21",
70
69
  "@types/signal-exit": "^3.0.1",
71
70
  "@types/yargs-parser": "^21.0.0",
72
- "@typescript-eslint/eslint-plugin": "^5.30.3",
73
- "@typescript-eslint/parser": "^5.30.3",
71
+ "@typescript-eslint/eslint-plugin": "^5.30.5",
72
+ "@typescript-eslint/parser": "^5.30.5",
74
73
  "acorn": "^8.7.1",
75
74
  "acorn-jsx": "^5.3.2",
76
75
  "acorn-walk": "^8.2.0",
@@ -85,7 +84,7 @@
85
84
  "eslint-config-prettier": "^8.5.0",
86
85
  "eslint-plugin-import": "^2.26.0",
87
86
  "eslint-plugin-prettier": "^4.2.1",
88
- "execa": "^5.1.1",
87
+ "execa": "^6.1.0",
89
88
  "fixturify": "^2.1.1",
90
89
  "fs-extra": "^10.1.0",
91
90
  "hash.js": "^1.1.7",
@@ -97,7 +96,7 @@
97
96
  "mocha": "^10.0.0",
98
97
  "nyc": "^15.1.0",
99
98
  "prettier": "^2.7.1",
100
- "pretty-bytes": "^5.6.0",
99
+ "pretty-bytes": "^6.0.0",
101
100
  "pretty-ms": "^8.0.0",
102
101
  "requirejs": "^2.3.6",
103
102
  "rollup": "^2.75.7",