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

import namespace uses invalid variable (*) name when the only output is system #3730

Closed
sastan opened this issue Aug 15, 2020 · 1 comment
Closed

Comments

@sastan
Copy link
Contributor

sastan commented Aug 15, 2020

  • Rollup Version: 2.26.0
  • Operating System (or Browser): node
  • Link to reproduction (IMPORTANT, read below):
    I tried to create a MR on sastan/rollup but failed. Here is the commit with the test case.

Expected Behavior

import * as dependency from 'dependency';
console.log(dependency);

Should generate systemjs bundle like:

System.register(['dependency'], function () {
	'use strict';
	var dependency$1;
	return {
		setters: [function (module) {
			dependency$1 = module;
		}],
		execute: function () {

			console.log(dependency$1);

		}
	};
});

Actual Behavior

The variable is named * which is not a valid variable name.

System.register(['dependency'], function () {
	'use strict';
	var *;
	return {
		setters: [function (module) {
			* = module;
		}],
		execute: function () {

			console.log(*);

		}
	};
});

This only happens when no other output is generated for that bundle. If a esm or cjs bundle is generated before the system bundle, the system is valid.

I am willing to create a working MR but i need some pointers where to start. For the moment i'm out of ideas.

@sastan
Copy link
Contributor Author

sastan commented Aug 16, 2020

Thank you.

@sastan sastan closed this as completed Aug 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant