-
Notifications
You must be signed in to change notification settings - Fork 809
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
Compiling artefacts dependant on other artefacts #3104
Comments
I've been thinking about this. I think that the general case for this might be too complicated however for the case of styles, combine, and maybe minify we are likely going to make it run after the webpack build has finished (if I can find a way to do it within the build and still produce the desired output I'll do that but I'm not certain). Question about your example: Is there a reason you want to produce unmagnified output and then minify it later rather than let webpack handle it during the production compile? Or was that just a "trivial" example you could use to explain the situation? |
Yes, this is just a simplified demonstration of what I'm trying to achieve - what I'm actually trying to do is create multiple artefacts with different build targets, which themselves are based on other artefacts which have been built using a mix of |
What would be the purpose of combining files from multiple build targets? Also, as an aside, if you're working with different build targets would this WIP PR be useful for you? #3096? I know of several use cases but I want to be sure I'm planning ahead for future capability. The other thing I'm thinking about (but not sold on because of the inherent complexity) is linear, acyclic dependencies between groups. |
Yes, that PR does look promising! Hmm I think I'm not explaining my issue very well - But basically I want to take the existing artefact(s) and recompile them to a new target (But both are needed, as separate files). I could probably rebuild from the source again, but I'm not sure if this would be more efficient or not as primarily I'm trying to cut down the overall build time. |
Okay, got it. I'll give it some thought. It may be that the task changes set to land in 6.1 will suffice for your use case. |
Ah I didn't mean to close this one. |
Description:
I'm trying to build artefacts that are dependant on artefacts created by previous build steps - for example, to create one file which is first compiled without minification, then a second which is minified, creating two separate files (where the second artefact is built using the source of the first). This appears to have been asked before, however, the solution/workaround given in the last comment no longer appears to work. Instead, while it does create two files, the minified version will always be an empty file. I've been able to get around this issue by running mix twice, either using the same
*.mix.js
file or two separate ones, but is not ideal as it results in increased build times by having to run parts of the build twice - redundantly. Is this intended/possible/in the scope of this project?Steps To Reproduce:
Create a new laravel application, update
webpack.mix.js
to the followingExecute
npm run production
Expected output is
Actual output is
The text was updated successfully, but these errors were encountered: