rollup 2.59.0-1 → 2.60.2

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/es/rollup.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v2.59.0-1
4
- Thu, 11 Nov 2021 11:19:43 GMT - commit ba1ac50d6fc8054cca278e04cc5669dbbc96d273
3
+ Rollup.js v2.60.2
4
+ Tue, 30 Nov 2021 05:36:58 GMT - commit 7c9b89fade00a4eb8ea39c6b15ef7d0e6e5739be
5
5
 
6
6
 
7
7
  https://github.com/rollup/rollup
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v2.59.0-1
4
- Thu, 11 Nov 2021 11:19:43 GMT - commit ba1ac50d6fc8054cca278e04cc5669dbbc96d273
3
+ Rollup.js v2.60.2
4
+ Tue, 30 Nov 2021 05:36:58 GMT - commit 7c9b89fade00a4eb8ea39c6b15ef7d0e6e5739be
5
5
 
6
6
 
7
7
  https://github.com/rollup/rollup
@@ -13,7 +13,7 @@ import { createHash as createHash$1 } from 'crypto';
13
13
  import fs, { lstatSync, realpathSync, readdirSync } from 'fs';
14
14
  import { EventEmitter } from 'events';
15
15
 
16
- var version$1 = "2.59.0-1";
16
+ var version$1 = "2.60.2";
17
17
 
18
18
  var charToInteger = {};
19
19
  var chars$1 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
@@ -14454,13 +14454,14 @@ class Chunk {
14454
14454
  const id = this.orderedModules[0].id;
14455
14455
  const sanitizedId = this.outputOptions.sanitizeFileName(id);
14456
14456
  let path;
14457
+ const patternOpt = unsetOptions.has('entryFileNames')
14458
+ ? '[name][assetExtname].js'
14459
+ : options.entryFileNames;
14460
+ const pattern = typeof patternOpt === 'function' ? patternOpt(this.getChunkInfo()) : patternOpt;
14457
14461
  if (isAbsolute(id)) {
14458
- const extension = extname(id);
14459
- const pattern = unsetOptions.has('entryFileNames')
14460
- ? '[name][assetExtname].js'
14461
- : options.entryFileNames;
14462
14462
  const currentDir = dirname(sanitizedId);
14463
- const fileName = renderNamePattern(typeof pattern === 'function' ? pattern(this.getChunkInfo()) : pattern, 'output.entryFileNames', {
14463
+ const extension = extname(id);
14464
+ const fileName = renderNamePattern(pattern, 'output.entryFileNames', {
14464
14465
  assetExtname: () => (NON_ASSET_EXTENSIONS.includes(extension) ? '' : extension),
14465
14466
  ext: () => extension.substr(1),
14466
14467
  extname: () => extension,
@@ -14477,7 +14478,15 @@ class Chunk {
14477
14478
  }
14478
14479
  }
14479
14480
  else {
14480
- path = `_virtual/${basename(sanitizedId)}`;
14481
+ const extension = extname(sanitizedId);
14482
+ const fileName = renderNamePattern(pattern, 'output.entryFileNames', {
14483
+ assetExtname: () => (NON_ASSET_EXTENSIONS.includes(extension) ? '' : extension),
14484
+ ext: () => extension.substr(1),
14485
+ extname: () => extension,
14486
+ format: () => options.format,
14487
+ name: () => getAliasName(sanitizedId)
14488
+ });
14489
+ path = `_virtual/${fileName}`;
14481
14490
  }
14482
14491
  return makeUnique(normalize(path), existingNames);
14483
14492
  }
@@ -14839,11 +14848,11 @@ class Chunk {
14839
14848
  continue;
14840
14849
  }
14841
14850
  const renderedResolution = resolution instanceof Module
14842
- ? `'${this.getRelativePath((facadeChunk || chunk).id, stripKnownJsExtensions)}'`
14851
+ ? `'${escapeId(this.getRelativePath((facadeChunk || chunk).id, stripKnownJsExtensions))}'`
14843
14852
  : resolution instanceof ExternalModule
14844
- ? `'${resolution.renormalizeRenderPath
14853
+ ? `'${escapeId(resolution.renormalizeRenderPath
14845
14854
  ? this.getRelativePath(resolution.renderPath, stripKnownJsExtensions)
14846
- : resolution.renderPath}'`
14855
+ : resolution.renderPath)}'`
14847
14856
  : resolution;
14848
14857
  node.renderFinalResolution(code, renderedResolution, resolution instanceof Module &&
14849
14858
  !(facadeChunk === null || facadeChunk === void 0 ? void 0 : facadeChunk.strictFacade) &&
@@ -23084,12 +23093,15 @@ const getHasModuleSideEffects = (moduleSideEffectsOption, pureExternalModules) =
23084
23093
  return (id, external) => !(external && isPureExternalModule(id));
23085
23094
  };
23086
23095
 
23096
+ // https://datatracker.ietf.org/doc/html/rfc2396
23097
+ // eslint-disable-next-line no-control-regex
23098
+ const INVALID_CHAR_RE = /[\x00-\x1F\x7F<>*#"{}|^[\]`;?:&=+$,]/g;
23087
23099
  function sanitizeFileName(name) {
23088
23100
  const match = /^[a-z]:/i.exec(name);
23089
23101
  const driveLetter = match ? match[0] : '';
23090
23102
  // A `:` is only allowed as part of a windows drive letter (ex: C:\foo)
23091
23103
  // Otherwise, avoid them because they can refer to NTFS alternate data streams.
23092
- return driveLetter + name.substr(driveLetter.length).replace(/[\0?*:]/g, '_');
23104
+ return driveLetter + name.substr(driveLetter.length).replace(INVALID_CHAR_RE, '_');
23093
23105
  }
23094
23106
 
23095
23107
  function normalizeOutputOptions(config, inputOptions, unsetInputOptions) {
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v2.59.0-1
4
- Thu, 11 Nov 2021 11:19:43 GMT - commit ba1ac50d6fc8054cca278e04cc5669dbbc96d273
3
+ Rollup.js v2.60.2
4
+ Tue, 30 Nov 2021 05:36:58 GMT - commit 7c9b89fade00a4eb8ea39c6b15ef7d0e6e5739be
5
5
 
6
6
 
7
7
  https://github.com/rollup/rollup
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v2.59.0-1
4
- Thu, 11 Nov 2021 11:19:43 GMT - commit ba1ac50d6fc8054cca278e04cc5669dbbc96d273
3
+ Rollup.js v2.60.2
4
+ Tue, 30 Nov 2021 05:36:58 GMT - commit 7c9b89fade00a4eb8ea39c6b15ef7d0e6e5739be
5
5
 
6
6
 
7
7
  https://github.com/rollup/rollup