Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make sure that indirectly reexported modules also become chunk dependencies when preserving modules #3273

Merged
merged 2 commits into from Dec 7, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
366 changes: 223 additions & 143 deletions package-lock.json

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions package.json
Expand Up @@ -80,19 +80,19 @@
"chokidar": "^2.1.8",
"codecov": "^3.6.1",
"console-group": "^0.3.3",
"core-js": "^3.4.2",
"core-js": "^3.4.7",
"cross-os": "^1.3.0",
"date-time": "^3.1.0",
"es5-shim": "^4.5.13",
"es6-shim": "^0.35.5",
"eslint": "^6.7.1",
"eslint": "^6.7.2",
"eslint-plugin-import": "^2.18.2",
"execa": "^3.3.0",
"execa": "^3.4.0",
"fixturify": "^1.2.0",
"hash.js": "^1.1.7",
"husky": "^3.1.0",
"is-reference": "^1.1.4",
"lint-staged": "^9.4.3",
"lint-staged": "^9.5.0",
"locate-character": "^2.0.5",
"magic-string": "^0.25.4",
"markdownlint-cli": "^0.19.0",
Expand All @@ -105,12 +105,12 @@
"pretty-ms": "^5.1.0",
"require-relative": "^0.8.7",
"requirejs": "^2.3.6",
"rollup": "^1.27.4",
"rollup": "^1.27.8",
"rollup-plugin-alias": "^2.2.0",
"rollup-plugin-buble": "^0.19.8",
"rollup-plugin-commonjs": "^10.1.0",
"rollup-plugin-json": "^4.0.0",
"rollup-plugin-license": "^0.12.1",
"rollup-plugin-license": "^0.13.0",
"rollup-plugin-node-resolve": "^5.2.0",
"rollup-plugin-replace": "^2.2.0",
"rollup-plugin-string": "^3.0.0",
Expand All @@ -123,12 +123,12 @@
"source-map": "^0.6.1",
"source-map-support": "^0.5.16",
"sourcemap-codec": "^1.4.6",
"systemjs": "^6.1.5",
"terser": "^4.4.0",
"systemjs": "^6.1.7",
"terser": "^4.4.2",
"tslib": "^1.10.0",
"tslint": "^5.20.1",
"turbocolor": "^2.6.1",
"typescript": "^3.7.2",
"typescript": "^3.7.3",
"url-parse": "^1.4.7"
},
"files": [
Expand Down
6 changes: 3 additions & 3 deletions src/Module.ts
Expand Up @@ -384,9 +384,9 @@ export default class Module {

getTransitiveDependencies() {
return this.dependencies.concat(
this.getReexports().map(
exportName => this.getVariableForExportName(exportName).module as Module
)
this.getReexports()
.concat(this.getExports())
.map((exportName: string) => this.getVariableForExportName(exportName).module as Module)
);
}

Expand Down
@@ -0,0 +1,8 @@
module.exports = {
description: 'does not drop indirect reexports when preserving modules',
expectedWarnings: ['MIXED_EXPORTS'],
options: {
output: { name: 'bundle' },
preserveModules: true
}
};
@@ -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 });

});
@@ -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 });

});
@@ -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 });

});
@@ -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;
@@ -0,0 +1,9 @@
'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

const foo = 'bar';
var bar = () => {};

exports.default = bar;
exports.foo = foo;
@@ -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;
@@ -0,0 +1,6 @@
import bar from './sub/index.js';
export { foo } from './sub/index.js';

const baz = { bar };

export { baz };
@@ -0,0 +1,5 @@
const foo = 'bar';
var bar = () => {};

export default bar;
export { foo };
@@ -0,0 +1,2 @@
export { foo } from './components/sub/index.js';
export { baz } from './components/index.js';
@@ -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 });

}
};
});
@@ -0,0 +1,11 @@
System.register('bundle', [], function (exports) {
'use strict';
return {
execute: function () {

const foo = exports('foo', 'bar');
var bar = exports('default', () => {});

}
};
});
@@ -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 () {



}
};
});
@@ -0,0 +1,4 @@
import bar, { foo } from './sub/index';

export const baz = { bar };
export { foo };
@@ -0,0 +1,4 @@
const foo = 'bar';

export { foo };
export default () => {};
@@ -0,0 +1,3 @@
import { baz, foo } from './components/index';

export { baz, foo };