-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
"webpacker:yarn_install" Task removes dev dependencies #1330
Comments
This was referenced Mar 9, 2018
Nice one, spent some hours until discover this )= |
As a temporary workaround one can redefine the Rake task: # lib/tasks/webpacker.rake
# Redefining task so we don't remove the dev dependencies when running on CI
Rake::Task["webpacker:yarn_install"].clear
namespace :webpacker do
desc "Support for older Rails versions. Install all JavaScript dependencies as specified via Yarn"
task :yarn_install do
if ENV["RAILS_ENV"] == "production"
system "yarn install --no-progress --frozen-lockfile --production"
else
system "yarn install --no-progress"
end
end
end |
hallelujah
added a commit
to 3scale/porta
that referenced
this issue
Oct 11, 2018
Reported issue rails/webpacker#1330 Making it environment aware allow CI build to precompile assets
Closing - fixed in #1331 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
On CircleCI, with a Rails 4.2 app, our RSpec test suite precompiles assets. This triggers a
webpacker:yarn_install
andwebpacker:compile
:webpacker/lib/tasks/webpacker/compile.rake
Lines 11 to 19 in 54c0a64
Unfortunately the
webpacker:yarn_install
task isn't environment-aware:webpacker/lib/tasks/webpacker/yarn_install.rake
Line 4 in 54c0a64
The
--production
flag ends up removing the JS dev dependencies. On CI this means we'd have to re-runyarn install
before running JS unit tests or redefine the Rake task.Rough overview of the steps on CI:
The text was updated successfully, but these errors were encountered: