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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(webpack, performance) - add webpack improvements #969

Merged
merged 8 commits into from
Jan 11, 2023

Conversation

dudumanbogdan
Copy link
Contributor

@dudumanbogdan dudumanbogdan commented Jan 9, 2023

  • exclude node_modules from babel-loader (increase speed by around 20-30s)
  • removed babel plugins as they were included in babel/preset-env
  • remove eslint-webpack-plugin from running via webpack as it's adding performance degradation on build. Potential related issue Potential performance improvements聽webpack-contrib/eslint-webpack-plugin#137 (we still have eslint lint in PR job so we don't really need it to run eslint via webpack). This saved us other around 20s
  • fix CI script not running anymore on ubuntu

From [50-60]s build now with this changes we get around [12-13]s.

Other notes:
Before build:dev:

asset app.js 6.11 MiB [emitted] (name: app) 1 related asset
asset ring.wav 43.1 KiB [emitted] [from: static/ring.wav] [copied]
asset config/config.js 355 bytes [emitted] [from: config.js] [copied]
asset spot-client-version.json 41 bytes [emitted] [from: static/spot-client-version.json] [copied]
orphan modules 3.79 MiB [orphan] 5918 modules
runtime modules 1.7 KiB 8 modules
cacheable modules 5.12 MiB
modules by path ./src/ 1.56 MiB
modules by path ./src/common/ 794 KiB
javascript modules 783 KiB 205 modules
asset modules 5.24 KiB 2 modules
./src/common/i18n/en.json 5.67 KiB [built] [code generated]
modules by path ./src/spot-remote/ 372 KiB 93 modules
modules by path ./src/spot-tv/ 405 KiB 91 modules
modules by path ./src/*.js 27.8 KiB
./src/index.js 9.43 KiB [built] [code generated]
./src/app.js 18.4 KiB [built] [code generated]
modules by path ./node_modules/ 3.56 MiB 322 modules
webpack 5.75.0 compiled successfully in 57611 ms

After build:dev:
asset app.js 14.3 MiB [compared for emit] (name: app)
asset ring.wav 43.1 KiB [compared for emit] [from: static/ring.wav] [copied]
asset config/config.js 355 bytes [compared for emit] [from: config.js] [copied]
asset spot-client-version.json 41 bytes [compared for emit] [from: static/spot-client-version.json] [copied]
orphan modules 3.79 MiB [orphan] 5918 modules
runtime modules 1.7 KiB 8 modules
cacheable modules 5.06 MiB
modules by path ./src/ 1.56 MiB
modules by path ./src/common/ 794 KiB
javascript modules 783 KiB 205 modules
asset modules 5.24 KiB 2 modules
./src/common/i18n/en.json 5.67 KiB [built] [code generated]
modules by path ./src/spot-remote/ 372 KiB 93 modules
modules by path ./src/spot-tv/ 405 KiB 91 modules
modules by path ./src/*.js 27.8 KiB
./src/index.js 9.43 KiB [built] [code generated]
./src/app.js 18.4 KiB [built] [code generated]
modules by path ./node_modules/ 3.5 MiB 322 modules
webpack 5.75.0 compiled successfully in 13515 ms


For build:prod. Before, interval was between [72-75]s:

NODE_ENV=production webpack --config ./webpack.config.js --progress

Failed to load ./.env.
13% building 0/1 entries 1200/1210 dependencies 332/455 modules[BABEL] Note: The code generator has deoptimised the styling of /Users/bduduman/www/8x8/meeting/jitsi-meet-spot/spot-client/node_modules/lib-jitsi-meet/dist/umd/lib-jitsi-meet.min.js as it exceeds the max of 500KB.
95% emitting emit inspectpack-duplicates-plugin
Duplicate Sources / Packages - No duplicates found. 馃殌

asset app.js 2.21 MiB [emitted] [minimized] [big] (name: app) 2 related assets
asset ring.wav 43.1 KiB [emitted] [from: static/ring.wav] [copied]
asset spot-client-version.json 41 bytes [emitted] [from: static/spot-client-version.json] [copied]
asset config/config.js 30 bytes [emitted] [from: config.js] [copied] [minimized]
orphan modules 6 MiB [orphan] 6533 modules
runtime modules 1.69 KiB 8 modules
cacheable modules 4.2 MiB
modules by path ./node_modules/ 1.87 MiB 93 modules
modules by path ./src/ 2.33 MiB
javascript modules 2.32 MiB
./src/index.js + 545 modules 2.22 MiB [built] [code generated]
./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./src/common/css/index.scss 109 KiB [built] [code generated]
asset modules 5.24 KiB
./src/common/css/material-icons/fonts/icomoon.woff 2.67 KiB [built] [code generated]
./src/common/css/material-icons/fonts/icomoon.ttf 2.57 KiB [built] [code generated]

WARNING in asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).
This can impact web performance.
Assets:
app.js (2.21 MiB)

WARNING in entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance.
Entrypoints:
app (2.21 MiB)
app.js

WARNING in webpack performance recommendations:
You can limit the size of your bundles by using import() or require.ensure to lazy load some parts of your application.
For more info visit https://webpack.js.org/guides/code-splitting/

webpack 5.75.0 compiled with 3 warnings in 74587 ms

After, inteval between [30-32]s:

spot@0.0.1 build:prod
NODE_ENV=production webpack --config ./webpack.config.js --progress

Failed to load ./.env.
95% emitting emit inspectpack-duplicates-plugin
Duplicate Sources / Packages - No duplicates found. 馃殌

asset app.js 2.14 MiB [emitted] [minimized] [big] (name: app) 2 related assets
asset ring.wav 43.1 KiB [emitted] [from: static/ring.wav] [copied]
asset spot-client-version.json 41 bytes [emitted] [from: static/spot-client-version.json] [copied]
asset config/config.js 30 bytes [emitted] [from: config.js] [copied] [minimized]
orphan modules 6.27 MiB [orphan] 6533 modules
runtime modules 1.69 KiB 8 modules
cacheable modules 4.05 MiB
modules by path ./node_modules/ 1.63 MiB 93 modules
modules by path ./src/ 2.43 MiB
javascript modules 2.42 MiB
./src/index.js + 545 modules 2.32 MiB [built] [code generated]
./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./src/common/css/index.scss 109 KiB [built] [code generated]
asset modules 5.24 KiB
./src/common/css/material-icons/fonts/icomoon.woff 2.67 KiB [built] [code generated]
./src/common/css/material-icons/fonts/icomoon.ttf 2.57 KiB [built] [code generated]

WARNING in asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).
This can impact web performance.
Assets:
app.js (2.14 MiB)

WARNING in entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance.
Entrypoints:
app (2.14 MiB)
app.js

WARNING in webpack performance recommendations:
You can limit the size of your bundles by using import() or require.ensure to lazy load some parts of your application.
For more info visit https://webpack.js.org/guides/code-splitting/

webpack 5.75.0 compiled with 3 warnings in 31513 ms

@saghul
Copy link
Member

saghul commented Jan 10, 2023

Looking good!

saghul
saghul previously approved these changes Jan 10, 2023
Copy link
Member

@saghul saghul left a comment

Choose a reason for hiding this comment

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

Can I ask you for the before / after text for a production build?

.github/workflows/ci.yml Outdated Show resolved Hide resolved
Copy link
Member

@saghul saghul left a comment

Choose a reason for hiding this comment

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

馃殌

@dudumanbogdan dudumanbogdan merged commit d3203c8 into master Jan 11, 2023
@dudumanbogdan dudumanbogdan deleted the bduduman/webpack_improvements branch January 11, 2023 09:21
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.

None yet

2 participants