Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
99 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
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
3 changes: 3 additions & 0 deletions
3
test/chunking-form/samples/dynamic-import-identifier/_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,3 @@ | ||
module.exports = defineTest({ | ||
description: 'tree-shakes dynamic imports with identifier' | ||
}); |
7 changes: 7 additions & 0 deletions
7
test/chunking-form/samples/dynamic-import-identifier/_expected/amd/generated-module.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'], (function (exports) { 'use strict'; | ||
|
||
const foo = () => {}; | ||
|
||
exports.foo = foo; | ||
|
||
})); |
8 changes: 8 additions & 0 deletions
8
test/chunking-form/samples/dynamic-import-identifier/_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,8 @@ | ||
define(['require'], (function (require) { 'use strict'; | ||
|
||
(async () => { | ||
const module = await new Promise(function (resolve, reject) { require(['./generated-module'], resolve, reject); }); | ||
module.foo(); | ||
})(); | ||
|
||
})); |
5 changes: 5 additions & 0 deletions
5
test/chunking-form/samples/dynamic-import-identifier/_expected/cjs/generated-module.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'; | ||
|
||
const foo = () => {}; | ||
|
||
exports.foo = foo; |
6 changes: 6 additions & 0 deletions
6
test/chunking-form/samples/dynamic-import-identifier/_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,6 @@ | ||
'use strict'; | ||
|
||
(async () => { | ||
const module = await Promise.resolve().then(function () { return require('./generated-module.js'); }); | ||
module.foo(); | ||
})(); |
3 changes: 3 additions & 0 deletions
3
test/chunking-form/samples/dynamic-import-identifier/_expected/es/generated-module.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 @@ | ||
const foo = () => {}; | ||
|
||
export { foo }; |
4 changes: 4 additions & 0 deletions
4
test/chunking-form/samples/dynamic-import-identifier/_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,4 @@ | ||
(async () => { | ||
const module = await import('./generated-module.js'); | ||
module.foo(); | ||
})(); |
10 changes: 10 additions & 0 deletions
10
test/chunking-form/samples/dynamic-import-identifier/_expected/system/generated-module.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) { | ||
'use strict'; | ||
return { | ||
execute: (function () { | ||
|
||
const foo = exports("foo", () => {}); | ||
|
||
}) | ||
}; | ||
})); |
13 changes: 13 additions & 0 deletions
13
test/chunking-form/samples/dynamic-import-identifier/_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([], (function (exports, module) { | ||
'use strict'; | ||
return { | ||
execute: (function () { | ||
|
||
(async () => { | ||
const module$1 = await module.import('./generated-module.js'); | ||
module$1.foo(); | ||
})(); | ||
|
||
}) | ||
}; | ||
})); |
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 @@ | ||
(async () => { | ||
const module = await import('./module'); | ||
module.foo(); | ||
})(); |
2 changes: 2 additions & 0 deletions
2
test/chunking-form/samples/dynamic-import-identifier/module.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 @@ | ||
export const foo = () => {}; | ||
export const bar = () => {}; |