Replies: 1 comment
-
+1 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
My folder structure is
So, basically I import like this
import { Button, Checkbox } from './components/Base';
Similarly for composite and containers but in my build I am getting all my components getting added together in common chunk like this
This is the screenshot of bundle
https://i.ibb.co/58dDptC/Screenshot-2020-05-28-at-3-19-35-PM.png
Than I tried importing like this
import Button from './components/Base/Button/Button';
import Checkbox from './components/Checkbox/Checkbox';
and my common chunk reduced significantly but the problem was I need to use absolute path of files.
But with Next 9.4 even I also added alias to do that
https://nextjs.org/docs/advanced-features/module-path-aliases
and which changed my import to
import Button from '@base/Button/Button';
import Checkbox from '@base/Checkbox/Checkbox';
Now the problems with the above
import { Button, Checkbox } from '@base';
because if I do so my build gets bigger.Beta Was this translation helpful? Give feedback.
All reactions