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

feat(build) migrate to Webpack 5 #9716

Closed
wants to merge 3 commits into from
Closed

feat(build) migrate to Webpack 5 #9716

wants to merge 3 commits into from

Conversation

saghul
Copy link
Member

@saghul saghul commented Aug 13, 2021

This is necessary for introducing TypeScript.

Flow rules are now separate from the default ones.
In preparation for Webpack 5.
*/
function getPerformanceHints(size) {
function getPerformanceHints(options, size) {
Copy link
Contributor

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

Copy link
Member Author

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);
Copy link
Contributor

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?

Copy link
Member Author

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.

Copy link

@pscp1 pscp1 Oct 1, 2021

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

@saghul
Copy link
Member Author

saghul commented Oct 7, 2021

Superseded by #10119

@saghul saghul closed this Oct 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants