Skip to content

Embed sources in CSS sourcemaps#2668

Merged
nickcharlton merged 1 commit intothoughtbot:mainfrom
ignisf:embed-sources
Sep 30, 2024
Merged

Embed sources in CSS sourcemaps#2668
nickcharlton merged 1 commit intothoughtbot:mainfrom
ignisf:embed-sources

Conversation

@ignisf
Copy link
Contributor

@ignisf ignisf commented Sep 29, 2024

  • What were you trying to do?
    Trying to debug UI issues with the new Administrate beta version (turns out they are resolved in main?).

  • What did you end up with (logs, or, even better, example apps are great!)?
    Whenever I open Firefox/Chrome dev tools, they try to load the SCSS source files from the Rails server, which fails, as expected, with 404.

  • What versions are you running?

    • Rails 8.0.0.beta1
    • administrate 1.0.0.beta1

I suggest you add the --embed-sources switch to the build:css yarn incantation.

Tested locally:
image

    This flag tells Sass to embed the entire contents of the Sass files
    that contributed to the generated CSS in the source map. This may
    produce very large source maps, but it guarantees that the source
    will be available on any computer no matter how the CSS is served.

https://sass-lang.com/documentation/cli/dart-sass/#embed-sources
@nickcharlton
Copy link
Member

That's a lovely idea, thanks.

(I'll be cutting a new release candidate release soonish so hopefully you'll also have less annoying bugs to track down!)

@nickcharlton nickcharlton merged commit 22a3d26 into thoughtbot:main Sep 30, 2024
@ignisf
Copy link
Contributor Author

ignisf commented Sep 30, 2024

Thank you, I am eagerly spamming bundle update ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants