Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make sure tree-shaken dynamic imports do not lead to the creation of
namespace objects when inlined
- Loading branch information
1 parent
a9290da
commit ae2d424
Showing
13 changed files
with
53 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
2 changes: 1 addition & 1 deletion
2
test/chunking-form/samples/dynamic-import-tree-shaking-1/_expected/amd/entryB.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,4 +1,4 @@ | ||
define(['require'], function (require) { 'use strict'; | ||
define(function () { 'use strict'; | ||
|
||
console.log('main2'); | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
test/chunking-form/samples/dynamic-import-tree-shaking-2/_expected/amd/main1.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,4 +1,4 @@ | ||
define(['require'], function (require) { 'use strict'; | ||
define(function () { 'use strict'; | ||
|
||
console.log('main1'); | ||
|
||
|
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,4 +1,4 @@ | ||
export default function a() { | ||
a = someGlobal; | ||
return a(); | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
test/form/samples/inlined-treeshaken-dynamic-import/_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: 'completely removes tree-shaken dynamic imports ', | ||
options: { | ||
inlineDynamicImports: true | ||
} | ||
}; |
5 changes: 5 additions & 0 deletions
5
test/form/samples/inlined-treeshaken-dynamic-import/_expected/amd.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('main'); | ||
|
||
}); |
3 changes: 3 additions & 0 deletions
3
test/form/samples/inlined-treeshaken-dynamic-import/_expected/cjs.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('main'); |
1 change: 1 addition & 0 deletions
1
test/form/samples/inlined-treeshaken-dynamic-import/_expected/es.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('main'); |
6 changes: 6 additions & 0 deletions
6
test/form/samples/inlined-treeshaken-dynamic-import/_expected/iife.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 @@ | ||
(function () { | ||
'use strict'; | ||
|
||
console.log('main'); | ||
|
||
}()); |
10 changes: 10 additions & 0 deletions
10
test/form/samples/inlined-treeshaken-dynamic-import/_expected/system.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 () { | ||
|
||
console.log('main'); | ||
|
||
} | ||
}; | ||
}); |
9 changes: 9 additions & 0 deletions
9
test/form/samples/inlined-treeshaken-dynamic-import/_expected/umd.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 @@ | ||
(function (global, factory) { | ||
typeof exports === 'object' && typeof module !== 'undefined' ? factory() : | ||
typeof define === 'function' && define.amd ? define(factory) : | ||
(factory()); | ||
}(this, (function () { 'use strict'; | ||
|
||
console.log('main'); | ||
|
||
}))); |
2 changes: 2 additions & 0 deletions
2
test/form/samples/inlined-treeshaken-dynamic-import/dynamic.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 @@ | ||
console.log('dynamic'); | ||
export var dynamic = 42; |
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 @@ | ||
console.log('main'); | ||
const getFoo = () => import('./dynamic.js'); |