mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-09-28 13:13:37 +08:00
We plan to enable source maps for release builds behind a GN flag. For this to work rollup needs to consume the source maps already generated by tsc and merge it with its own source map. Rollup can't do this natively so this CL adds a plugin that can. R=jacktfranklin@chromium.org Bug: 1430396 Change-Id: Ibb38c7892326907431e54b7c7dbd7b912b59ccb9 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4397707 Reviewed-by: Jack Franklin <jacktfranklin@chromium.org> Commit-Queue: Simon Zünd <szuend@chromium.org>
rollup-plugin-sourcemaps
Rollup plugin for loading files with existing source maps. Inspired by webpack/source-map-loader.
Works with rollup 0.31.2 or later.
If you use rollup-plugin-babel,
you might be able to use the inputSourceMap option instead of this plugin.
Why?
- You transpile your files with source maps before bundling with rollup
- You consume external modules with bundled source maps
Usage
import sourcemaps from 'rollup-plugin-sourcemaps';
export default {
input: 'src/index.js',
plugins: [sourcemaps()],
output: {
sourcemap: true,
file: 'dist/my-awesome-package.js',
},
};