Accessing asset_path in webpacker *.js.erb pack

— 1 minute read

Boost on DEV

I’ve configured webpacker to be able to [process ERBs]( erb) ( bundle exec rails webpacker:install:erb ) because I need paths generated by Sprockets' asset_path at build time so that I get properly generated asset URLs.

The ERB integration works with the simple example that you get after installing ERB/Webpacker integration, but I’m wondering how to have access to asset_path . From what I’ve found so far, it doesn’t appear to be possible,

Does anyone know if it's possible? In the meantime, I will keep digging 😉

Person slipping and sliding while attempting to shovel snow

Comment on DEV