sprockets icon indicating copy to clipboard operation
sprockets copied to clipboard

Reopening #162: config.assets.debug = true still compiles everything into single CSS/JS files?

Open wlnirvana opened this issue 5 years ago • 5 comments

Reopening #162 which is not fixed with rails 5.2.0 and sprockets-rails 3.2.1

This is a bug with source map generation, but the idea is to generate only one asset in development with source maps pointing to the right source.

Originally posted by @rafaelfranca in https://github.com/rails/sprockets/issues/162#issuecomment-158524035

wlnirvana avatar Jul 04 '20 15:07 wlnirvana

And the source map isn't working, as stated in #656 with Sprockets 4.

gemp avatar Aug 20 '20 17:08 gemp

Hello! Thanks for opening up an issue. In order to move forwards with this issue I'll need an example app that reproduces the behavior (https://www.codetriage.com/example_app).

schneems avatar Sep 25 '20 21:09 schneems

any update on this? Still not working!

fnicastri avatar Dec 20 '20 11:12 fnicastri

The semantic has changed a bit as far as I understand. You need to select a pipeline in debug mode. Please consult this patch, especially changes to file lib/opal/sprockets/assets_helper.rb:

https://github.com/opal/opal-sprockets/commit/6d9bc126675f27a1e2e37b50a747f349e599b320

By default it uses a "default" pipeline, which returns a concatenated file without source maps, you expect a "self" pipeline, which is without source maps, "debug" pipeline returns a concatenated file WITH source maps

Yes, it's true that it returns a single file, but with the more robust caching in 4.0 it works well enough in my experience.

hmdne avatar Feb 12 '21 01:02 hmdne

Hello! Thanks for opening up an issue. In order to move forwards with this issue I'll need an example app that reproduces the behavior (https://www.codetriage.com/example_app).

I found also this issue in rails: https://github.com/rails/rails/issues/43203 The author created already an example app here: https://github.com/josh-m-sharpe/assets_test

afdev82 avatar Sep 20 '21 14:09 afdev82