diff --git a/src/utils/FileEmitter.ts b/src/utils/FileEmitter.ts index 8bab92e8ff4..c6196285fc0 100644 --- a/src/utils/FileEmitter.ts +++ b/src/utils/FileEmitter.ts @@ -48,10 +48,8 @@ function generateAssetFileName( } function reserveFileNameInBundle(fileName: string, bundle: OutputBundleWithPlaceholders) { - if (fileName in bundle) { - // FIXME this should return error(errFileNameConflict(fileName)); - // but until #3174 is fixed, this raises spurious errors and is disabled - } + // TODO this should warn if the fileName is already in the bundle, + // but until #3174 is fixed, this raises spurious warnings and is disabled bundle[fileName] = FILE_PLACEHOLDER; } diff --git a/test/chunking-form/samples/emit-same-file/_config.js b/test/chunking-form/samples/emit-same-file/_config.js index af34504e833..bad65a0f0d7 100644 --- a/test/chunking-form/samples/emit-same-file/_config.js +++ b/test/chunking-form/samples/emit-same-file/_config.js @@ -1,10 +1,13 @@ module.exports = { + description: + 'does not throw an error if multiple files with the same name are emitted (until #3174 is fixed)', options: { input: 'main.js', plugins: [ { generateBundle() { this.emitFile({ type: 'asset', fileName: 'myfile', source: 'abc' }); + this.emitFile({ type: 'asset', fileName: 'myfile', source: 'abc' }); } } ]