Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do not fail for circular imports between manual chunks (#3510)
- Loading branch information
1 parent
925d302
commit f65bae1
Showing
17 changed files
with
124 additions
and
0 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,8 @@ | ||
module.exports = { | ||
description: 'handles manual chunks with circular dependencies', | ||
expectedWarnings: ['CIRCULAR_DEPENDENCY'], | ||
options: { | ||
input: 'main', | ||
manualChunks: { lib1: ['lib1'], lib2: ['lib2'] } | ||
} | ||
}; |
8 changes: 8 additions & 0 deletions
8
test/chunking-form/samples/circular-manual-chunks/_expected/amd/generated-lib1.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,8 @@ | ||
define(['exports', './generated-lib2'], function (exports, lib2) { 'use strict'; | ||
|
||
const lib1 = 'lib1'; | ||
console.log(`${lib1} imports ${lib2.lib2}`); | ||
|
||
exports.lib1 = lib1; | ||
|
||
}); |
8 changes: 8 additions & 0 deletions
8
test/chunking-form/samples/circular-manual-chunks/_expected/amd/generated-lib2.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,8 @@ | ||
define(['exports', './generated-lib1'], function (exports, lib1) { 'use strict'; | ||
|
||
const lib2 = 'lib2'; | ||
console.log(`${lib2} imports ${lib1.lib1}`); | ||
|
||
exports.lib2 = lib2; | ||
|
||
}); |
9 changes: 9 additions & 0 deletions
9
test/chunking-form/samples/circular-manual-chunks/_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', './generated-lib2', './generated-lib1'], function (exports, lib2, lib1) { 'use strict'; | ||
|
||
|
||
|
||
exports.lib1 = lib1.lib1; | ||
|
||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
|
||
}); |
8 changes: 8 additions & 0 deletions
8
test/chunking-form/samples/circular-manual-chunks/_expected/cjs/generated-lib1.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,8 @@ | ||
'use strict'; | ||
|
||
var lib2 = require('./generated-lib2.js'); | ||
|
||
const lib1 = 'lib1'; | ||
console.log(`${lib1} imports ${lib2.lib2}`); | ||
|
||
exports.lib1 = lib1; |
8 changes: 8 additions & 0 deletions
8
test/chunking-form/samples/circular-manual-chunks/_expected/cjs/generated-lib2.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,8 @@ | ||
'use strict'; | ||
|
||
var lib1 = require('./generated-lib1.js'); | ||
|
||
const lib2 = 'lib2'; | ||
console.log(`${lib2} imports ${lib1.lib1}`); | ||
|
||
exports.lib2 = lib2; |
10 changes: 10 additions & 0 deletions
10
test/chunking-form/samples/circular-manual-chunks/_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,10 @@ | ||
'use strict'; | ||
|
||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
|
||
require('./generated-lib2.js'); | ||
var lib1 = require('./generated-lib1.js'); | ||
|
||
|
||
|
||
exports.lib1 = lib1.lib1; |
6 changes: 6 additions & 0 deletions
6
test/chunking-form/samples/circular-manual-chunks/_expected/es/generated-lib1.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,6 @@ | ||
import { l as lib2 } from './generated-lib2.js'; | ||
|
||
const lib1 = 'lib1'; | ||
console.log(`${lib1} imports ${lib2}`); | ||
|
||
export { lib1 as l }; |
6 changes: 6 additions & 0 deletions
6
test/chunking-form/samples/circular-manual-chunks/_expected/es/generated-lib2.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,6 @@ | ||
import { l as lib1 } from './generated-lib1.js'; | ||
|
||
const lib2 = 'lib2'; | ||
console.log(`${lib2} imports ${lib1}`); | ||
|
||
export { lib2 as l }; |
2 changes: 2 additions & 0 deletions
2
test/chunking-form/samples/circular-manual-chunks/_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,2 @@ | ||
import './generated-lib2.js'; | ||
export { l as lib1 } from './generated-lib1.js'; |
15 changes: 15 additions & 0 deletions
15
test/chunking-form/samples/circular-manual-chunks/_expected/system/generated-lib1.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,15 @@ | ||
System.register(['./generated-lib2.js'], function (exports) { | ||
'use strict'; | ||
var lib2; | ||
return { | ||
setters: [function (module) { | ||
lib2 = module.l; | ||
}], | ||
execute: function () { | ||
|
||
const lib1 = exports('l', 'lib1'); | ||
console.log(`${lib1} imports ${lib2}`); | ||
|
||
} | ||
}; | ||
}); |
15 changes: 15 additions & 0 deletions
15
test/chunking-form/samples/circular-manual-chunks/_expected/system/generated-lib2.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,15 @@ | ||
System.register(['./generated-lib1.js'], function (exports) { | ||
'use strict'; | ||
var lib1; | ||
return { | ||
setters: [function (module) { | ||
lib1 = module.l; | ||
}], | ||
execute: function () { | ||
|
||
const lib2 = exports('l', 'lib2'); | ||
console.log(`${lib2} imports ${lib1}`); | ||
|
||
} | ||
}; | ||
}); |
13 changes: 13 additions & 0 deletions
13
test/chunking-form/samples/circular-manual-chunks/_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,13 @@ | ||
System.register(['./generated-lib2.js', './generated-lib1.js'], function (exports) { | ||
'use strict'; | ||
return { | ||
setters: [function () {}, function (module) { | ||
exports('lib1', module.l); | ||
}], | ||
execute: function () { | ||
|
||
|
||
|
||
} | ||
}; | ||
}); |
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 { lib2 } from './lib2.js'; | ||
export const lib1 = 'lib1'; | ||
console.log(`${lib1} imports ${lib2}`); |
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 { lib1 } from './lib1'; | ||
export const lib2 = 'lib2'; | ||
console.log(`${lib2} imports ${lib1}`); |
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 { lib1 } from './lib1.js'; |