Skip to content
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

Merged
merged 1 commit into from
Jun 7, 2022

Conversation

connorjclark
Copy link
Collaborator

Confirmed working in the LR demo app.

Originally changed to rollup in #13416, but apparently never tested.

@connorjclark connorjclark requested a review from a team as a code owner May 19, 2022 20:19
@connorjclark connorjclark requested review from brendankenny and removed request for a team May 19, 2022 20:19
@@ -35,17 +35,22 @@ async function buildReportGenerator() {
[`${LH_ROOT}/report/generator/flow-report-assets.js`]: 'export default {}',
}),
rollupPlugins.commonjs(),
rollupPlugins.nodeResolve(),
Copy link
Collaborator Author

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');
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shrug

Copy link
Member

@paulirish paulirish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

worked for me.

@connorjclark connorjclark merged commit 24275cb into master Jun 7, 2022
@connorjclark connorjclark deleted the fix-lr-gen-bundle branch June 7, 2022 20:53
Comment on lines +49 to +50
// 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.
Copy link
Member

@brendankenny brendankenny Jun 7, 2022

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 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants