Skip to content

Support Rails 6 asset recompilation through webpacker - #656

Merged
lovro-bikic merged 3 commits into
mina-deploy:masterfrom
the-spectator:support_webpacker
Aug 14, 2021
Merged

Support Rails 6 asset recompilation through webpacker #656
lovro-bikic merged 3 commits into
mina-deploy:masterfrom
the-spectator:support_webpacker

Conversation

@the-spectator

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

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Contributor Author

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

@varunempire

Copy link
Copy Markdown

@rstacruz Can you please check this PR..

@m4c3

m4c3 commented Sep 23, 2020

Copy link
Copy Markdown

Can you please merge this?

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

@lovro-bikic lovro-bikic left a comment

Copy link
Copy Markdown
Member

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.

Comment thread tasks/mina/rails.rb Outdated
Comment thread tasks/mina/rails.rb Outdated
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
Copy Markdown
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.

6 participants