mirror of
https://github.com/rubyjs/mini_racer
synced 2023-03-27 23:21:28 -04:00
723958f4da
* Add example of using source-map-support * Address PR comments
20 lines
590 B
JavaScript
20 lines
590 B
JavaScript
import { ErrorCausingComponent } from "./error-causing-component.jsx";
|
|
|
|
if (process.env.NODE_ENV === "production") {
|
|
require("source-map-support").install({
|
|
// We tell the source-map-support package to retrieve our source maps by
|
|
// calling the `readSourceMap` global function, which we attached to the
|
|
// miniracer context
|
|
retrieveSourceMap: filename => {
|
|
return {
|
|
url: filename,
|
|
map: readSourceMap(filename)
|
|
};
|
|
}
|
|
});
|
|
}
|
|
|
|
// We expose this function so we can call it later
|
|
export function renderComponent() {
|
|
ErrorCausingComponent();
|
|
}
|