rails config.assets.precompile for specific sub folder

ε祈祈猫儿з 提交于 2020-01-02 01:25:07

问题


Ive some very heavy external stylesheets in app/assets/stylesheets/external/calendars I dont want to include the stylesheets into the application.css as they are used infrequently

Yet i want them precompiled.

Ho w do i use config.assets.precompile o selectively precompile all stylesheets nside this folder ?


回答1:


This is covered in section 4.1 of the Asset Pipeline Rails Guide

config.assets.precompile += ["*external/calendars*"]



回答2:


You can simple write it like this:

config.assets.precompile += ['directory1/*', 'directory2/*', 'file.js']

Or use a cleaner syntax like this:

config.assets.precompile += %w( directory1/* directory2/* file.js )


来源:https://stackoverflow.com/questions/13001274/rails-config-assets-precompile-for-specific-sub-folder

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!