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

Webpack executable not found on production #117

Closed
gauravtiwari opened this issue Feb 25, 2017 · 4 comments
Closed

Webpack executable not found on production #117

gauravtiwari opened this issue Feb 25, 2017 · 4 comments

Comments

@gauravtiwari
Copy link
Member

Related to #116. Basically, when using the --production flag, or NODE_ENV=production environment variable, Yarn will not install any package listed in devDependencies. https://yarnpkg.com/lang/en/docs/cli/install/#toc-yarn-install-production

In our config files we are using packages that also needs to be available on production to compile the assets. Therefore, the dependencies which are used in production should be moved to dependencies block instead of devDependencies.

I can make a PR once #111 is merged

@dleavitt
Copy link
Contributor

dleavitt commented Feb 25, 2017

Background: right now we're putting build deps under devDependencies even though they're required in production.

Pretty sure that setting NPM_CONFIG_PRODUCTION=false on production fixes this problem. This should probably be hardcoded into the rake task, in fact.

I think the "correct" solution would be to move everything under dependencies rather than devDependencies. Right now they're being misused in a way that's convenient (and common) but that doesn't actually reflect their semantics.

dleavitt pushed a commit to dleavitt/webpacker that referenced this issue Feb 26, 2017
Right now webpack compilation errors are swallowed and the compile task exits silently. This is causing a lot of confusion - is it yarn? is it Heroku? Is it me? See rails#116, rails#117, rails#90, etc.

This commit causes the errors to be displayed instead.
dleavitt pushed a commit to dleavitt/webpacker that referenced this issue Feb 26, 2017
Heroku as well as other deployment strategies don't currently work out of the box. I have further bloated the README with some instructions on how to make them work. See rails#117 for an example of the issue and what might be a better ultimate solution.
dleavitt pushed a commit to dleavitt/webpacker that referenced this issue Feb 26, 2017
Heroku as well as other deployment strategies don't currently work out of the box. I have further bloated the README with some instructions on how to make them work. See rails#117 for an example of the issue and what might be a better ultimate solution.
@justin808
Copy link
Contributor

@dleavitt The only things that should go under devDependencies are things like eslint, flow, the webpack dev server. Any build tools need to be under "dependencies.

@dleavitt
Copy link
Contributor

Indeed, that's what I was (trying to) say above. Sure makes package.json prettier when you do it the wrong way though.

@dhh
Copy link
Member

dhh commented Feb 27, 2017 via email

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

No branches or pull requests

4 participants