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

Support Rails 6 asset recompilation through webpacker #656

Merged
merged 3 commits into from
Aug 14, 2021

Conversation

the-spectator
Copy link
Contributor

@the-spectator the-spectator commented Dec 24, 2019

In Rails 6, Webpacker is the default JavaScript compiler.
This PR adds app/javascript/ to asset_dir & public/packs/ to complied_asset_path as it is the default directory used by Webpacker.

@the-spectator
Copy link
Contributor Author

Hi @d4be4st, just a friendly ping. Can you please check this PR.

@varunempire
Copy link

@rstacruz Can you please check this PR..

@m4c3
Copy link

m4c3 commented Sep 23, 2020

Can you please merge this?

@lovro-bikic lovro-bikic added this to the 1.3.0 milestone Aug 11, 2021
Copy link
Member

@lovro-bikic lovro-bikic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, thanks for the PR. It's good overall, I'd just like to add package.json to asset dirs and node_modules to shared dirs.

tasks/mina/rails.rb Outdated Show resolved Hide resolved
tasks/mina/rails.rb Outdated Show resolved Hide resolved
Akshay Birajdar and others added 3 commits August 14, 2021 10:21
In Rails 6, Webpacker is the default JavaScript compiler. This commit
add app/javascript/ to asset_dir as it is the default directory used by
Webpacker.
lovro-bikic
lovro-bikic approved these changes Aug 14, 2021
@lovro-bikic lovro-bikic merged commit 5f413c2 into mina-deploy:master Aug 14, 2021
lovro-bikic added a commit that referenced this pull request Oct 3, 2023
lovro-bikic added a commit that referenced this pull request Oct 3, 2023
lovro-bikic added a commit that referenced this pull request Oct 3, 2023
* Revert "Support Rails 6 asset recompilation through webpacker  (#656)"

This reverts commit 5f413c2.

* Update expected output
@lovro-bikic
Copy link
Member

Reverted in #723, the main reason being backward compatibility.

This still doesn't prevent you from using Webpack with Mina on your project because you can adjust the variables in your project's deploy.rb the same way they have been adjusted in this PR:

# config/deploy.rb
set :compiled_asset_path, ['public/assets', 'public/packs']
set :asset_dirs, ['vendor/assets/', 'app/assets/', 'app/javascript/', 'package.json']
set :shared_dirs, fetch(:shared_dirs, []).push('log', 'tmp/cache', 'node_modules', *fetch(:compiled_asset_path))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants