-
-
Notifications
You must be signed in to change notification settings - Fork 94
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
Use code-splitting and npm bundling together with figwheel-main #308
Comments
One recommendation here would be that you can create a build script to do what you want it to do and hard code the file names and call that build script from the bundle-cmd. You would need to bundle twice for the example above. I've never don't this so I'm speculating here. Another idea to consider is that you can have two completely separate configurations for dev and prod. You can do the code splitting in prod and have a much simpler config for dev. A different entry namespace for dev and prod can simplify a lot of this stuff for you. |
I have a number of clojurescript applications that already use npm bundling, but as they grow in size I want to see if I can use code splitting as well. I ran through the demo on code splitting and had no issues there. But when I added react dependencies with npm bundling I was running into issues. I tried arranging my
dev.cljs.edn
in a few different ways, but it seems when I add a:target
to the config the modules get ignored entirely.My first attempt was to just add the bundling options:
This results in the following error:
I realize the issue is that using
:modules
ignores the top-level:output-to
so I suppose when combining it with:bundle-cmd
the various configurations. I tried to merge the bundle configs in with each individual module on a random whim, but nothing happened.Next I tried removing the bundling and leave just the code splitting configs when I built the resources. I tried to run the bundling separately from the terminal. I set up my
webpack.config.js
like so:I thought perhaps it would work if I bundled each outputted moduled with the npm dependencies, and while it seems to work the app itself is still unable to resolve any npm modules when I run it.
Ideally, when setting both
:modules
and:target
the resulting modules would be individually compiled and bundled, but there are probably more complicated things to consider I am unaware of.The text was updated successfully, but these errors were encountered: