rails / sprockets

Rack-based asset packaging system
MIT License
955 stars 790 forks source link

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

Open wlnirvana opened 4 years ago

wlnirvana commented 4 years ago

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

gemp commented 4 years ago

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

schneems commented 4 years ago

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).

fnicastri commented 3 years ago

any update on this? Still not working!

hmdne commented 3 years ago

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.

afdev82 commented 3 years ago

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