Skip to content

Conversation

brandonpayton
Copy link
Member

Motivation for the change, related issues

Enabling source map generation for production builds would make it easier to debug Playground in production.

Implementation details

I edited all vite.config.js files and added sourcemap: true to generate separate source maps files for all package builds. Keeping separate source maps should allow us to only pay the cost for downloading them when actively debugging.

Testing Instructions (or ideally a Blueprint)

  • Create a production build, serve it via a local web server, open dev tools, and confirm it is possible to view the original source code.
  • CI
@adamziel
Copy link
Collaborator

Seems like there's a linting issue stopping the other CI checks

@brandonpayton brandonpayton merged commit bba856f into trunk Dec 17, 2024
10 checks passed
@brandonpayton brandonpayton deleted the enable-production-source-maps branch December 17, 2024 20:54
@adamziel
Copy link
Collaborator

adamziel commented Feb 25, 2025

@brandonpayton It seems like this PR added source maps to the list of mandatory downloads at https://playground.wordpress.net/assets-required-for-offline-mode.json:

[ "/assets/_virtual_cors-proxy-url-565333ec.js", "/assets/_virtual_cors-proxy-url-565333ec.js.map", "/assets/brain-1418d665.svg", "/assets/builder/builder.html-20166f80.js", "/assets/builder/builder.html-20166f80.js.map", "/assets/builder-0648a1dd.css", "/assets/builder-e4f9112a.js", "/assets/builder-e4f9112a.js.map", "/assets/client-3dcfb6e9.js", "/assets/client-3dcfb6e9.js.map",

Let's remove them as they can be quite large.

@brandonpayton
Copy link
Member Author

Thanks for mentioning it, @adamziel. That is now fixed via #2159 and deployed to playground.wordpress.net.

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