-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Cannot bundle Lighthouse with user flows #13398
Comments
If you aren't interested in non-default locales, a workaround is to shim lighthouse/build/build-viewer.js Lines 45 to 47 in abb88b3
IDK the proper way to do this in webpack, null-loader maybe?
It was done in anticipation of converting to ESM: #12721 |
@adamraine thanks we can get around this. However we can't get around
Being used in lighthouse-core/gather/gatherers/stacks.js. This also makes the lambda blow up as obviously we don't have this file to be able to read. Are there any workarounds for this? |
We use a custom rollup plugin to inline our fs calls for bundles. Updates on that are tracked in #13231. We used to use https://www.npmjs.com/package/brfs, perhaps a webpack solution with https://www.npmjs.com/package/transform-loader could work? Solving this solution with You might have some success forking https://github.com/GoogleChrome/lighthouse/blob/master/build/build-bundle.js to compile Lighthouse assets. Example:
module.exports = require('./lighthouse-core/fraggle-rock/api.js'); Perhaps we could expose |
Aye. we would recommend deferring to us for bundling... We have enough of these special cases it's going to be hard for you to maintain a bundling setup that works with our codebase. The last suggestion from adam is as close to our preferred approach. We just havent yet needed to make this bundle, but we certainly could. |
re: #13398 (comment) Have you tried installing Unfortunately in the JS ecosystem it is sometimes necessary to checkout a project manually and tweak its build for complex use cases. You can try We currently publish a few bundles, but they are only for report code. We could bundle a new entry using Publishing |
@sam-barker take a look at https://github.com/GoogleChrome/lighthouse/compare/buildfr if you checkout that branch. you can run the API is exposed on from there, i suppose you can work with that.. but as you probably already know.. you'll need to be passing in a puppeteer page etc. |
We had been trying to utilise fraggle rock so we can have lighthouse flows run in a lambda function.
However the way that we build the code is using typescript and webpack, and this minimises everything into one file.
Because of this, the lambda explodes as it cannot find the
json
files references withinshared/localization/locales
, as the code is as follows:Our lambda files consist of:
Of course naturally when it tries to resolve
${__dirname}/locales/en-XL.json
this won't work, as the JSON files aren't in our lambda.I'm not quite sure why it was decided to include json files like this? Wouldn't it make more sense just to
require
orimport
them directly instead of this weirddirname
way of doing it? That would stop our lambda from blowing up!The text was updated successfully, but these errors were encountered: