Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add cut-off condition to only back-track modules if there are few imp…
…orts
- Loading branch information
1 parent
20d422a
commit dc0f100
Showing
37 changed files
with
350 additions
and
109 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
7 changes: 7 additions & 0 deletions
7
test/chunking-form/samples/improved-dynamic-chunks/cut-off/_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: | ||
'does not avoid separate chunks if too many modules dynamically import the same chunk', | ||
options: { | ||
input: ['main1', 'main2', 'main3', 'main4'] | ||
} | ||
}; |
7 changes: 7 additions & 0 deletions
7
test/chunking-form/samples/improved-dynamic-chunks/cut-off/_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,7 @@ | ||
define(['exports'], (function (exports) { 'use strict'; | ||
|
||
const value = 'shared'; | ||
|
||
exports.value = value; | ||
|
||
})); |
6 changes: 6 additions & 0 deletions
6
...chunking-form/samples/improved-dynamic-chunks/cut-off/_expected/amd/generated-dynamic1.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 @@ | ||
define(['require', './generated-dep'], (function (require, dep) { 'use strict'; | ||
|
||
console.log('dynamic1', dep.value); | ||
new Promise(function (resolve, reject) { require(['./generated-dynamic2'], resolve, reject); }); | ||
|
||
})); |
5 changes: 5 additions & 0 deletions
5
...chunking-form/samples/improved-dynamic-chunks/cut-off/_expected/amd/generated-dynamic2.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('dynamic2', dep.value); | ||
|
||
})); |
6 changes: 6 additions & 0 deletions
6
test/chunking-form/samples/improved-dynamic-chunks/cut-off/_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,6 @@ | ||
define(['require', './generated-dep'], (function (require, dep) { 'use strict'; | ||
|
||
console.log('main1', dep.value); | ||
new Promise(function (resolve, reject) { require(['./generated-dynamic1'], resolve, reject); }); | ||
|
||
})); |
6 changes: 6 additions & 0 deletions
6
test/chunking-form/samples/improved-dynamic-chunks/cut-off/_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,6 @@ | ||
define(['require', './generated-dep'], (function (require, dep) { 'use strict'; | ||
|
||
console.log('main1', dep.value); | ||
new Promise(function (resolve, reject) { require(['./generated-dynamic1'], resolve, reject); }); | ||
|
||
})); |
6 changes: 6 additions & 0 deletions
6
test/chunking-form/samples/improved-dynamic-chunks/cut-off/_expected/amd/main3.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 @@ | ||
define(['require', './generated-dep'], (function (require, dep) { 'use strict'; | ||
|
||
console.log('main1', dep.value); | ||
new Promise(function (resolve, reject) { require(['./generated-dynamic1'], resolve, reject); }); | ||
|
||
})); |
6 changes: 6 additions & 0 deletions
6
test/chunking-form/samples/improved-dynamic-chunks/cut-off/_expected/amd/main4.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 @@ | ||
define(['require', './generated-dep'], (function (require, dep) { 'use strict'; | ||
|
||
console.log('main1', dep.value); | ||
new Promise(function (resolve, reject) { require(['./generated-dynamic1'], resolve, reject); }); | ||
|
||
})); |
5 changes: 5 additions & 0 deletions
5
test/chunking-form/samples/improved-dynamic-chunks/cut-off/_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,5 @@ | ||
'use strict'; | ||
|
||
const value = 'shared'; | ||
|
||
exports.value = value; |
6 changes: 6 additions & 0 deletions
6
...chunking-form/samples/improved-dynamic-chunks/cut-off/_expected/cjs/generated-dynamic1.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'; | ||
|
||
var dep = require('./generated-dep.js'); | ||
|
||
console.log('dynamic1', dep.value); | ||
Promise.resolve().then(function () { return require('./generated-dynamic2.js'); }); |
5 changes: 5 additions & 0 deletions
5
...chunking-form/samples/improved-dynamic-chunks/cut-off/_expected/cjs/generated-dynamic2.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('dynamic2', dep.value); |
6 changes: 6 additions & 0 deletions
6
test/chunking-form/samples/improved-dynamic-chunks/cut-off/_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,6 @@ | ||
'use strict'; | ||
|
||
var dep = require('./generated-dep.js'); | ||
|
||
console.log('main1', dep.value); | ||
Promise.resolve().then(function () { return require('./generated-dynamic1.js'); }); |
Oops, something went wrong.