With LightningCSS I have to do some gymanstics to produce a usable sourcemap. The command lightningcss ./app/stylesheet/application.css -o ./public/build/application.css --sourcemap adds /*# sourceMappingURL=./public/build/application.css.map */ as a comment and makes it impossible for the browser to load.
I have to run cd public/build && lightningcss ../../app/stylesheet/application.css -o application.css --sourcemap to produce a sourcemap comment that is actually usable. /*# sourceMappingURL=application.css.map */
The sourcemap file as always saved in the same folder as the output is. LightningCSS should just set the filename and omit the path that the outfile might be part of. This is also the behaviour that sass is doing.
With LightningCSS I have to do some gymanstics to produce a usable sourcemap. The command
lightningcss ./app/stylesheet/application.css -o ./public/build/application.css --sourcemap
adds/*# sourceMappingURL=./public/build/application.css.map */
as a comment and makes it impossible for the browser to load.I have to run
cd public/build && lightningcss ../../app/stylesheet/application.css -o application.css --sourcemap
to produce a sourcemap comment that is actually usable./*# sourceMappingURL=application.css.map */
The sourcemap file as always saved in the same folder as the output is. LightningCSS should just set the filename and omit the path that the outfile might be part of. This is also the behaviour that sass is doing.
Using the filename from out_file here and writing that into the code should do it. I did try doing that myself but I haven't done rust before and am unable to cope with all the string types. https://github.com/parcel-bundler/lightningcss/blob/eb280df5c135e647b05a409017ecb3ce6e337494/src/main.rs#L245-L251