简体   繁体   中英

Seeing other files when using Ruby on Rails Asset Pipeline

I'm using the RoR asset pipeline by calling //= require_tree . in my application.js file. When I load the page and go to network developer tools in Firefox I see network calls to all of the js files instead of just the application.js file. I'm pretty sure the application.js is compressed and ready to use but is it normal to see network calls to all the other files even though they should already be the application.js file?

That's the intended behavior. You can change it if you want in development.rb by flipping this setting to false

# Debug mode disables concatenation and preprocessing of assets.
# This option may cause significant delays in view rendering with a large
# number of complex assets.
config.assets.debug = true

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM