Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSS source maps missing in build output #1793

Closed
teodragovic opened this issue Jun 29, 2023 · 3 comments · Fixed by #1794
Closed

CSS source maps missing in build output #1793

teodragovic opened this issue Jun 29, 2023 · 3 comments · Fixed by #1794

Comments

@teodragovic
Copy link
Contributor

What is the current behaviour?

  • Running preact build produces build with source maps for JS files but no source map for CSS
  • Behavior is same for the project I'm working on and clean install and using either CSS or SASS
  • I see sourceMap option set to true in webpack config for all loaders but also css.map missing in tests (otherwise they would fail) so not sure if bug or per design?
  • CSS source map is included in ssr-build though

What is the motivation or use case for changing this behaviour?
We pushed a big redesign to production and some users are reporting page being broken due to CSS not loading. We suspect parsing error so having source map would be helpful to run down the issue.

Describe the solution you'd like
Output CSS source maps in build by default or provide options/recipe how to enable

Please paste the results of npx preact-cli info here.

Environment Info:
  System:
    OS: Windows 10 10.0.19044
    CPU: (16) x64 Intel(R) Core(TM) i7-10700F CPU @ 2.90GHz
  Binaries:
    Node: 16.18.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.19 - C:\Program Files\nodejs\yarn.CMD
    npm: 8.19.3 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Spartan (44.19041.1266.0), Chromium (114.0.1823.58)
  npmPackages:
    preact: 10.15.1 => 10.15.1
    preact-cli: ^3.3.0 => 3.4.1
    preact-render-to-string: ^5.1.19 => 5.2.6
    preact-router: ^3.2.1 => 3.2.1
@rschristian
Copy link
Member

rschristian commented Jun 29, 2023

This looks to be fixed in @next, but will take a look a bit later for v3.

To your question, I don't think this was by design, no, just something that no one looked into fixing. I would happily have them enabled by default in v3 if we can get that fixed.

@teodragovic
Copy link
Contributor Author

teodragovic commented Jun 30, 2023

@rschristian thanks, good to know. I poked around some and found the issue in OptimizeCssAssetsPlugin setting which should be set as described here.

PR here: #1794

@rschristian rschristian linked a pull request Jun 30, 2023 that will close this issue
@rschristian
Copy link
Member

Released as v3.4.6

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 a pull request may close this issue.

2 participants