LoginSignup
0
0

More than 1 year has passed since last update.

Railsのsprockets4.xでengineの設定を行う方法

Posted at

sprockets4.xからprecompileの設定方法が変わりましたが、一部機能をengineや別のgemに切り分けている場合、うまくprecompileされない問題が発生しましたので、解決方法をまとめます。

環境

  • rails 5.2.6
  • speockets 4.0.2

解決方法

Rails(本体)側の設定

  • app/assets/config/manijest.js//=link {engine_name}を追加

Rails(engine)側の設定

  • app/assets/config/{engine_name}.jsを作成
  • precompileが必要なファイルを作成したjsに設定する(記法はmanifest.jsと同じ)

おまけ

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0