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

Fix SystemJS default variable conflict #3796

Merged
merged 1 commit into from Sep 24, 2020
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
4 changes: 1 addition & 3 deletions src/Chunk.ts
Expand Up @@ -994,7 +994,6 @@ export default class Chunk {

private getDependenciesToBeDeconflicted(
addNonNamespacesAndInteropHelpers: boolean,
addInternalDependencies: boolean,
addDependenciesWithoutBindings: boolean,
interop: GetInterop
): DependenciesToBeDeconflicted {
Expand All @@ -1017,7 +1016,7 @@ export default class Chunk {
}
}
}
} else if (addInternalDependencies) {
} else {
const chunk = this.chunkByModule.get(module)!;
if (chunk !== this) {
dependencies.add(chunk);
Expand Down Expand Up @@ -1259,7 +1258,6 @@ export default class Chunk {
this.orderedModules,
this.getDependenciesToBeDeconflicted(
format !== 'es' && format !== 'system',
format !== 'system',
format === 'amd' || format === 'umd' || format === 'iife',
interop
),
Expand Down
@@ -0,0 +1,7 @@
module.exports = {
description: 'deconflicts SystemJS default export variable with namespace imports',
options: {
external: 'external',
output: { preserveModules: true }
}
};
@@ -0,0 +1,7 @@
define(['./other'], function (other) { 'use strict';

var main = other + "extended";

return main;

});
@@ -0,0 +1,9 @@
define(['exports'], function (exports) { 'use strict';

const foo = 'bar';

exports.foo = foo;

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

});
@@ -0,0 +1,7 @@
'use strict';

var other = require('./other.js');

var main = other + "extended";

module.exports = main;
@@ -0,0 +1,7 @@
'use strict';

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

const foo = 'bar';

exports.foo = foo;
@@ -0,0 +1,5 @@
import * as other from './other.js';

var main = other + "extended";

export default main;
@@ -0,0 +1,3 @@
const foo = 'bar';

export { foo };
@@ -0,0 +1,14 @@
System.register(['./other.js'], function (exports) {
'use strict';
var other;
return {
setters: [function (module) {
other = module;
}],
execute: function () {

var main = exports('default', other + "extended");

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

const foo = exports('foo', 'bar');

}
};
});
@@ -0,0 +1,3 @@
import * as main from './other.js';

export default main + "extended";
@@ -0,0 +1 @@
export const foo = 'bar'
@@ -1,13 +1,13 @@
System.register(['./m1.js'], function () {
'use strict';
var ms;
var m1;
return {
setters: [function (module) {
ms = module;
m1 = module;
}],
execute: function () {

console.log(ms);
console.log(m1);

}
};
Expand Down
@@ -1,13 +1,13 @@
System.register(['./m1.js'], function () {
'use strict';
var ms;
var m1;
return {
setters: [function (module) {
ms = module;
m1 = module;
}],
execute: function () {

console.log(ms);
console.log(m1);

}
};
Expand Down
Empty file.