diff --git a/src/Chunk.ts b/src/Chunk.ts index a19b881048f..2b6d2e7279a 100644 --- a/src/Chunk.ts +++ b/src/Chunk.ts @@ -433,7 +433,7 @@ export default class Chunk { unsetOptions: ReadonlySet ): string { const [{ id }] = this.orderedModules; - const sanitizedId = this.outputOptions.sanitizeFileName(id); + const sanitizedId = this.outputOptions.sanitizeFileName(id.split(QUERY_HASH_REGEX, 1)[0]); let path: string; const patternOpt = unsetOptions.has('entryFileNames') @@ -441,9 +441,9 @@ export default class Chunk { : options.entryFileNames; const pattern = typeof patternOpt === 'function' ? patternOpt(this.getChunkInfo()) : patternOpt; - if (isAbsolute(id)) { + if (isAbsolute(sanitizedId)) { const currentDir = dirname(sanitizedId); - const extension = extname(id); + const extension = extname(sanitizedId); const fileName = renderNamePattern(pattern, 'output.entryFileNames', { assetExtname: () => (NON_ASSET_EXTENSIONS.includes(extension) ? '' : extension), ext: () => extension.substr(1), @@ -1400,3 +1400,5 @@ export default class Chunk { function getChunkNameFromModule(module: Module): string { return module.chunkName || getAliasName(module.id); } + +const QUERY_HASH_REGEX = /[?#]/; diff --git a/src/utils/sanitizeFileName.ts b/src/utils/sanitizeFileName.ts index 17585c3e2ba..26c0b328dad 100644 --- a/src/utils/sanitizeFileName.ts +++ b/src/utils/sanitizeFileName.ts @@ -1,12 +1,13 @@ // https://datatracker.ietf.org/doc/html/rfc2396 // eslint-disable-next-line no-control-regex -const INVALID_CHAR_RE = /[\x00-\x1F\x7F<>*#"{}|^[\]`;?:&=+$,]/g; +const INVALID_CHAR_REGEX = /[\x00-\x1F\x7F<>*#"{}|^[\]`;?:&=+$,]/g; +const DRIVE_LETTER_REGEX = /^[a-z]:/i; export function sanitizeFileName(name: string): string { - const match = /^[a-z]:/i.exec(name); + const match = DRIVE_LETTER_REGEX.exec(name); const driveLetter = match ? match[0] : ''; // A `:` is only allowed as part of a windows drive letter (ex: C:\foo) // Otherwise, avoid them because they can refer to NTFS alternate data streams. - return driveLetter + name.substr(driveLetter.length).replace(INVALID_CHAR_RE, '_'); + return driveLetter + name.substr(driveLetter.length).replace(INVALID_CHAR_REGEX, '_'); } diff --git a/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/amd/_virtual/other.js_commonjs-exports.js b/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/amd/_virtual/other.js similarity index 100% rename from test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/amd/_virtual/other.js_commonjs-exports.js rename to test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/amd/_virtual/other.js diff --git a/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/amd/commonjs.js b/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/amd/commonjs.js index 2f04c4bb52f..5cafaba6aea 100644 --- a/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/amd/commonjs.js +++ b/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/amd/commonjs.js @@ -1,4 +1,4 @@ -define(['external', './other', './_virtual/other.js_commonjs-exports'], (function (require$$0, other$1, other) { 'use strict'; +define(['external', './other', './_virtual/other'], (function (require$$0, other$1, other) { 'use strict'; function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } diff --git a/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/amd/other.js b/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/amd/other.js index 9bab1e318f1..8697215bcc9 100644 --- a/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/amd/other.js +++ b/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/amd/other.js @@ -1,4 +1,4 @@ -define(['./_virtual/other.js_commonjs-exports'], (function (other) { 'use strict'; +define(['./_virtual/other'], (function (other) { 'use strict'; other.__exports.value = 43; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/cjs/_virtual/other.js_commonjs-exports.js b/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/cjs/_virtual/other.js similarity index 100% rename from test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/cjs/_virtual/other.js_commonjs-exports.js rename to test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/cjs/_virtual/other.js diff --git a/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/cjs/commonjs.js b/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/cjs/commonjs.js index 4f3a50071b2..8faed0cd91f 100644 --- a/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/cjs/commonjs.js +++ b/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/cjs/commonjs.js @@ -2,7 +2,7 @@ var require$$0 = require('external'); require('./other.js'); -var other = require('./_virtual/other.js_commonjs-exports.js'); +var other = require('./_virtual/other.js'); function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } diff --git a/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/cjs/other.js b/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/cjs/other.js index 0c28672ba27..b2e2e3e12a4 100644 --- a/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/cjs/other.js +++ b/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/cjs/other.js @@ -1,6 +1,6 @@ 'use strict'; -var other = require('./_virtual/other.js_commonjs-exports.js'); +var other = require('./_virtual/other.js'); other.__exports.value = 43; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/es/_virtual/other.js_commonjs-exports.js b/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/es/_virtual/other.js similarity index 100% rename from test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/es/_virtual/other.js_commonjs-exports.js rename to test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/es/_virtual/other.js diff --git a/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/es/commonjs.js b/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/es/commonjs.js index 643dfd6b0ac..6632adbe174 100644 --- a/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/es/commonjs.js +++ b/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/es/commonjs.js @@ -1,6 +1,6 @@ import require$$0 from 'external'; import './other.js'; -import { __exports as other } from './_virtual/other.js_commonjs-exports.js'; +import { __exports as other } from './_virtual/other.js'; const external = require$$0; const { value } = other; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/es/other.js b/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/es/other.js index 180a5f6c9d5..5f0ad225f2e 100644 --- a/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/es/other.js +++ b/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/es/other.js @@ -1,4 +1,4 @@ -import { __exports as other } from './_virtual/other.js_commonjs-exports.js'; -export { __exports as default } from './_virtual/other.js_commonjs-exports.js'; +import { __exports as other } from './_virtual/other.js'; +export { __exports as default } from './_virtual/other.js'; other.value = 43; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/system/_virtual/other.js_commonjs-exports.js b/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/system/_virtual/other.js similarity index 100% rename from test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/system/_virtual/other.js_commonjs-exports.js rename to test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/system/_virtual/other.js diff --git a/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/system/commonjs.js b/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/system/commonjs.js index e5183e581cc..fc1e2ddf4d7 100644 --- a/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/system/commonjs.js +++ b/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/system/commonjs.js @@ -1,4 +1,4 @@ -System.register(['external', './other.js', './_virtual/other.js_commonjs-exports.js'], (function (exports) { +System.register(['external', './other.js', './_virtual/other.js'], (function (exports) { 'use strict'; var require$$0, other; return { diff --git a/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/system/other.js b/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/system/other.js index 6fd8ed491ce..1f428fbcf18 100644 --- a/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/system/other.js +++ b/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/system/other.js @@ -1,4 +1,4 @@ -System.register(['./_virtual/other.js_commonjs-exports.js'], (function (exports) { +System.register(['./_virtual/other.js'], (function (exports) { 'use strict'; var other; return { diff --git a/test/chunking-form/samples/ignore-chunk-name-query/_config.js b/test/chunking-form/samples/ignore-chunk-name-query/_config.js new file mode 100644 index 00000000000..2109243a262 --- /dev/null +++ b/test/chunking-form/samples/ignore-chunk-name-query/_config.js @@ -0,0 +1,15 @@ +const { loader } = require('../../../utils.js'); + +module.exports = { + description: 'ignores queries and hashes for chunk names when preserving modules', + options: { + input: ['a.js?query', 'b.js#hash'], + output: { preserveModules: true }, + plugins: [ + loader({ + 'a.js?query': "console.log('a');", + 'b.js#hash': "console.log('b');" + }) + ] + } +}; diff --git a/test/chunking-form/samples/ignore-chunk-name-query/_expected/amd/_virtual/a.js b/test/chunking-form/samples/ignore-chunk-name-query/_expected/amd/_virtual/a.js new file mode 100644 index 00000000000..6d0638c63e4 --- /dev/null +++ b/test/chunking-form/samples/ignore-chunk-name-query/_expected/amd/_virtual/a.js @@ -0,0 +1,5 @@ +define((function () { 'use strict'; + + console.log('a'); + +})); diff --git a/test/chunking-form/samples/ignore-chunk-name-query/_expected/amd/_virtual/b.js b/test/chunking-form/samples/ignore-chunk-name-query/_expected/amd/_virtual/b.js new file mode 100644 index 00000000000..b8ffc59b2da --- /dev/null +++ b/test/chunking-form/samples/ignore-chunk-name-query/_expected/amd/_virtual/b.js @@ -0,0 +1,5 @@ +define((function () { 'use strict'; + + console.log('b'); + +})); diff --git a/test/chunking-form/samples/ignore-chunk-name-query/_expected/cjs/_virtual/a.js b/test/chunking-form/samples/ignore-chunk-name-query/_expected/cjs/_virtual/a.js new file mode 100644 index 00000000000..4151e09bdbf --- /dev/null +++ b/test/chunking-form/samples/ignore-chunk-name-query/_expected/cjs/_virtual/a.js @@ -0,0 +1,3 @@ +'use strict'; + +console.log('a'); diff --git a/test/chunking-form/samples/ignore-chunk-name-query/_expected/cjs/_virtual/b.js b/test/chunking-form/samples/ignore-chunk-name-query/_expected/cjs/_virtual/b.js new file mode 100644 index 00000000000..099afa3ff4c --- /dev/null +++ b/test/chunking-form/samples/ignore-chunk-name-query/_expected/cjs/_virtual/b.js @@ -0,0 +1,3 @@ +'use strict'; + +console.log('b'); diff --git a/test/chunking-form/samples/ignore-chunk-name-query/_expected/es/_virtual/a.js b/test/chunking-form/samples/ignore-chunk-name-query/_expected/es/_virtual/a.js new file mode 100644 index 00000000000..8609d075540 --- /dev/null +++ b/test/chunking-form/samples/ignore-chunk-name-query/_expected/es/_virtual/a.js @@ -0,0 +1 @@ +console.log('a'); diff --git a/test/chunking-form/samples/ignore-chunk-name-query/_expected/es/_virtual/b.js b/test/chunking-form/samples/ignore-chunk-name-query/_expected/es/_virtual/b.js new file mode 100644 index 00000000000..eeb313a0347 --- /dev/null +++ b/test/chunking-form/samples/ignore-chunk-name-query/_expected/es/_virtual/b.js @@ -0,0 +1 @@ +console.log('b'); diff --git a/test/chunking-form/samples/ignore-chunk-name-query/_expected/system/_virtual/a.js b/test/chunking-form/samples/ignore-chunk-name-query/_expected/system/_virtual/a.js new file mode 100644 index 00000000000..2859a1e855c --- /dev/null +++ b/test/chunking-form/samples/ignore-chunk-name-query/_expected/system/_virtual/a.js @@ -0,0 +1,10 @@ +System.register([], (function () { + 'use strict'; + return { + execute: (function () { + + console.log('a'); + + }) + }; +})); diff --git a/test/chunking-form/samples/ignore-chunk-name-query/_expected/system/_virtual/b.js b/test/chunking-form/samples/ignore-chunk-name-query/_expected/system/_virtual/b.js new file mode 100644 index 00000000000..17b43387a91 --- /dev/null +++ b/test/chunking-form/samples/ignore-chunk-name-query/_expected/system/_virtual/b.js @@ -0,0 +1,10 @@ +System.register([], (function () { + 'use strict'; + return { + execute: (function () { + + console.log('b'); + + }) + }; +})); diff --git a/test/chunking-form/samples/preserve-modules-commonjs/_expected/amd/_virtual/other.js_commonjs-exports.js b/test/chunking-form/samples/preserve-modules-commonjs/_expected/amd/_virtual/other.js similarity index 100% rename from test/chunking-form/samples/preserve-modules-commonjs/_expected/amd/_virtual/other.js_commonjs-exports.js rename to test/chunking-form/samples/preserve-modules-commonjs/_expected/amd/_virtual/other.js diff --git a/test/chunking-form/samples/preserve-modules-commonjs/_expected/amd/commonjs.js b/test/chunking-form/samples/preserve-modules-commonjs/_expected/amd/commonjs.js index 2f04c4bb52f..5cafaba6aea 100644 --- a/test/chunking-form/samples/preserve-modules-commonjs/_expected/amd/commonjs.js +++ b/test/chunking-form/samples/preserve-modules-commonjs/_expected/amd/commonjs.js @@ -1,4 +1,4 @@ -define(['external', './other', './_virtual/other.js_commonjs-exports'], (function (require$$0, other$1, other) { 'use strict'; +define(['external', './other', './_virtual/other'], (function (require$$0, other$1, other) { 'use strict'; function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } diff --git a/test/chunking-form/samples/preserve-modules-commonjs/_expected/amd/other.js b/test/chunking-form/samples/preserve-modules-commonjs/_expected/amd/other.js index 9bab1e318f1..8697215bcc9 100644 --- a/test/chunking-form/samples/preserve-modules-commonjs/_expected/amd/other.js +++ b/test/chunking-form/samples/preserve-modules-commonjs/_expected/amd/other.js @@ -1,4 +1,4 @@ -define(['./_virtual/other.js_commonjs-exports'], (function (other) { 'use strict'; +define(['./_virtual/other'], (function (other) { 'use strict'; other.__exports.value = 43; diff --git a/test/chunking-form/samples/preserve-modules-commonjs/_expected/cjs/_virtual/other.js_commonjs-exports.js b/test/chunking-form/samples/preserve-modules-commonjs/_expected/cjs/_virtual/other.js similarity index 100% rename from test/chunking-form/samples/preserve-modules-commonjs/_expected/cjs/_virtual/other.js_commonjs-exports.js rename to test/chunking-form/samples/preserve-modules-commonjs/_expected/cjs/_virtual/other.js diff --git a/test/chunking-form/samples/preserve-modules-commonjs/_expected/cjs/commonjs.js b/test/chunking-form/samples/preserve-modules-commonjs/_expected/cjs/commonjs.js index 4f3a50071b2..8faed0cd91f 100644 --- a/test/chunking-form/samples/preserve-modules-commonjs/_expected/cjs/commonjs.js +++ b/test/chunking-form/samples/preserve-modules-commonjs/_expected/cjs/commonjs.js @@ -2,7 +2,7 @@ var require$$0 = require('external'); require('./other.js'); -var other = require('./_virtual/other.js_commonjs-exports.js'); +var other = require('./_virtual/other.js'); function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } diff --git a/test/chunking-form/samples/preserve-modules-commonjs/_expected/cjs/other.js b/test/chunking-form/samples/preserve-modules-commonjs/_expected/cjs/other.js index 0c28672ba27..b2e2e3e12a4 100644 --- a/test/chunking-form/samples/preserve-modules-commonjs/_expected/cjs/other.js +++ b/test/chunking-form/samples/preserve-modules-commonjs/_expected/cjs/other.js @@ -1,6 +1,6 @@ 'use strict'; -var other = require('./_virtual/other.js_commonjs-exports.js'); +var other = require('./_virtual/other.js'); other.__exports.value = 43; diff --git a/test/chunking-form/samples/preserve-modules-commonjs/_expected/es/_virtual/other.js_commonjs-exports.js b/test/chunking-form/samples/preserve-modules-commonjs/_expected/es/_virtual/other.js similarity index 100% rename from test/chunking-form/samples/preserve-modules-commonjs/_expected/es/_virtual/other.js_commonjs-exports.js rename to test/chunking-form/samples/preserve-modules-commonjs/_expected/es/_virtual/other.js diff --git a/test/chunking-form/samples/preserve-modules-commonjs/_expected/es/commonjs.js b/test/chunking-form/samples/preserve-modules-commonjs/_expected/es/commonjs.js index 643dfd6b0ac..6632adbe174 100644 --- a/test/chunking-form/samples/preserve-modules-commonjs/_expected/es/commonjs.js +++ b/test/chunking-form/samples/preserve-modules-commonjs/_expected/es/commonjs.js @@ -1,6 +1,6 @@ import require$$0 from 'external'; import './other.js'; -import { __exports as other } from './_virtual/other.js_commonjs-exports.js'; +import { __exports as other } from './_virtual/other.js'; const external = require$$0; const { value } = other; diff --git a/test/chunking-form/samples/preserve-modules-commonjs/_expected/es/other.js b/test/chunking-form/samples/preserve-modules-commonjs/_expected/es/other.js index 180a5f6c9d5..5f0ad225f2e 100644 --- a/test/chunking-form/samples/preserve-modules-commonjs/_expected/es/other.js +++ b/test/chunking-form/samples/preserve-modules-commonjs/_expected/es/other.js @@ -1,4 +1,4 @@ -import { __exports as other } from './_virtual/other.js_commonjs-exports.js'; -export { __exports as default } from './_virtual/other.js_commonjs-exports.js'; +import { __exports as other } from './_virtual/other.js'; +export { __exports as default } from './_virtual/other.js'; other.value = 43; diff --git a/test/chunking-form/samples/preserve-modules-commonjs/_expected/system/_virtual/other.js_commonjs-exports.js b/test/chunking-form/samples/preserve-modules-commonjs/_expected/system/_virtual/other.js similarity index 100% rename from test/chunking-form/samples/preserve-modules-commonjs/_expected/system/_virtual/other.js_commonjs-exports.js rename to test/chunking-form/samples/preserve-modules-commonjs/_expected/system/_virtual/other.js diff --git a/test/chunking-form/samples/preserve-modules-commonjs/_expected/system/commonjs.js b/test/chunking-form/samples/preserve-modules-commonjs/_expected/system/commonjs.js index e5183e581cc..fc1e2ddf4d7 100644 --- a/test/chunking-form/samples/preserve-modules-commonjs/_expected/system/commonjs.js +++ b/test/chunking-form/samples/preserve-modules-commonjs/_expected/system/commonjs.js @@ -1,4 +1,4 @@ -System.register(['external', './other.js', './_virtual/other.js_commonjs-exports.js'], (function (exports) { +System.register(['external', './other.js', './_virtual/other.js'], (function (exports) { 'use strict'; var require$$0, other; return { diff --git a/test/chunking-form/samples/preserve-modules-commonjs/_expected/system/other.js b/test/chunking-form/samples/preserve-modules-commonjs/_expected/system/other.js index 6fd8ed491ce..1f428fbcf18 100644 --- a/test/chunking-form/samples/preserve-modules-commonjs/_expected/system/other.js +++ b/test/chunking-form/samples/preserve-modules-commonjs/_expected/system/other.js @@ -1,4 +1,4 @@ -System.register(['./_virtual/other.js_commonjs-exports.js'], (function (exports) { +System.register(['./_virtual/other.js'], (function (exports) { 'use strict'; var other; return { diff --git a/test/chunking-form/samples/preserve-modules-root/_expected/amd/_virtual/index.js_commonjs-exports.js b/test/chunking-form/samples/preserve-modules-root/_expected/amd/_virtual/index.js similarity index 100% rename from test/chunking-form/samples/preserve-modules-root/_expected/amd/_virtual/index.js_commonjs-exports.js rename to test/chunking-form/samples/preserve-modules-root/_expected/amd/_virtual/index.js diff --git a/test/chunking-form/samples/preserve-modules-root/_expected/amd/below/module.js b/test/chunking-form/samples/preserve-modules-root/_expected/amd/below/module.js index d7f24ed28b3..f7d74d9dd53 100644 --- a/test/chunking-form/samples/preserve-modules-root/_expected/amd/below/module.js +++ b/test/chunking-form/samples/preserve-modules-root/_expected/amd/below/module.js @@ -1,4 +1,4 @@ -define(['../custom_modules/@my-scope/my-base-pkg/index', '../_virtual/index.js_commonjs-exports'], (function (index$1, index) { 'use strict'; +define(['../custom_modules/@my-scope/my-base-pkg/index', '../_virtual/index'], (function (index$1, index) { 'use strict'; const base2 = index.__exports; diff --git a/test/chunking-form/samples/preserve-modules-root/_expected/amd/custom_modules/@my-scope/my-base-pkg/index.js b/test/chunking-form/samples/preserve-modules-root/_expected/amd/custom_modules/@my-scope/my-base-pkg/index.js index 9b6a8c65c54..439233ad98a 100644 --- a/test/chunking-form/samples/preserve-modules-root/_expected/amd/custom_modules/@my-scope/my-base-pkg/index.js +++ b/test/chunking-form/samples/preserve-modules-root/_expected/amd/custom_modules/@my-scope/my-base-pkg/index.js @@ -1,4 +1,4 @@ -define(['../../../_virtual/index.js_commonjs-exports'], (function (index) { 'use strict'; +define(['../../../_virtual/index'], (function (index) { 'use strict'; Object.defineProperty(index.__exports, '__esModule', { value: true }); diff --git a/test/chunking-form/samples/preserve-modules-root/_expected/amd/under-build.js b/test/chunking-form/samples/preserve-modules-root/_expected/amd/under-build.js index cd68ea9b919..d11aee4fca3 100644 --- a/test/chunking-form/samples/preserve-modules-root/_expected/amd/under-build.js +++ b/test/chunking-form/samples/preserve-modules-root/_expected/amd/under-build.js @@ -1,4 +1,4 @@ -define(['./custom_modules/@my-scope/my-base-pkg/index', './_virtual/index.js_commonjs-exports'], (function (index$1, index) { 'use strict'; +define(['./custom_modules/@my-scope/my-base-pkg/index', './_virtual/index'], (function (index$1, index) { 'use strict'; const base = index.__exports; diff --git a/test/chunking-form/samples/preserve-modules-root/_expected/cjs/_virtual/index.js_commonjs-exports.js b/test/chunking-form/samples/preserve-modules-root/_expected/cjs/_virtual/index.js similarity index 100% rename from test/chunking-form/samples/preserve-modules-root/_expected/cjs/_virtual/index.js_commonjs-exports.js rename to test/chunking-form/samples/preserve-modules-root/_expected/cjs/_virtual/index.js diff --git a/test/chunking-form/samples/preserve-modules-root/_expected/cjs/below/module.js b/test/chunking-form/samples/preserve-modules-root/_expected/cjs/below/module.js index 24502570011..ae312b63c08 100644 --- a/test/chunking-form/samples/preserve-modules-root/_expected/cjs/below/module.js +++ b/test/chunking-form/samples/preserve-modules-root/_expected/cjs/below/module.js @@ -1,7 +1,7 @@ 'use strict'; require('../custom_modules/@my-scope/my-base-pkg/index.js'); -var index = require('../_virtual/index.js_commonjs-exports.js'); +var index = require('../_virtual/index.js'); const base2 = index.__exports; diff --git a/test/chunking-form/samples/preserve-modules-root/_expected/cjs/custom_modules/@my-scope/my-base-pkg/index.js b/test/chunking-form/samples/preserve-modules-root/_expected/cjs/custom_modules/@my-scope/my-base-pkg/index.js index 5766b8f61f1..a74ab37e2ae 100644 --- a/test/chunking-form/samples/preserve-modules-root/_expected/cjs/custom_modules/@my-scope/my-base-pkg/index.js +++ b/test/chunking-form/samples/preserve-modules-root/_expected/cjs/custom_modules/@my-scope/my-base-pkg/index.js @@ -1,6 +1,6 @@ 'use strict'; -var index = require('../../../_virtual/index.js_commonjs-exports.js'); +var index = require('../../../_virtual/index.js'); Object.defineProperty(index.__exports, '__esModule', { value: true }); diff --git a/test/chunking-form/samples/preserve-modules-root/_expected/cjs/under-build.js b/test/chunking-form/samples/preserve-modules-root/_expected/cjs/under-build.js index dc269d6be5c..d339833afed 100644 --- a/test/chunking-form/samples/preserve-modules-root/_expected/cjs/under-build.js +++ b/test/chunking-form/samples/preserve-modules-root/_expected/cjs/under-build.js @@ -1,7 +1,7 @@ 'use strict'; require('./custom_modules/@my-scope/my-base-pkg/index.js'); -var index = require('./_virtual/index.js_commonjs-exports.js'); +var index = require('./_virtual/index.js'); const base = index.__exports; diff --git a/test/chunking-form/samples/preserve-modules-root/_expected/es/_virtual/index.js_commonjs-exports.js b/test/chunking-form/samples/preserve-modules-root/_expected/es/_virtual/index.js similarity index 100% rename from test/chunking-form/samples/preserve-modules-root/_expected/es/_virtual/index.js_commonjs-exports.js rename to test/chunking-form/samples/preserve-modules-root/_expected/es/_virtual/index.js diff --git a/test/chunking-form/samples/preserve-modules-root/_expected/es/below/module.js b/test/chunking-form/samples/preserve-modules-root/_expected/es/below/module.js index 594640e5d5a..19c26654230 100644 --- a/test/chunking-form/samples/preserve-modules-root/_expected/es/below/module.js +++ b/test/chunking-form/samples/preserve-modules-root/_expected/es/below/module.js @@ -1,5 +1,5 @@ import '../custom_modules/@my-scope/my-base-pkg/index.js'; -import { __exports as myBasePkg } from '../_virtual/index.js_commonjs-exports.js'; +import { __exports as myBasePkg } from '../_virtual/index.js'; const base2 = myBasePkg; diff --git a/test/chunking-form/samples/preserve-modules-root/_expected/es/custom_modules/@my-scope/my-base-pkg/index.js b/test/chunking-form/samples/preserve-modules-root/_expected/es/custom_modules/@my-scope/my-base-pkg/index.js index d77cdc8b84e..1a37c8356d7 100644 --- a/test/chunking-form/samples/preserve-modules-root/_expected/es/custom_modules/@my-scope/my-base-pkg/index.js +++ b/test/chunking-form/samples/preserve-modules-root/_expected/es/custom_modules/@my-scope/my-base-pkg/index.js @@ -1,5 +1,5 @@ -import { __exports as myBasePkg } from '../../../_virtual/index.js_commonjs-exports.js'; -export { __exports as default } from '../../../_virtual/index.js_commonjs-exports.js'; +import { __exports as myBasePkg } from '../../../_virtual/index.js'; +export { __exports as default } from '../../../_virtual/index.js'; Object.defineProperty(myBasePkg, '__esModule', { value: true }); diff --git a/test/chunking-form/samples/preserve-modules-root/_expected/es/under-build.js b/test/chunking-form/samples/preserve-modules-root/_expected/es/under-build.js index 4bc029cb9f9..d77ebf7a083 100644 --- a/test/chunking-form/samples/preserve-modules-root/_expected/es/under-build.js +++ b/test/chunking-form/samples/preserve-modules-root/_expected/es/under-build.js @@ -1,5 +1,5 @@ import './custom_modules/@my-scope/my-base-pkg/index.js'; -import { __exports as myBasePkg } from './_virtual/index.js_commonjs-exports.js'; +import { __exports as myBasePkg } from './_virtual/index.js'; const base = myBasePkg; diff --git a/test/chunking-form/samples/preserve-modules-root/_expected/system/_virtual/index.js_commonjs-exports.js b/test/chunking-form/samples/preserve-modules-root/_expected/system/_virtual/index.js similarity index 100% rename from test/chunking-form/samples/preserve-modules-root/_expected/system/_virtual/index.js_commonjs-exports.js rename to test/chunking-form/samples/preserve-modules-root/_expected/system/_virtual/index.js diff --git a/test/chunking-form/samples/preserve-modules-root/_expected/system/below/module.js b/test/chunking-form/samples/preserve-modules-root/_expected/system/below/module.js index baeb375c26d..03357287d14 100644 --- a/test/chunking-form/samples/preserve-modules-root/_expected/system/below/module.js +++ b/test/chunking-form/samples/preserve-modules-root/_expected/system/below/module.js @@ -1,4 +1,4 @@ -System.register(['../custom_modules/@my-scope/my-base-pkg/index.js', '../_virtual/index.js_commonjs-exports.js'], (function (exports) { +System.register(['../custom_modules/@my-scope/my-base-pkg/index.js', '../_virtual/index.js'], (function (exports) { 'use strict'; var myBasePkg; return { diff --git a/test/chunking-form/samples/preserve-modules-root/_expected/system/custom_modules/@my-scope/my-base-pkg/index.js b/test/chunking-form/samples/preserve-modules-root/_expected/system/custom_modules/@my-scope/my-base-pkg/index.js index 6151b15c986..8e5d7eb8288 100644 --- a/test/chunking-form/samples/preserve-modules-root/_expected/system/custom_modules/@my-scope/my-base-pkg/index.js +++ b/test/chunking-form/samples/preserve-modules-root/_expected/system/custom_modules/@my-scope/my-base-pkg/index.js @@ -1,4 +1,4 @@ -System.register(['../../../_virtual/index.js_commonjs-exports.js'], (function (exports) { +System.register(['../../../_virtual/index.js'], (function (exports) { 'use strict'; var myBasePkg; return { diff --git a/test/chunking-form/samples/preserve-modules-root/_expected/system/under-build.js b/test/chunking-form/samples/preserve-modules-root/_expected/system/under-build.js index ff4a383d998..cb3b070d21d 100644 --- a/test/chunking-form/samples/preserve-modules-root/_expected/system/under-build.js +++ b/test/chunking-form/samples/preserve-modules-root/_expected/system/under-build.js @@ -1,4 +1,4 @@ -System.register(['./custom_modules/@my-scope/my-base-pkg/index.js', './_virtual/index.js_commonjs-exports.js'], (function (exports) { +System.register(['./custom_modules/@my-scope/my-base-pkg/index.js', './_virtual/index.js'], (function (exports) { 'use strict'; var myBasePkg; return {