-
Notifications
You must be signed in to change notification settings - Fork 9.6k
core(build): add inline-fs bundling plugins #13275
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
Conversation
|
🎆 🎆 thank you for your tireless efforts, (cc the real @wardpeet :) |
| let CANONICAL_LOCALES = ['__availableLocales__']; | ||
| // TODO: need brfs in gh-pages-app. For now, above is replaced, see build-i18n.module.js | ||
| if (fs.readdirSync) { |
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 was the cause of the failing devtolls integration test.
I didn't look too far into why this was falsy with inline-fs (but not brfs) and so CANONICAL_LOCALES was kept as ['__availableLocales__'] in the devtools bundle, because it was easier just to remove the workaround since it's not needed anymore :)
Manually verified that swap locale in viewer is still working and DevTools can still switch LH locales
build/build-lightrider-bundles.js
Outdated
| parserOpts: {ecmaVersion: 12}, | ||
| }) | ||
| // Transform `fs.readFileSync`, etc into inline strings. | ||
| .transform(inlineFs({verbose: false})) |
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.
can we set it to Boolean(process.env.DEBUG) ?
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.
sure
(for the record I don't endorse process.env.DEBUG debugging, but it's just as good as false for documenting the option is there if you run into a problem and need to see what's going on, and it may help anyone who does randomly append DEBUG=1 to their commands to see if anything useful might happen :)
edit: it's also slightly different, maybe you just want some logging but process.env.DEBUG is also going to turn off minification or whatever, but again, it's easy to see you can put in another boolean there
part of #13231
adds browserify and rollup plugins for inline-fs and uses them in our build pipelines.
I'll follow up with
LH_ROOTand verify inlining modules and into modules works with to get rid of some our current workarounds (at least here and here)