Fix "require" name override breaking sourcemaps
In order to avoid conflicts with any existing global `require` functions on the host page, JS bundles are configured to export their `require` function as `hypothesisRequire` and bundles loader later are modified to use that function to import modules from earlier bundles. Overriding the name used for importing from earlier bundles was previously done by prepending some code to the start of the bundle. Unfortunately the source map information was not updated so this broke sourcemap locations in the generated bundle. Change the approach instead to modify the "prelude" script that Browserify inserts at the top of the bundle.
Showing
Please register or sign in to comment