Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Inline dynamic imports that are also imported statically and only use…
…d in a single chunk (#2295)
- Loading branch information
1 parent
e13b552
commit c3228cd
Showing
11 changed files
with
88 additions
and
7 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
6 changes: 6 additions & 0 deletions
6
test/chunking-form/samples/dynamic-import-inline-colouring/_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,6 @@ | ||
module.exports = { | ||
description: 'Dynamic import inlining for static colouring', | ||
options: { | ||
input: ['main.js'] | ||
} | ||
}; |
13 changes: 13 additions & 0 deletions
13
test/chunking-form/samples/dynamic-import-inline-colouring/_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,13 @@ | ||
define(['require'], function (require) { 'use strict'; | ||
|
||
var foo = "FOO"; | ||
|
||
var foo$1 = /*#__PURE__*/Object.freeze({ | ||
default: foo | ||
}); | ||
|
||
var main = Promise.resolve().then(function () { return foo$1; }); | ||
|
||
return main; | ||
|
||
}); |
11 changes: 11 additions & 0 deletions
11
test/chunking-form/samples/dynamic-import-inline-colouring/_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,11 @@ | ||
'use strict'; | ||
|
||
var foo = "FOO"; | ||
|
||
var foo$1 = /*#__PURE__*/Object.freeze({ | ||
default: foo | ||
}); | ||
|
||
var main = Promise.resolve().then(function () { return foo$1; }); | ||
|
||
module.exports = main; |
9 changes: 9 additions & 0 deletions
9
test/chunking-form/samples/dynamic-import-inline-colouring/_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,9 @@ | ||
var foo = "FOO"; | ||
|
||
var foo$1 = /*#__PURE__*/Object.freeze({ | ||
default: foo | ||
}); | ||
|
||
var main = Promise.resolve().then(function () { return foo$1; }); | ||
|
||
export default main; |
16 changes: 16 additions & 0 deletions
16
test/chunking-form/samples/dynamic-import-inline-colouring/_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,16 @@ | ||
System.register([], function (exports, module) { | ||
'use strict'; | ||
return { | ||
execute: function () { | ||
|
||
var foo = "FOO"; | ||
|
||
var foo$1 = /*#__PURE__*/Object.freeze({ | ||
default: foo | ||
}); | ||
|
||
var main = exports('default', Promise.resolve().then(function () { return foo$1; })); | ||
|
||
} | ||
}; | ||
}); |
1 change: 1 addition & 0 deletions
1
test/chunking-form/samples/dynamic-import-inline-colouring/foo.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 default "FOO"; |
3 changes: 3 additions & 0 deletions
3
test/chunking-form/samples/dynamic-import-inline-colouring/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 foo from "./foo.js"; | ||
|
||
export default import("./foo.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