Skip to content
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

Clear require cache for config reloads. #1809

Merged
merged 1 commit into from
Aug 28, 2014

Conversation

rwjblue
Copy link
Member

@rwjblue rwjblue commented Aug 28, 2014

Wrapping in a Function worked for simple config/environment.js contents but breaks down in other scenarios that relied on the file being evaluated in "nodeland". The prior implementation prevented custom require's (to get the package name from the package.json for instance).

Now we just clear the require cache to allow re-requiring the file again.

Documentation of require.cache:

http://nodejs.org/api/globals.html#globals_require_cache

Wrapping in a `Function` worked for simple `config/environment.js`
contents but breaks down in other scenarios that relied on the file
being evaluated in "nodeland".  The prior implementation prevented
custom `require`'s (to get the package name from the `package.json`
for instance).

Now we just clear the `require` cache to allow re-requiring the file
again.
rwjblue added a commit that referenced this pull request Aug 28, 2014
Clear require cache for config reloads.
@rwjblue rwjblue merged commit 2ecca09 into ember-cli:master Aug 28, 2014
@rwjblue rwjblue deleted the properly-clear-node-cache branch August 28, 2014 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants