rollup 2.78.1 → 2.79.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
@@ -631,6 +631,7 @@ export type AmdOptions = (
631
631
  }
632
632
  ) & {
633
633
  define?: string;
634
+ forceJsExtensionForImports?: boolean;
634
635
  };
635
636
 
636
637
  export type NormalizedAmdOptions = (
@@ -644,6 +645,7 @@ export type NormalizedAmdOptions = (
644
645
  }
645
646
  ) & {
646
647
  define: string;
648
+ forceJsExtensionForImports: boolean;
647
649
  };
648
650
 
649
651
  export interface OutputOptions {
package/dist/rollup.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v2.78.1
4
- Fri, 19 Aug 2022 05:19:43 GMT - commit 398d0c4970b679795025f36e320f8aecb2859d24
3
+ Rollup.js v2.79.0
4
+ Wed, 31 Aug 2022 04:52:13 GMT - commit 8477f8ff1fe80086556021542b22942ad27a0a69
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v2.78.1
4
- Fri, 19 Aug 2022 05:19:43 GMT - commit 398d0c4970b679795025f36e320f8aecb2859d24
3
+ Rollup.js v2.79.0
4
+ Wed, 31 Aug 2022 04:52:13 GMT - commit 8477f8ff1fe80086556021542b22942ad27a0a69
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v2.78.1
4
- Fri, 19 Aug 2022 05:19:43 GMT - commit 398d0c4970b679795025f36e320f8aecb2859d24
3
+ Rollup.js v2.79.0
4
+ Wed, 31 Aug 2022 04:52:13 GMT - commit 8477f8ff1fe80086556021542b22942ad27a0a69
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v2.78.1
4
- Fri, 19 Aug 2022 05:19:43 GMT - commit 398d0c4970b679795025f36e320f8aecb2859d24
3
+ Rollup.js v2.79.0
4
+ Wed, 31 Aug 2022 04:52:13 GMT - commit 8477f8ff1fe80086556021542b22942ad27a0a69
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v2.78.1
4
- Fri, 19 Aug 2022 05:19:43 GMT - commit 398d0c4970b679795025f36e320f8aecb2859d24
3
+ Rollup.js v2.79.0
4
+ Wed, 31 Aug 2022 04:52:13 GMT - commit 8477f8ff1fe80086556021542b22942ad27a0a69
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.78.1";
30
+ var version$1 = "2.79.0";
31
31
 
32
32
  function ensureArray$1(items) {
33
33
  if (Array.isArray(items)) {
@@ -13446,11 +13446,18 @@ function getInteropBlock(dependencies, interop, externalLiveBindings, freeze, na
13446
13446
  return `${getHelpersBlock(neededInteropHelpers, accessedGlobals, indent, snippets, externalLiveBindings, freeze, namespaceToStringTag)}${interopStatements.length > 0 ? `${interopStatements.join(n)}${n}${n}` : ''}`;
13447
13447
  }
13448
13448
 
13449
+ function addJsExtension(name) {
13450
+ return name.endsWith('.js') ? name : name + '.js';
13451
+ }
13452
+
13449
13453
  // AMD resolution will only respect the AMD baseUrl if the .js extension is omitted.
13450
13454
  // The assumption is that this makes sense for all relative ids:
13451
13455
  // https://requirejs.org/docs/api.html#jsfiles
13452
- function removeExtensionFromRelativeAmdId(id) {
13453
- return id[0] === '.' ? removeJsExtension(id) : id;
13456
+ function updateExtensionForRelativeAmdId(id, forceJsExtensionForImports) {
13457
+ if (id[0] !== '.') {
13458
+ return id;
13459
+ }
13460
+ return forceJsExtensionForImports ? addJsExtension(id) : removeJsExtension(id);
13454
13461
  }
13455
13462
 
13456
13463
  const builtins = {
@@ -13489,7 +13496,7 @@ function warnOnBuiltins(warn, dependencies) {
13489
13496
 
13490
13497
  function amd(magicString, { accessedGlobals, dependencies, exports, hasExports, id, indent: t, intro, isEntryFacade, isModuleFacade, namedExportsMode, outro, snippets, warn }, { amd, esModule, externalLiveBindings, freeze, interop, namespaceToStringTag, strict }) {
13491
13498
  warnOnBuiltins(warn, dependencies);
13492
- const deps = dependencies.map(m => `'${removeExtensionFromRelativeAmdId(m.id)}'`);
13499
+ const deps = dependencies.map(m => `'${updateExtensionForRelativeAmdId(m.id, amd.forceJsExtensionForImports)}'`);
13493
13500
  const args = dependencies.map(m => m.name);
13494
13501
  const { n, getNonArrowFunctionIntro, _ } = snippets;
13495
13502
  if (namedExportsMode && hasExports) {
@@ -13933,7 +13940,7 @@ function umd(magicString, { accessedGlobals, dependencies, exports, hasExports,
13933
13940
  });
13934
13941
  }
13935
13942
  warnOnBuiltins(warn, dependencies);
13936
- const amdDeps = dependencies.map(m => `'${removeExtensionFromRelativeAmdId(m.id)}'`);
13943
+ const amdDeps = dependencies.map(m => `'${updateExtensionForRelativeAmdId(m.id, amd.forceJsExtensionForImports)}'`);
13937
13944
  const cjsDeps = dependencies.map(m => `require('${m.id}')`);
13938
13945
  const trimmedImports = trimEmptyImports(dependencies);
13939
13946
  const globalDeps = trimmedImports.map(module => globalProp(module.globalName, globalVar, getPropertyAccess));
@@ -15140,7 +15147,7 @@ class Chunk {
15140
15147
  }
15141
15148
  }
15142
15149
  finaliseDynamicImports(options, snippets) {
15143
- const stripKnownJsExtensions = options.format === 'amd';
15150
+ const stripKnownJsExtensions = options.format === 'amd' && !options.amd.forceJsExtensionForImports;
15144
15151
  for (const [module, code] of this.renderedModuleSources) {
15145
15152
  for (const { node, resolution } of module.dynamicImports) {
15146
15153
  const chunk = this.chunkByModule.get(resolution);
@@ -23561,6 +23568,7 @@ const getAmd = (config) => {
23561
23568
  autoId: false,
23562
23569
  basePath: '',
23563
23570
  define: 'define',
23571
+ forceJsExtensionForImports: false,
23564
23572
  ...config.amd
23565
23573
  };
23566
23574
  if ((mergedOption.autoId || mergedOption.basePath) && mergedOption.id) {
@@ -23574,13 +23582,15 @@ const getAmd = (config) => {
23574
23582
  normalized = {
23575
23583
  autoId: true,
23576
23584
  basePath: mergedOption.basePath,
23577
- define: mergedOption.define
23585
+ define: mergedOption.define,
23586
+ forceJsExtensionForImports: mergedOption.forceJsExtensionForImports
23578
23587
  };
23579
23588
  }
23580
23589
  else {
23581
23590
  normalized = {
23582
23591
  autoId: false,
23583
23592
  define: mergedOption.define,
23593
+ forceJsExtensionForImports: mergedOption.forceJsExtensionForImports,
23584
23594
  id: mergedOption.id
23585
23595
  };
23586
23596
  }
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v2.78.1
4
- Fri, 19 Aug 2022 05:19:43 GMT - commit 398d0c4970b679795025f36e320f8aecb2859d24
3
+ Rollup.js v2.79.0
4
+ Wed, 31 Aug 2022 04:52:13 GMT - commit 8477f8ff1fe80086556021542b22942ad27a0a69
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v2.78.1
4
- Fri, 19 Aug 2022 05:19:43 GMT - commit 398d0c4970b679795025f36e320f8aecb2859d24
3
+ Rollup.js v2.79.0
4
+ Wed, 31 Aug 2022 04:52:13 GMT - commit 8477f8ff1fe80086556021542b22942ad27a0a69
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.78.1",
3
+ "version": "2.79.0",
4
4
  "description": "Next-generation ES module bundler",
5
5
  "main": "dist/rollup.js",
6
6
  "module": "dist/es/rollup.js",