-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
[Web/Vite] to fileReplace or not? #14256
Comments
@vicb Thanks for reporting the issue. We definitely want to make sure the The reason we are moving away from |
This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context. |
Current Behavior
When you generate a new web app using vite:
nx generate @nrwl/web:application test --bundler=vite
It will generate
But the configuration does not use those files:
I was expecting to see something like:
Expected Behavior
I first thought that the
fileReplacements
should be added the project.json.But digging into the code it seems that the intent is to remove the
src/environments/...
files and have the users useimport.meta.env.MODE
instead.So this line obviously doesn't work.
Github Repo
n/a
Steps to Reproduce
See the description
Nx Report
Failure Logs
No response
Additional Information
I am not sure how this is best fixed.
One way is to make sure that deleting the
src/environments/*
files work as expected.On the other hand I see no reason why not to support file replacement with vite out of the box? Users would have a similar way to work whatever the bundler they use and they could still use
import.meta.env.MODE
if they prefer.(I have been using file replacement with vite and so far it works great)
The text was updated successfully, but these errors were encountered: