react-prod-sourcemaps

A tool to update app sourcemaps with the original code of ReactDOM's production builds

MIT License

Downloads
25K
Stars
54

Bot releases are visible (Hide)

react-prod-sourcemaps - v0.3.1 Latest Release

Published by markerikson about 1 month ago

This release adds sourcemaps for the React 18.3.1 prod artifacts. (I'm skipping React 18.3.0 given that 18.3.1 came out immediately after.)

Full Changelog: https://github.com/markerikson/react-prod-sourcemaps/compare/v0.2.2...v0.3.1

react-prod-sourcemaps - v0.2.2

Published by markerikson about 2 months ago

This release adds a sourcemap artifact for react-jsx-runtime.production.min.js for React 18.2. I haven't built that for React 18.1 or 17.0.2 yet, but could if needed.

react-prod-sourcemaps - v0.2.1

Published by markerikson about 2 months ago

This release adds new options for verbose logging, and to optionally throw an error if no matching React version is found.

What's Changed

Full Changelog: https://github.com/markerikson/react-prod-sourcemaps/compare/v0.2.0...v0.2.1

react-prod-sourcemaps - v0.2.0

Published by markerikson about 1 year ago

This release updates the logic to handle replacing sourcemaps for multiple React artifacts in one app sourcemap (such as both react and react-dom), and adds sourcemaps for react and react-dom.profiling for versions 17.0.2, 18.1, and 18.2.

What's Changed

Full Changelog: https://github.com/markerikson/react-prod-sourcemaps/compare/0.1.0...v0.2.0

react-prod-sourcemaps - v0.1.0

Published by markerikson about 1 year ago

This release updates the build config to fix ESM/CJS package publishing issues.

What's Changed

Full Changelog: https://github.com/markerikson/react-prod-sourcemaps/compare/0.0.5...0.1.0

react-prod-sourcemaps - v0.0.5

Published by markerikson about 1 year ago

This release adds tests for the build tool plugins, adds a new CLI option to preserve the original sourcemaps, and adds a new "strict" option to the build tool plugins to error if no sourcemaps were updated.

What's Changed

Full Changelog: https://github.com/markerikson/react-prod-sourcemaps/compare/0.0.4...0.0.5

react-prod-sourcemaps - v0.0.4

Published by markerikson about 1 year ago

This release adds a set of build tool plugins for Webpack, Vite, and other tools (based on Unplugin), adds an option for verbose logging, improves checks for which React file is replaced, and adds a sourcemap asset for the latest experimental build of React ( 20230907 ).

(Includes changes from both 0.0.3 and 0.0.4)

Changelog

Build Tool Plugins

We've wrapped up the sourcemap replacement logic and generated a set of build tool plugins using https://github.com/unjs/unplugin .

The exports are:

import {
  ViteReactSourcemapsPlugin, 
  RollupReactSourcemapsPlugin,
  WebpackReactSourcemapsPlugin, 
  RspackReactSourcemapsPlugin
  EsbuildReactSourcemapsPlugin
} from "@acemarke/react-prod-sourcemaps";

As a rough example of usage, see the changes in this PR to add the Webpack plugin to Replay.io's Next config:

config.plugins.push(WebpackReactSourcemapsPlugin({ debug: false }));

See the Unplugin docs for examples of where and how to add plugins to each build tool:

What's Changed

Full Changelog: https://github.com/markerikson/react-prod-sourcemaps/compare/0.0.2...0.0.4

react-prod-sourcemaps - v0.0.2

Published by markerikson about 1 year ago

This release adds the sourcemap for ReactDOM 17.0.2, and fixes the "main" field to (hopefully) actually point to the correct entry point if you want to import the rewriting logic.

Full Changelog: https://github.com/markerikson/react-prod-sourcemaps/compare/0.0.1...0.0.2

react-prod-sourcemaps - v0.0.1

Published by markerikson about 1 year ago

Initial Release!

This first release includes sourcemaps for ReactDOM 18.2.0 and 18.1.0, and a CLI tool that will update a single input sourcemap file to use the original contents of ReactDOM if it detects a matching version by content hash:

yarn add @acemarke/react-prod-sourcemaps
./node_modules/.bin/react-prod-sourcemaps --inputFile path/to/your/appBuild/sourcemap.js.map
# Output file will currently be written to sourcemap.remapped.js.map