-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
fix(vite): Support fileReplacements for devServer #13761
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
Hello! Thanks for the PR! Do you want to check your errors and fix them? Then I can approve! Have you tested it, does it work properly in all scenarios? |
I think format check failed (maybe??). Can you try also |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mandarini I have amended the fs
import
@nodegin thanks! Did you also run |
@mandarini Sorry I updated again to format the code. |
Co-authored-by: <john@doe.gov> (cherry picked from commit b3ff11f)
@nodegin I reverted your PR because it was causing issues with the source maps. Let me know if you can look into it more, since I guess reverting your PR brings back the devserver issue you had observed. |
in version 15.4.4 fileReplacements are not working, i downgraded nx to 15.4.2 and now working |
Are you referring to the build fileReplacements, or the devServer fileReplacements? @KayhanB |
build is working but devServer is not @mandarini |
Linking this here Will take a look at that some time next week. |
@KayhanB @nodegin I'll see how I can fix this so that both build and dev-server work. However, we do suggest this, using Please let me know if there's a reason why you prefer the |
@mandarini I think for some case we might want to replace some files (e.g. some code logic to execute?) in different environments instead of just configurations |
I see. I am working on it! |
Hey, people! So, we decided that this is not in our immediate plans at the moment, after all. That being said, if any one of you can spend some time putting together a pull request to make this work, I'll be more than happy to test it out, make sure it works, and merge it. At the same time, if one wants this functionality for Nx, what they can do, is write their own plugin in their workspace, and just add it in the As an alternative, please consider using Just as a reminder, fileReplacement does work for the prod builder! |
hi @mandarini |
This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request. |
Current Behavior
The
fileReplacements
option does not work with@nrwl/vite:dev-server
executorExisting solution using
resolveId
only works when building but not local devExpected Behavior
When also passing
fileReplacements
in the "serve" section for the dev server,It should also do the replacement
Related Issue(s)
Fixes #13758