-
Notifications
You must be signed in to change notification settings - Fork 27.9k
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
Changes not reflecting in env-config.js (universal-configuration) #1103
Comments
Hmmmmm this is most likely due to babel-loader's caching behaviour. https://github.com/babel/babel-loader#options It saves the files to cc @arunoda |
Oh ok so ill make a npm task to remove that cache before building.. that should do it at least for now. |
@nahue you can actually do this by using module.exports = {
webpack: (config, { dev }) => {
// Perform customizations to config
config.module.rules = config.module.rules.map(rule => {
if(rule.loader === 'babel-loader') {
rule.options.cacheDirectory = false
}
return rule
})
// Important: return the modified config
return config
}
} |
I have the same problem with babel-plugin-inline-react-svg, which changes don't reflect in svg files. "scripts": {
"build": "rimraf node_modules/.cache/babel-loader && next build"
} |
About env vars, also see #1488 (comment), allows to set up env vars at runtime |
After making necessary changes to my app (following the universal-configuration example) i have this env-config.js
So if i run
yarn run build
i should get prod.example.com.But if i run
ENVIRONMENT=staging yarn run build
should be stagingurl.example.com but hey NO! still prod.example.com, so frustating that i had to hardcode values to get it running in production till i figure this one out 😞 .I've noticed that the only way this could change is by running
yarn clean
before each command. Seems like this is being cached and fails to update. Any thoughts?The text was updated successfully, but these errors were encountered: