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
How could I build only one of multiple entries with webpack #3455
Comments
I have been searching high/low for an answer to the same question without any luck. |
thanks for your reply,I think this is a needed feature,It can make me spending little time on building projects.What method can replace it? |
The watch mode does only rebuild changed chunks. A whole compilation need to build all chunks, because they affect eachother |
I have the same issue. Currently I have such case, and by having such feature to run webpack for one of the entries, I think that the development process would be much faster. |
One way you could do it is with the DllPlugin, which will require you to have multiple webpack configs. (There's also a module that lets you combine configs if you want to extract the common pieces of your configs, but for my usage, I didn't need it) Each config will deal with a separate area of the code, and you can build them independently of each other by calling |
An easy way would be to create a separate config file and write something like this
This was useful for me because sometimes, I want to only rebuild the front-end scripts for example and gain a few seconds Then in package.json, I added In the teminal that would be |
You could dynamically filter your entry points in your config based on environment variables.
or with object-rest-spread:
|
This claim seems to be false nowadays or at least does not apply to the topic. I have about 10 entries, each one targeting a single JS file. Each JS file is importing single Elm file loaded by I don't have any issue with similar setup in a project with just one entry, but in my current project we have sort of an MPA described in Webpack docs and I need having multiple entries. Any idea on how to get this? |
@szubtsovskiy will be great if you create minimum reproducible test repo, maybe problem on loader side |
@evilebottnawi Seems I don't have other options anymore, will see to do it! |
That's what I've been able to come with, seems showcasing the problem fine! https://github.com/szubtsovskiy/webpack-sscce Steps to reproduce are in README. |
@szubtsovskiy hm, try to run and got:
|
Oh, |
you can also divide the entries and run it on multiple dev servers , the webpack compiler in each of the dev server will watch the entry points defined and will only rebuild those when file changes. |
I ask this question in webpack/gitter,but nobody answered ,so I come here
with webpack ,we can build multiple entries just like below:
I just change the a.js,I only want to rebuild a.js,But the vendor.js and b.js should not change,how could I do that?
The text was updated successfully, but these errors were encountered: