-
Notifications
You must be signed in to change notification settings - Fork 80
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
Importing a file with universal includes all the contents of its sibling directories #197
Comments
I think this is behaviour of webpack's resolve.weak (someone correct me if I'm wrong). It doesn't know what you want loaded at run-time, so it prepares references to everything possible in the directory. You could try using |
So something like this?
const Foo = universal(
import(/* webpackExclude: __generated__,__tests__ */ 'Foo')); |
@volkanunsal You could also import directly the file that you want |
@rtymchyk Hm.... neither of those worked in my case. |
Here is what did work. I also had to add const CompanyEdit = universal(
import(
/* webpackExclude: /(__generated__|__tests__)/ */
/* webpackMode: "weak" */
'comps/Company/Edit'
)
); But that just bundles everything into a single chunk. It doesn't generate any other chunks. |
yep, you got it - use magic comments to exclude glob imports |
Hello,
I'm running into an issue in my production builds. This is what I have in my bundle file.
The production build of the system includes the contents of
__tests__
and__generated__
folders.I'm using version 4 of react-universal-loader with Webpack 4.39.2.
The text was updated successfully, but these errors were encountered: