Skip to content

'assets:precompile' does not install devDependencies #1751

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

Closed
paulgeisler opened this issue Oct 12, 2018 · 2 comments
Closed

'assets:precompile' does not install devDependencies #1751

paulgeisler opened this issue Oct 12, 2018 · 2 comments

Comments

@paulgeisler
Copy link

paulgeisler commented Oct 12, 2018

What's the reason behind installing node modules only from 'dependencies' through the '--production' flag?

system "yarn install --no-progress --frozen-lockfile --production"

I do have some dependencies which are needed to build the app and are declared as 'devDependencies' (for example 'sass-resources-loader'). Another mate had to put all the testing clobber into 'dependencies' because the modules were missing in the test environment (after 'assets:precompile' ) which is semantically wrong.

It was really confusing and hard to find out because i've never experienced this routine for installing/building JS apps. There are always the 'yarn / npm install' commands in the instructions.

Usually there are a lot of transpilers in 'devDependencies' (babel, coffeescript, pug ...) so how does it work without them or should those be moved to 'dependencies' 🤔❓

It's not even analogue to Rails 5.1 yarn:install.
https://github.com/rails/rails/blob/v5.1.2/railties/lib/rails/tasks/yarn.rake#L4
system("./bin/yarn install --no-progress")

I would appreciate some clarification (and maybe a little lesson about dependencies declaration). 🙂

@gauravtiwari
Copy link
Member

@paulgeisler Please see this issue: #160 and #117

Also see, https://yarnpkg.com/lang/en/docs/cli/install/#toc-yarn-install-production-true-false

We should probably remove the production flag but either way if NODE_ENV is set to production only the modules listed in dependencies section would be installed. So, please consider moving build modules to dependencies section.

@paulgeisler
Copy link
Author

I see... Thanks! :)

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

2 participants