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

imports generated by rollupConfig.treeshake = false may create unusable output (for rollup itself). #3897

Closed
07akioni opened this issue Dec 5, 2020 · 1 comment

Comments

@07akioni
Copy link

07akioni commented Dec 5, 2020

  • Rollup Version: 2.34.1
  • Operating System (or Browser): Mac
  • Node Version (if applicable): v12.16.1
  • Link to reproduction (IMPORTANT, read below):

https://repl.it/join/wpkwnjbg-07akioni

https://github.com/07akioni/rollup-bug

Expected Behavior

it outputs { a: 'a', b: [ 'b', 'a' ] }

Actual Behavior

it outputs # { a: 'a', b: undefined }

The bundled app is

var a = 'a';

var ab = /*#__PURE__*/Object.freeze({
	__proto__: null,
	a: a,
	b: b
});

var b = ['b', a];

console.log({ ...ab });

var preset = 'wow';

console.log(preset);

However var b = ['b', a]; should come before var ab = ...

It is result from

// package/b/b.js (generated by rollup with no tree-shaking)

import a from '../a/a.js';
import '../ab.js'; // <------------ The import stmt cause the problem

var b = ['b', a];

export default b;
@07akioni 07akioni changed the title Redundant import generated by rollConfig.treeshake = false may create unusable output (for rollup itself). imports generated by rollConfig.treeshake = false may create unusable output (for rollup itself). Dec 5, 2020
@07akioni 07akioni changed the title imports generated by rollConfig.treeshake = false may create unusable output (for rollup itself). imports generated by rollupConfig.treeshake = false may create unusable output (for rollup itself). Dec 6, 2020
@lukastaegert
Copy link
Member

It appears this one was fixed in #3840

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

2 participants