vsce: reduce webpack bundle / package size
Created by: abeatrix
We are currently getting warnings when trying to build the extension.
The package size is quite big as well: 10.89MB
❯ vsce package
DONE Packaged: /Users/b/sourcegraph/client/vscode/sourcegraph-2.2.3.vsix (103 files, 10.89MB)
❯ yarn build:test
yarn run v1.22.17
warning @sourcegraph/vscode@2.2.3: The engine "vscode" appears to be invalid.
$ NODE_ENV=production TARGET_TYPE=webworker IS_TEST=true yarn task:gulp webpack
warning @sourcegraph/vscode@2.2.3: The engine "vscode" appears to be invalid.
$ cross-env NODE_OPTIONS="--max_old_space_size=8192" gulp webpack
[15:45:22] Using gulpfile ~/Dev/sourcegraph/client/vscode/gulpfile.js
[15:45:22] Starting 'webpack'...
[15:46:43] extension:webworker:
WARNING in asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).
This can impact web performance.
Assets:
main.js (253 KiB)
792.js (1010 KiB)
../../../../out/client/shared/src/graphql-operations.d.ts.map (256 KiB)
../../../../out/client/shared/src/graphql-operations.d.ts (305 KiB)
../../../../out/client/shared/src/schema.d.ts (427 KiB)
../../../../out/client/web/src/graphql-operations.d.ts.map (367 KiB)
../../../../out/client/web/src/graphql-operations.d.ts (467 KiB)
WARNING in entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance.
Entrypoints:
main (1.24 MiB)
792.js
main.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/
extension:webworker compiled in 55420 ms
webviews:
WARNING in asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).
This can impact web performance.
Assets:
yaml.worker.js (983 KiB)
searchSidebar.js (904 KiB)
9491.js (727 KiB)
8654.js (423 KiB)
6546.js (1.64 MiB)
1354.js (2.92 MiB)
4050.js (379 KiB)
../../../../out/client/shared/src/graphql-operations.d.ts.map (256 KiB)
../../../../out/client/shared/src/graphql-operations.d.ts (305 KiB)
../../../../out/client/shared/src/schema.d.ts (427 KiB)
../../../../out/client/web/src/graphql-operations.d.ts.map (367 KiB)
../../../../out/client/web/src/graphql-operations.d.ts (467 KiB)
WARNING in entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance.
Entrypoints:
searchPanel (5.31 MiB)
6546.js
1354.js
3278.css
3278.js
4050.css
4050.js
searchPanel.css
searchPanel.js
searchSidebar (6.14 MiB)
6546.js
1354.js
2913.js
3278.css
3278.js
4050.css
4050.js
searchSidebar.css
searchSidebar.js
helpSidebar (1.92 MiB)
6546.js
3278.css
3278.js
helpSidebar.css
helpSidebar.js
webviews compiled in 80881 ms
[15:46:43] Finished 'webpack' after 1.35 min
✨ Done in 82.32s.