Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Disable errors for duplicate emitted file names (#3175)
* Disable errors for duplicate emitted file names And add a test to make sure such emits no longer error spuriously. Issue #3174 * * Make sure test is red with original code * Add test description * Describe better in the TODO comment what the ultimate intention is
- Loading branch information
1 parent
f99c7e4
commit 06fb16a
Showing
17 changed files
with
53 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
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' }); | ||
} | ||
} | ||
] | ||
} | ||
}; |
9 changes: 9 additions & 0 deletions
9
test/chunking-form/samples/emit-same-file/_expected/amd/main.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
define(['exports'], function (exports) { 'use strict'; | ||
|
||
function hi() { return 2 } | ||
|
||
exports.hi = hi; | ||
|
||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
abc |
7 changes: 7 additions & 0 deletions
7
test/chunking-form/samples/emit-same-file/_expected/cjs/main.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
'use strict'; | ||
|
||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
|
||
function hi() { return 2 } | ||
|
||
exports.hi = hi; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
abc |
3 changes: 3 additions & 0 deletions
3
test/chunking-form/samples/emit-same-file/_expected/es/main.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
function hi() { return 2 } | ||
|
||
export { hi }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
abc |
12 changes: 12 additions & 0 deletions
12
test/chunking-form/samples/emit-same-file/_expected/system/main.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
System.register([], function (exports) { | ||
'use strict'; | ||
return { | ||
execute: function () { | ||
|
||
exports('hi', hi); | ||
|
||
function hi() { return 2 } | ||
|
||
} | ||
}; | ||
}); |
1 change: 1 addition & 0 deletions
1
test/chunking-form/samples/emit-same-file/_expected/system/myfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
abc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export function hi() { return 2 } |
31 changes: 0 additions & 31 deletions
31
test/function/samples/emit-file/emit-named-asset-conflict-build-generate/_config.js
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
test/function/samples/emit-file/emit-named-asset-conflict-build-generate/main.js
This file was deleted.
Oops, something went wrong.
25 changes: 0 additions & 25 deletions
25
test/function/samples/emit-file/emit-named-chunk-conflict/_config.js
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
test/function/samples/emit-file/emit-named-chunk-conflict/buildStart1.js
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
test/function/samples/emit-file/emit-named-chunk-conflict/buildStart2.js
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
test/function/samples/emit-file/emit-named-chunk-conflict/main.js
This file was deleted.
Oops, something went wrong.