Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* only render final resolutions for cross-chunk dynamic imports
* do not create facades for inlined dynamic imports
- Loading branch information
1 parent
180835a
commit 671c74d
Showing
40 changed files
with
228 additions
and
54 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
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
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
7 changes: 7 additions & 0 deletions
7
test/chunking-form/samples/dynamic-import-statically-imported-2/_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,7 @@ | ||
module.exports = { | ||
description: | ||
'handles dynamic imports of previously statically imported chunks that are also dynamically imported by other chunks', | ||
options: { | ||
input: ['main.js', 'main2.js'] | ||
} | ||
}; |
20 changes: 20 additions & 0 deletions
20
...unking-form/samples/dynamic-import-statically-imported-2/_expected/amd/generated-chunk.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,20 @@ | ||
define(['require', 'exports'], function (require, exports) { 'use strict'; | ||
|
||
function foo() { | ||
return 'dep2'; | ||
} | ||
|
||
Promise.resolve().then(function () { return dep1; }).then(({ bar }) => console.log(bar())); | ||
|
||
function bar() { | ||
return foo(); | ||
} | ||
|
||
var dep1 = /*#__PURE__*/Object.freeze({ | ||
bar: bar | ||
}); | ||
|
||
exports.foo = foo; | ||
exports.bar = bar; | ||
|
||
}); |
7 changes: 7 additions & 0 deletions
7
...nking-form/samples/dynamic-import-statically-imported-2/_expected/amd/generated-chunk2.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(['exports', './generated-chunk.js'], function (exports, dep1_js) { 'use strict'; | ||
|
||
|
||
|
||
exports.bar = dep1_js.bar; | ||
|
||
}); |
2 changes: 1 addition & 1 deletion
2
...mported/_expected/amd/generated-chunk2.js → ...atically-imported-2/_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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
define(['./generated-chunk.js'], function (dep1_js) { 'use strict'; | ||
|
||
|
||
console.log(dep1_js.foo(), dep1_js.bar()); | ||
|
||
}); |
5 changes: 5 additions & 0 deletions
5
test/chunking-form/samples/dynamic-import-statically-imported-2/_expected/amd/main2.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(['require'], function (require) { 'use strict'; | ||
|
||
new Promise(function (resolve, reject) { require(['./generated-chunk2.js'], resolve, reject) }).then(({ bar }) => console.log(bar())); | ||
|
||
}); |
18 changes: 18 additions & 0 deletions
18
...unking-form/samples/dynamic-import-statically-imported-2/_expected/cjs/generated-chunk.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 @@ | ||
'use strict'; | ||
|
||
function foo() { | ||
return 'dep2'; | ||
} | ||
|
||
Promise.resolve().then(function () { return dep1; }).then(({ bar }) => console.log(bar())); | ||
|
||
function bar() { | ||
return foo(); | ||
} | ||
|
||
var dep1 = /*#__PURE__*/Object.freeze({ | ||
bar: bar | ||
}); | ||
|
||
exports.foo = foo; | ||
exports.bar = bar; |
7 changes: 7 additions & 0 deletions
7
...nking-form/samples/dynamic-import-statically-imported-2/_expected/cjs/generated-chunk2.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'; | ||
|
||
var dep1_js = require('./generated-chunk.js'); | ||
|
||
|
||
|
||
exports.bar = dep1_js.bar; |
5 changes: 5 additions & 0 deletions
5
test/chunking-form/samples/dynamic-import-statically-imported-2/_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'; | ||
|
||
var dep1_js = require('./generated-chunk.js'); | ||
|
||
console.log(dep1_js.foo(), dep1_js.bar()); |
3 changes: 3 additions & 0 deletions
3
test/chunking-form/samples/dynamic-import-statically-imported-2/_expected/cjs/main2.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'; | ||
|
||
Promise.resolve(require('./generated-chunk2.js')).then(({ bar }) => console.log(bar())); |
15 changes: 15 additions & 0 deletions
15
...hunking-form/samples/dynamic-import-statically-imported-2/_expected/es/generated-chunk.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 @@ | ||
function foo() { | ||
return 'dep2'; | ||
} | ||
|
||
Promise.resolve().then(function () { return dep1; }).then(({ bar }) => console.log(bar())); | ||
|
||
function bar() { | ||
return foo(); | ||
} | ||
|
||
var dep1 = /*#__PURE__*/Object.freeze({ | ||
bar: bar | ||
}); | ||
|
||
export { foo as a, bar as b }; |
1 change: 1 addition & 0 deletions
1
...unking-form/samples/dynamic-import-statically-imported-2/_expected/es/generated-chunk2.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 @@ | ||
export { b as bar } from './generated-chunk.js'; |
3 changes: 3 additions & 0 deletions
3
test/chunking-form/samples/dynamic-import-statically-imported-2/_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 { a as foo, b as bar } from './generated-chunk.js'; | ||
|
||
console.log(foo(), bar()); |
1 change: 1 addition & 0 deletions
1
test/chunking-form/samples/dynamic-import-statically-imported-2/_expected/es/main2.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 @@ | ||
import('./generated-chunk2.js').then(({ bar }) => console.log(bar())); |
27 changes: 27 additions & 0 deletions
27
...ing-form/samples/dynamic-import-statically-imported-2/_expected/system/generated-chunk.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,27 @@ | ||
System.register([], function (exports, module) { | ||
'use strict'; | ||
return { | ||
execute: function () { | ||
|
||
exports({ | ||
a: foo, | ||
b: bar | ||
}); | ||
|
||
function foo() { | ||
return 'dep2'; | ||
} | ||
|
||
Promise.resolve().then(function () { return dep1; }).then(({ bar }) => console.log(bar())); | ||
|
||
function bar() { | ||
return foo(); | ||
} | ||
|
||
var dep1 = /*#__PURE__*/Object.freeze({ | ||
bar: bar | ||
}); | ||
|
||
} | ||
}; | ||
}); |
4 changes: 3 additions & 1 deletion
4
...rted/_expected/system/generated-chunk2.js → ...ed-2/_expected/system/generated-chunk2.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
15 changes: 15 additions & 0 deletions
15
test/chunking-form/samples/dynamic-import-statically-imported-2/_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,15 @@ | ||
System.register(['./generated-chunk.js'], function (exports, module) { | ||
'use strict'; | ||
var foo, bar; | ||
return { | ||
setters: [function (module) { | ||
foo = module.a; | ||
bar = module.b; | ||
}], | ||
execute: function () { | ||
|
||
console.log(foo(), bar()); | ||
|
||
} | ||
}; | ||
}); |
10 changes: 10 additions & 0 deletions
10
test/chunking-form/samples/dynamic-import-statically-imported-2/_expected/system/main2.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 (exports, module) { | ||
'use strict'; | ||
return { | ||
execute: function () { | ||
|
||
module.import('./generated-chunk2.js').then(({ bar }) => console.log(bar())); | ||
|
||
} | ||
}; | ||
}); |
5 changes: 5 additions & 0 deletions
5
test/chunking-form/samples/dynamic-import-statically-imported-2/dep1.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 @@ | ||
import {foo} from './dep2.js'; | ||
|
||
export function bar() { | ||
return foo(); | ||
} |
5 changes: 5 additions & 0 deletions
5
test/chunking-form/samples/dynamic-import-statically-imported-2/dep2.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 @@ | ||
export function foo() { | ||
return 'dep2'; | ||
} | ||
|
||
import('./dep1.js').then(({ bar }) => console.log(bar())); |
4 changes: 4 additions & 0 deletions
4
test/chunking-form/samples/dynamic-import-statically-imported-2/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,4 @@ | ||
import { bar } from './dep1.js'; | ||
import { foo } from './dep2.js'; | ||
|
||
console.log(foo(), bar()); |
1 change: 1 addition & 0 deletions
1
test/chunking-form/samples/dynamic-import-statically-imported-2/main2.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 @@ | ||
import('./dep1.js').then(({ bar }) => console.log(bar())); |
11 changes: 7 additions & 4 deletions
11
...chunking-form/samples/dynamic-import-statically-imported/_expected/amd/generated-chunk.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 |
---|---|---|
@@ -1,17 +1,20 @@ | ||
define(['require', 'exports'], function (require, exports) { 'use strict'; | ||
|
||
function foo() { | ||
console.log('dep2'); | ||
return 'dep2'; | ||
} | ||
|
||
Promise.resolve().then(function () { return dep1; }); | ||
|
||
Promise.resolve().then(function () { return dep1; }).then(({ bar }) => console.log(bar())); | ||
|
||
function bar() { | ||
return foo(); | ||
} | ||
|
||
var dep1 = /*#__PURE__*/Object.freeze({ | ||
|
||
bar: bar | ||
}); | ||
|
||
exports.foo = foo; | ||
exports.bar = bar; | ||
|
||
}); |
4 changes: 2 additions & 2 deletions
4
test/chunking-form/samples/dynamic-import-statically-imported/_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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
define(['./generated-chunk.js'], function (dep1_js) { 'use strict'; | ||
define(['./generated-chunk.js'], function (__chunk_1) { 'use strict'; | ||
|
||
dep1_js.foo(); | ||
console.log(__chunk_1.foo(), __chunk_1.bar()); | ||
|
||
}); |
11 changes: 7 additions & 4 deletions
11
...chunking-form/samples/dynamic-import-statically-imported/_expected/cjs/generated-chunk.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 |
---|---|---|
@@ -1,15 +1,18 @@ | ||
'use strict'; | ||
|
||
function foo() { | ||
console.log('dep2'); | ||
return 'dep2'; | ||
} | ||
|
||
Promise.resolve().then(function () { return dep1; }); | ||
|
||
Promise.resolve().then(function () { return dep1; }).then(({ bar }) => console.log(bar())); | ||
|
||
function bar() { | ||
return foo(); | ||
} | ||
|
||
var dep1 = /*#__PURE__*/Object.freeze({ | ||
|
||
bar: bar | ||
}); | ||
|
||
exports.foo = foo; | ||
exports.bar = bar; |
4 changes: 0 additions & 4 deletions
4
...hunking-form/samples/dynamic-import-statically-imported/_expected/cjs/generated-chunk2.js
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.