Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make sure that indirectly reexported modules also become chunk depend…
…encies when preserving modules (#3273) * Make sure that indirectly reexported modules also become chunk dependencies * Update dependencies
- Loading branch information
1 parent
6e92e52
commit 27201d8
Showing
20 changed files
with
913 additions
and
341 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
8 changes: 8 additions & 0 deletions
8
test/chunking-form/samples/indirect-reexports-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,8 @@ | ||
module.exports = { | ||
description: 'does not drop indirect reexports when preserving modules', | ||
expectedWarnings: ['MIXED_EXPORTS'], | ||
options: { | ||
output: { name: 'bundle' }, | ||
preserveModules: true | ||
} | ||
}; |
10 changes: 10 additions & 0 deletions
10
...unking-form/samples/indirect-reexports-preserve-modules/_expected/amd/components/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,10 @@ | ||
define(['exports', './sub/index'], function (exports, index) { 'use strict'; | ||
|
||
const baz = { bar: index.default }; | ||
|
||
exports.foo = index.foo; | ||
exports.baz = baz; | ||
|
||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
|
||
}); |
11 changes: 11 additions & 0 deletions
11
...ng-form/samples/indirect-reexports-preserve-modules/_expected/amd/components/sub/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,11 @@ | ||
define(['exports'], function (exports) { 'use strict'; | ||
|
||
const foo = 'bar'; | ||
var bar = () => {}; | ||
|
||
exports.default = bar; | ||
exports.foo = foo; | ||
|
||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
|
||
}); |
10 changes: 10 additions & 0 deletions
10
test/chunking-form/samples/indirect-reexports-preserve-modules/_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,10 @@ | ||
define(['exports', './components/sub/index', './components/index'], function (exports, index, index$1) { 'use strict'; | ||
|
||
|
||
|
||
exports.foo = index.foo; | ||
exports.baz = index$1.baz; | ||
|
||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
|
||
}); |
10 changes: 10 additions & 0 deletions
10
...unking-form/samples/indirect-reexports-preserve-modules/_expected/cjs/components/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,10 @@ | ||
'use strict'; | ||
|
||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
|
||
var index = require('./sub/index.js'); | ||
|
||
const baz = { bar: index.default }; | ||
|
||
exports.foo = index.foo; | ||
exports.baz = baz; |
9 changes: 9 additions & 0 deletions
9
...ng-form/samples/indirect-reexports-preserve-modules/_expected/cjs/components/sub/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,9 @@ | ||
'use strict'; | ||
|
||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
|
||
const foo = 'bar'; | ||
var bar = () => {}; | ||
|
||
exports.default = bar; | ||
exports.foo = foo; |
11 changes: 11 additions & 0 deletions
11
test/chunking-form/samples/indirect-reexports-preserve-modules/_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,11 @@ | ||
'use strict'; | ||
|
||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
|
||
var index = require('./components/sub/index.js'); | ||
var index$1 = require('./components/index.js'); | ||
|
||
|
||
|
||
exports.foo = index.foo; | ||
exports.baz = index$1.baz; |
6 changes: 6 additions & 0 deletions
6
...hunking-form/samples/indirect-reexports-preserve-modules/_expected/es/components/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,6 @@ | ||
import bar from './sub/index.js'; | ||
export { foo } from './sub/index.js'; | ||
|
||
const baz = { bar }; | ||
|
||
export { baz }; |
5 changes: 5 additions & 0 deletions
5
...ing-form/samples/indirect-reexports-preserve-modules/_expected/es/components/sub/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,5 @@ | ||
const foo = 'bar'; | ||
var bar = () => {}; | ||
|
||
export default bar; | ||
export { foo }; |
2 changes: 2 additions & 0 deletions
2
test/chunking-form/samples/indirect-reexports-preserve-modules/_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,2 @@ | ||
export { foo } from './components/sub/index.js'; | ||
export { baz } from './components/index.js'; |
15 changes: 15 additions & 0 deletions
15
...ing-form/samples/indirect-reexports-preserve-modules/_expected/system/components/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,15 @@ | ||
System.register('bundle', ['./sub/index.js'], function (exports) { | ||
'use strict'; | ||
var bar; | ||
return { | ||
setters: [function (module) { | ||
bar = module.default; | ||
exports('foo', module.foo); | ||
}], | ||
execute: function () { | ||
|
||
const baz = exports('baz', { bar }); | ||
|
||
} | ||
}; | ||
}); |
11 changes: 11 additions & 0 deletions
11
...form/samples/indirect-reexports-preserve-modules/_expected/system/components/sub/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,11 @@ | ||
System.register('bundle', [], function (exports) { | ||
'use strict'; | ||
return { | ||
execute: function () { | ||
|
||
const foo = exports('foo', 'bar'); | ||
var bar = exports('default', () => {}); | ||
|
||
} | ||
}; | ||
}); |
15 changes: 15 additions & 0 deletions
15
test/chunking-form/samples/indirect-reexports-preserve-modules/_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,15 @@ | ||
System.register('bundle', ['./components/sub/index.js', './components/index.js'], function (exports) { | ||
'use strict'; | ||
return { | ||
setters: [function (module) { | ||
exports('foo', module.foo); | ||
}, function (module) { | ||
exports('baz', module.baz); | ||
}], | ||
execute: function () { | ||
|
||
|
||
|
||
} | ||
}; | ||
}); |
4 changes: 4 additions & 0 deletions
4
test/chunking-form/samples/indirect-reexports-preserve-modules/components/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,4 @@ | ||
import bar, { foo } from './sub/index'; | ||
|
||
export const baz = { bar }; | ||
export { foo }; |
4 changes: 4 additions & 0 deletions
4
test/chunking-form/samples/indirect-reexports-preserve-modules/components/sub/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,4 @@ | ||
const foo = 'bar'; | ||
|
||
export { foo }; | ||
export default () => {}; |
3 changes: 3 additions & 0 deletions
3
test/chunking-form/samples/indirect-reexports-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 { baz, foo } from './components/index'; | ||
|
||
export { baz, foo }; |
Oops, something went wrong.