Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Feature: Force precompile for webpacker #610

Closed
Epigene opened this issue Mar 5, 2018 · 4 comments
Closed

Feature: Force precompile for webpacker #610

Epigene opened this issue Mar 5, 2018 · 4 comments

Comments

@Epigene
Copy link

Epigene commented Mar 5, 2018

Hi,
Mina version 1.0.7

We have a Rails application that uses React via webpacker.

Normally we performed our deploys with mina deploy with "smart precompile", skipping precompilation if there are no changes in asset files, but now we need full precompilation to occur on every deploy for webpacker to work.

Currently we are working around the issue by running mina deploy force_asset_precompile=true, but it would be nice to make changes to deploy.rb to change the default behaviour.

@nvh0412
Copy link

nvh0412 commented Apr 3, 2018

We got the same problem with you. We are still doing a workaround by using force_asset_precompile=true. @d4be4st Would it be possible for you to take a look at this problem?

@TheDartCode
Copy link

To my knowledge, the only problem here is that mina considers only the public/assets path as an asset output path, while webpacker output files are by default stored at public/packs.

The relevant piece of mina source is https://github.com/mina-deploy/mina/blob/master/tasks/mina/rails.rb#L8 -- the compiled_asset_path is a single directory instead of an array.

A workaround for this is to put the following inside your deploy.rb:
set :shared_dirs, fetch(:shared_dirs, []).push('public/assets').push('public/packs')

But of course it would be nice to offer out-of-the-box compatibility!

@ghost
Copy link

ghost commented Aug 20, 2019

👍 I'd like this too.

@NBuhinicek
Copy link

Hey

you could just set up the variable in your deploy.rb file

set :force_asset_precompile, true

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants