Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prioritize manual chunk name over dynamic entry id (#4040)
- Loading branch information
1 parent
345ae5d
commit 3078c61
Showing
18 changed files
with
143 additions
and
4 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
12 changes: 12 additions & 0 deletions
12
test/chunking-form/samples/single-file-manual-chunk/_config.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 @@ | ||
module.exports = { | ||
description: 'chunk aliasing with extensions', | ||
options: { | ||
output: { | ||
manualChunks(id) { | ||
if (id.endsWith('main.js')) return; | ||
if (id.endsWith('a.js')) return 'first'; | ||
return 'second'; | ||
} | ||
} | ||
} | ||
}; |
5 changes: 5 additions & 0 deletions
5
test/chunking-form/samples/single-file-manual-chunk/_expected/amd/generated-first.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,5 @@ | ||
define(function () { 'use strict'; | ||
|
||
console.log('a'); | ||
|
||
}); |
18 changes: 18 additions & 0 deletions
18
test/chunking-form/samples/single-file-manual-chunk/_expected/amd/generated-second.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,18 @@ | ||
define(['exports'], function (exports) { 'use strict'; | ||
|
||
console.log('b'); | ||
|
||
var b = /*#__PURE__*/Object.freeze({ | ||
__proto__: null | ||
}); | ||
|
||
console.log('c'); | ||
|
||
var c = /*#__PURE__*/Object.freeze({ | ||
__proto__: null | ||
}); | ||
|
||
exports.b = b; | ||
exports.c = c; | ||
|
||
}); |
7 changes: 7 additions & 0 deletions
7
test/chunking-form/samples/single-file-manual-chunk/_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,7 @@ | ||
define(['require'], function (require) { 'use strict'; | ||
|
||
new Promise(function (resolve, reject) { require(['./generated-first'], resolve, reject) }); | ||
new Promise(function (resolve, reject) { require(['./generated-second'], resolve, reject) }).then(function (n) { return n.b; }); | ||
new Promise(function (resolve, reject) { require(['./generated-second'], resolve, reject) }).then(function (n) { return n.c; }); | ||
|
||
}); |
3 changes: 3 additions & 0 deletions
3
test/chunking-form/samples/single-file-manual-chunk/_expected/cjs/generated-first.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 @@ | ||
'use strict'; | ||
|
||
console.log('a'); |
16 changes: 16 additions & 0 deletions
16
test/chunking-form/samples/single-file-manual-chunk/_expected/cjs/generated-second.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,16 @@ | ||
'use strict'; | ||
|
||
console.log('b'); | ||
|
||
var b = /*#__PURE__*/Object.freeze({ | ||
__proto__: null | ||
}); | ||
|
||
console.log('c'); | ||
|
||
var c = /*#__PURE__*/Object.freeze({ | ||
__proto__: null | ||
}); | ||
|
||
exports.b = b; | ||
exports.c = c; |
5 changes: 5 additions & 0 deletions
5
test/chunking-form/samples/single-file-manual-chunk/_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,5 @@ | ||
'use strict'; | ||
|
||
Promise.resolve().then(function () { return require('./generated-first.js'); }); | ||
Promise.resolve().then(function () { return require('./generated-second.js'); }).then(function (n) { return n.b; }); | ||
Promise.resolve().then(function () { return require('./generated-second.js'); }).then(function (n) { return n.c; }); |
1 change: 1 addition & 0 deletions
1
test/chunking-form/samples/single-file-manual-chunk/_expected/es/generated-first.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 @@ | ||
console.log('a'); |
13 changes: 13 additions & 0 deletions
13
test/chunking-form/samples/single-file-manual-chunk/_expected/es/generated-second.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,13 @@ | ||
console.log('b'); | ||
|
||
var b = /*#__PURE__*/Object.freeze({ | ||
__proto__: null | ||
}); | ||
|
||
console.log('c'); | ||
|
||
var c = /*#__PURE__*/Object.freeze({ | ||
__proto__: null | ||
}); | ||
|
||
export { b, c }; |
3 changes: 3 additions & 0 deletions
3
test/chunking-form/samples/single-file-manual-chunk/_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 @@ | ||
import('./generated-first.js'); | ||
import('./generated-second.js').then(function (n) { return n.b; }); | ||
import('./generated-second.js').then(function (n) { return n.c; }); |
10 changes: 10 additions & 0 deletions
10
test/chunking-form/samples/single-file-manual-chunk/_expected/system/generated-first.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,10 @@ | ||
System.register([], function () { | ||
'use strict'; | ||
return { | ||
execute: function () { | ||
|
||
console.log('a'); | ||
|
||
} | ||
}; | ||
}); |
22 changes: 22 additions & 0 deletions
22
test/chunking-form/samples/single-file-manual-chunk/_expected/system/generated-second.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,22 @@ | ||
System.register([], function (exports) { | ||
'use strict'; | ||
return { | ||
execute: function () { | ||
|
||
console.log('b'); | ||
|
||
var b = /*#__PURE__*/Object.freeze({ | ||
__proto__: null | ||
}); | ||
exports('b', b); | ||
|
||
console.log('c'); | ||
|
||
var c = /*#__PURE__*/Object.freeze({ | ||
__proto__: null | ||
}); | ||
exports('c', c); | ||
|
||
} | ||
}; | ||
}); |
12 changes: 12 additions & 0 deletions
12
test/chunking-form/samples/single-file-manual-chunk/_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, module) { | ||
'use strict'; | ||
return { | ||
execute: function () { | ||
|
||
module.import('./generated-first.js'); | ||
module.import('./generated-second.js').then(function (n) { return n.b; }); | ||
module.import('./generated-second.js').then(function (n) { return n.c; }); | ||
|
||
} | ||
}; | ||
}); |
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 @@ | ||
console.log('a'); |
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 @@ | ||
console.log('b'); |
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 @@ | ||
console.log('c'); |
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 @@ | ||
import('./a.js'); | ||
import('./b.js'); | ||
import('./c.js'); |