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

Working with code splitting #59

Closed
rvillalba-novetta opened this issue Dec 11, 2019 · 4 comments
Closed

Working with code splitting #59

rvillalba-novetta opened this issue Dec 11, 2019 · 4 comments

Comments

@rvillalba-novetta
Copy link

A clear and concise description of what you want to happen.

I don't believe this works with code splitting right now. All I see is an empty output, not sure if its because output.file is not used and output.dir is used instead?

@btd
Copy link
Owner

btd commented Dec 11, 2019

It works with code splitting defenetly. It looks like a bug. But i cabnot say withou details.
You can provide me stats file to take a look

@rvillalba-novetta
Copy link
Author

The issue seems to occur here

image

Node data has no uuid it only has: {children: [], name: "components/Buttons.js"}

I have a structure like this:

components
Buttons
index.js
A.js
B.js

For my input I mapped {components/Buttons: components/Buttons/index.js}

I'm guessing this mapping is the source of the issue?

@btd
Copy link
Owner

btd commented Dec 12, 2019

This is defenetly an issue. How you did mapping? Can you share this part of rollup config?

@rvillalba-novetta
Copy link
Author

I've made a minimal example. Here is the src/ structure:

==> src/index.js <==
export * from "./components/index";

export const top = "top";

==> src/components/A.js <==
export default "A";

==> src/components/B.js <==
export default "B";

==> src/components/index.js <==
export { default as A } from "./A";
export { default as B } from "./B";

And the rollup config:

import visualizer from "rollup-plugin-visualizer";

export default [
  {
    input: {
      index: "src/index",
      "components/index": "src/components/index",
      "components/A": "src/components/A",
      "components/B": "src/components/B"
    },
    plugins: [visualizer()],
    output: [{ dir: "dist", format: "esm" }]
  }
];

btd added a commit that referenced this issue Dec 14, 2019
@btd btd closed this as completed in ea75c74 Dec 14, 2019
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