Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add option to avoid hoisting transitive imports (#3353)
* Add option to avoid hoisting transitive imports * Add FAQ how to add polyfills
- Loading branch information
1 parent
7fc24ab
commit 075933a
Showing
25 changed files
with
206 additions
and
5 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
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
10 changes: 10 additions & 0 deletions
10
test/chunking-form/samples/avoid-chunk-import-hoisting/_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,10 @@ | ||
module.exports = { | ||
description: 'avoids hoisting transitive dependencies via flag', | ||
options: { | ||
input: ['main1.js', 'main2.js'], | ||
external: ['lib'], | ||
output: { | ||
hoistTransitiveImports: false | ||
} | ||
} | ||
}; |
9 changes: 9 additions & 0 deletions
9
test/chunking-form/samples/avoid-chunk-import-hoisting/_expected/amd/generated-dep.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(['exports', 'lib'], function (exports, value) { 'use strict'; | ||
|
||
value = value && value.hasOwnProperty('default') ? value['default'] : value; | ||
|
||
var dep = 2 * value; | ||
|
||
exports.dep = dep; | ||
|
||
}); |
5 changes: 5 additions & 0 deletions
5
test/chunking-form/samples/avoid-chunk-import-hoisting/_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,5 @@ | ||
define(['./generated-dep'], function (dep) { 'use strict'; | ||
|
||
console.log('main1', dep.dep); | ||
|
||
}); |
5 changes: 5 additions & 0 deletions
5
test/chunking-form/samples/avoid-chunk-import-hoisting/_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(['./generated-dep'], function (dep) { 'use strict'; | ||
|
||
console.log('main2', dep.dep); | ||
|
||
}); |
9 changes: 9 additions & 0 deletions
9
test/chunking-form/samples/avoid-chunk-import-hoisting/_expected/cjs/generated-dep.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'; | ||
|
||
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } | ||
|
||
var value = _interopDefault(require('lib')); | ||
|
||
var dep = 2 * value; | ||
|
||
exports.dep = dep; |
5 changes: 5 additions & 0 deletions
5
test/chunking-form/samples/avoid-chunk-import-hoisting/_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,5 @@ | ||
'use strict'; | ||
|
||
var dep = require('./generated-dep.js'); | ||
|
||
console.log('main1', dep.dep); |
5 changes: 5 additions & 0 deletions
5
test/chunking-form/samples/avoid-chunk-import-hoisting/_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'; | ||
|
||
var dep = require('./generated-dep.js'); | ||
|
||
console.log('main2', dep.dep); |
5 changes: 5 additions & 0 deletions
5
test/chunking-form/samples/avoid-chunk-import-hoisting/_expected/es/generated-dep.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 value from 'lib'; | ||
|
||
var dep = 2 * value; | ||
|
||
export { dep as d }; |
3 changes: 3 additions & 0 deletions
3
test/chunking-form/samples/avoid-chunk-import-hoisting/_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,3 @@ | ||
import { d as dep } from './generated-dep.js'; | ||
|
||
console.log('main1', dep); |
3 changes: 3 additions & 0 deletions
3
test/chunking-form/samples/avoid-chunk-import-hoisting/_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 { d as dep } from './generated-dep.js'; | ||
|
||
console.log('main2', dep); |
14 changes: 14 additions & 0 deletions
14
test/chunking-form/samples/avoid-chunk-import-hoisting/_expected/system/generated-dep.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,14 @@ | ||
System.register(['lib'], function (exports) { | ||
'use strict'; | ||
var value; | ||
return { | ||
setters: [function (module) { | ||
value = module.default; | ||
}], | ||
execute: function () { | ||
|
||
var dep = exports('d', 2 * value); | ||
|
||
} | ||
}; | ||
}); |
14 changes: 14 additions & 0 deletions
14
test/chunking-form/samples/avoid-chunk-import-hoisting/_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,14 @@ | ||
System.register(['./generated-dep.js'], function () { | ||
'use strict'; | ||
var dep; | ||
return { | ||
setters: [function (module) { | ||
dep = module.d; | ||
}], | ||
execute: function () { | ||
|
||
console.log('main1', dep); | ||
|
||
} | ||
}; | ||
}); |
14 changes: 14 additions & 0 deletions
14
test/chunking-form/samples/avoid-chunk-import-hoisting/_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,14 @@ | ||
System.register(['./generated-dep.js'], function () { | ||
'use strict'; | ||
var dep; | ||
return { | ||
setters: [function (module) { | ||
dep = module.d; | ||
}], | ||
execute: function () { | ||
|
||
console.log('main2', dep); | ||
|
||
} | ||
}; | ||
}); |
3 changes: 3 additions & 0 deletions
3
test/chunking-form/samples/avoid-chunk-import-hoisting/dep.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 value from 'lib'; | ||
|
||
export default 2 * value; |
3 changes: 3 additions & 0 deletions
3
test/chunking-form/samples/avoid-chunk-import-hoisting/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,3 @@ | ||
import dep from './dep.js'; | ||
|
||
console.log('main1', dep); |
3 changes: 3 additions & 0 deletions
3
test/chunking-form/samples/avoid-chunk-import-hoisting/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 dep from './dep.js'; | ||
|
||
console.log('main2', dep); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.