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
1 parent
bd20782
commit 5168e11
Showing
19 changed files
with
93 additions
and
18 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
7 changes: 7 additions & 0 deletions
7
...king-form/samples/side-effect-free-dependencies/avoid-imports-preserve-modules/_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: | ||
'avoids empty imports if they do not have side-effects when preserving modules (#3359)', | ||
options: { | ||
preserveModules: true | ||
} | ||
}; |
9 changes: 9 additions & 0 deletions
9
...mples/side-effect-free-dependencies/avoid-imports-preserve-modules/_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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
define(['external-side-effect'], function (externalSideEffect) { 'use strict'; | ||
|
||
function onlyUsedByOne() { | ||
console.log('Hello'); | ||
} | ||
|
||
onlyUsedByOne(); | ||
|
||
}); |
5 changes: 5 additions & 0 deletions
5
...mples/side-effect-free-dependencies/avoid-imports-preserve-modules/_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(['external-side-effect'], function (externalSideEffect) { 'use strict'; | ||
|
||
console.log('main2'); | ||
|
||
}); |
9 changes: 9 additions & 0 deletions
9
...mples/side-effect-free-dependencies/avoid-imports-preserve-modules/_expected/cjs/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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
'use strict'; | ||
|
||
require('external-side-effect'); | ||
|
||
function onlyUsedByOne() { | ||
console.log('Hello'); | ||
} | ||
|
||
onlyUsedByOne(); |
5 changes: 5 additions & 0 deletions
5
...mples/side-effect-free-dependencies/avoid-imports-preserve-modules/_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,5 @@ | ||
'use strict'; | ||
|
||
require('external-side-effect'); | ||
|
||
console.log('main2'); |
7 changes: 7 additions & 0 deletions
7
...amples/side-effect-free-dependencies/avoid-imports-preserve-modules/_expected/es/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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import 'external-side-effect'; | ||
|
||
function onlyUsedByOne() { | ||
console.log('Hello'); | ||
} | ||
|
||
onlyUsedByOne(); |
3 changes: 3 additions & 0 deletions
3
...amples/side-effect-free-dependencies/avoid-imports-preserve-modules/_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,3 @@ | ||
import 'external-side-effect'; | ||
|
||
console.log('main2'); |
15 changes: 15 additions & 0 deletions
15
...es/side-effect-free-dependencies/avoid-imports-preserve-modules/_expected/system/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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
System.register(['external-side-effect'], function () { | ||
'use strict'; | ||
return { | ||
setters: [function () {}], | ||
execute: function () { | ||
|
||
function onlyUsedByOne() { | ||
console.log('Hello'); | ||
} | ||
|
||
onlyUsedByOne(); | ||
|
||
} | ||
}; | ||
}); |
11 changes: 11 additions & 0 deletions
11
...es/side-effect-free-dependencies/avoid-imports-preserve-modules/_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,11 @@ | ||
System.register(['external-side-effect'], function () { | ||
'use strict'; | ||
return { | ||
setters: [function () {}], | ||
execute: function () { | ||
|
||
console.log('main2'); | ||
|
||
} | ||
}; | ||
}); |
1 change: 1 addition & 0 deletions
1
test/chunking-form/samples/side-effect-free-dependencies/avoid-imports-preserve-modules/a.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 const a = 1; |
1 change: 1 addition & 0 deletions
1
test/chunking-form/samples/side-effect-free-dependencies/avoid-imports-preserve-modules/b.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 const b = 2; |
1 change: 1 addition & 0 deletions
1
test/chunking-form/samples/side-effect-free-dependencies/avoid-imports-preserve-modules/c.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 const c = 3; |
3 changes: 3 additions & 0 deletions
3
...unking-form/samples/side-effect-free-dependencies/avoid-imports-preserve-modules/index.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 @@ | ||
export { a } from './a'; | ||
export { b } from './b'; | ||
export { c } from './c'; |
3 changes: 3 additions & 0 deletions
3
...hunking-form/samples/side-effect-free-dependencies/avoid-imports-preserve-modules/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 } from './index'; | ||
import { d } from './one'; | ||
console.log(a + d); |
2 changes: 2 additions & 0 deletions
2
...chunking-form/samples/side-effect-free-dependencies/avoid-imports-preserve-modules/one.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 { b } from './index'; | ||
export const d = b + 4; |