-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
feat(build) migrate to Webpack 5 #9716
Conversation
Flow rules are now separate from the default ones.
In preparation for Webpack 5.
98ef4b0
to
1453597
Compare
*/ | ||
function getPerformanceHints(size) { | ||
function getPerformanceHints(options, size) { |
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.
calls to this only pass the size parameter
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.
Opsie, nice catch!
} | ||
|
||
module.exports = (_env, argv) => { | ||
const analyzeBundle = Boolean(process.env.ANALYZE_BUNDLE); |
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.
is there a reason we don't extract this up top rather than passing it to getBundleAnalyzerPlugin
and getPerformanceHints
?
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.
Both of those groups of options rely on knowing the mode (prod or dev) and in Webpack 5 that is accomplished by exporting a function instead and checking the argv object. Hence I extracted and passed down the options where necessary.
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.
263 },
264 plugins: [
265 ...config.plugins,
266 ...getBundleAnalyzerPlugin('analytics-ga')
267 ],
268 performance: getPerformanceHints(5 * 1024)
269 }),
cant find in webpack.config.js
can you give me a hint
web /srv/jitsi-meet # cat -n webpack.config.js | grep -A 5 -B 5 module.exports
202 '.json'
203 ]
204 }
205 };
206
207 module.exports = [
208 Object.assign({}, config, {
209 entry: {
210 'app.bundle': './app.js'
211 },
212 plugins: [
--
313 || path.endsWith('.wasm')) {
314
315 return path;
316 }
317
318 const configs = module.exports;
319
320 /* eslint-disable array-callback-return, indent */
321
322 if ((Array.isArray(configs) ? configs : Array(configs)).some(c => {
323 if (path.startsWith(c.output.publicPath)) {
Superseded by #10119 |
This is necessary for introducing TypeScript.