-
Notifications
You must be signed in to change notification settings - Fork 166
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
[BUG] Code splitting not working. #17
Comments
Issue was resolved in: #14 Please update the branch and try again. In regards to your second point, the best we can do is:
If we use |
@HarveyD Thanks, it's worked. Just one question: |
You have to add an entrypoint to the new component in
|
@HarveyD I added there. I don't know why but this config didin't work for me because when I add
As you can see I have one
I think something is missing here. 🤔 |
I've updated the branch. You'll need to rebase on it, or look at what I've changed (removed |
@HarveyD I applied all of your changes (remove
I change this line react-component-library/tsconfig.json Line 5 in fbe7fc9
"declarationDir": "build/src" and it's a little cleaner now but still I don't know why I have node_modules and _virtual folder here. 🤔Any idea? |
Also when I want to use this component library in a react app based on create-react-app I gave a lot of error like this:
It sees it's about our dependencies types: |
@HarveyD My issue fixed after install and add this module to rollup config: |
Yeah it seems like code splitting and bundling 3rd party dependencies don't play nicely together. The plugin you mentioned checks all the dependencies and prevents them from being bundled (and the This means you'll have to include these 3rd party libraries in projects using your component library. As such, I recommend including them as |
@HarveyD Thanks for your answer. |
This is sort of unrelated but I saw that you replaced the postcss plugin with sass as part of the fix for this. When using the sass plugin with I haven't looked into the cause of this, but it's similar behavior in a project of mine. To reproduce, update
|
I checked the code splitting branch and it seems it's not working. After doing changes and try using the component-library in a test app (created by CRA) I got this error: (I build and re-install the package after add code splitting and run
yarn cache clean
)I tried to access
TestComponent
exactly the same as you told in your article, like this:Also, this is the folder structure after code-splitting contains folders like
node_modules
andsrc
and it's not clean enough:It's better to able import component in code splitting like this:
Rather than this:
The text was updated successfully, but these errors were encountered: