-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
misc(build): fix lightrider report generator bundle #14031
Conversation
@@ -35,17 +35,22 @@ async function buildReportGenerator() { | |||
[`${LH_ROOT}/report/generator/flow-report-assets.js`]: 'export default {}', | |||
}), | |||
rollupPlugins.commonjs(), | |||
rollupPlugins.nodeResolve(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this just wasn't necessary
// adds a `require('fs')` when used above, which errors in google3 build. | ||
const outPath = `${LH_ROOT}/dist/lightrider/report-generator-bundle.js`; | ||
fs.writeFileSync(outPath, | ||
fs.readFileSync(outPath, 'utf-8') + '\nwindow.ReportGenerator = ReportGenerator;\n'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shrug
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
worked for me.
// Typically one would use `umd` to export to the window object, but for some reason rollup | ||
// adds a `require('fs')` when used above, which errors in google3 build. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why don't we just shim fs
like we do for the standalone report?
oh I'm too late :)
Confirmed working in the LR demo app.
Originally changed to rollup in #13416, but apparently never tested.