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

Improve webpack logging #1394

Merged
merged 3 commits into from
Sep 22, 2021
Merged

Improve webpack logging #1394

merged 3 commits into from
Sep 22, 2021

Conversation

fregante
Copy link
Collaborator

@fregante fregante commented Sep 20, 2021

I find that webpack’s output is lengthy, noisy, and not particularly useful.

Before

Screen Shot 8

After

I can exclude some files from the list too, for example the nnn.bundle.js files

Screen Shot 10

Caveats

maxAssetSize: 5_120_000,
// Silence warnings because the size includes the sourcemaps
maxEntrypointSize: 15_120_000,
maxAssetSize: 15_120_000,
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

These always include the sourcemaps locally, so they end up being noise. Let's disable them again

@@ -30,6 +31,10 @@ const merge = mergeWithCustomize({
const tsconfig = JSON5.parse(fs.readFileSync("./tsconfig.json", "utf8"));

const shared = {
stats: {
preset: "errors-warnings",
timings: true,
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

If we avoid size-plugin and just use entrypoints: true instead, we get almost there:

Screen Shot 9

package.json Outdated
@@ -216,6 +216,7 @@
"rollbar-sourcemap-webpack-plugin": "^3.3.0",
"sass-loader": "^12.1.0",
"selenium-webdriver": "^4.0.0-beta.4",
"size-plugin": "2.0.2",
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@fregante fregante marked this pull request as ready for review September 20, 2021 17:11
@twschiller
Copy link
Contributor

@fregante IMO the "after" picture in the PR description is worse - it's longer and individual file sizes don't matter as much since we're an extension. For sizes, the things we care about are: 1) overall bundle size, 2) bundle size of content script, frame script, etc. to the extent they slow down loading

If we avoid size-plugin and just use entrypoints: true instead, we get almost there:

That screenshot looks good to me

@fregante
Copy link
Collaborator Author

fregante commented Sep 22, 2021

IMO the "after" picture in the PR description is worse

Yeah you may be right, especially due to the length.

If we avoid size-plugin and just use entrypoints: true instead, we get almost there:

That screenshot looks good to me

Done.

Entrypoint background 5.64 MiB = background.js
Entrypoint contentScript 7.46 MiB (158 KiB) = contentScript.js 2 auxiliary assets
Entrypoint devtools 4.61 MiB = devtools.js
Entrypoint devtoolsPanel 20.2 MiB (161 KiB) = devtoolsPanel.css 544 KiB devtoolsPanel.js 19.6 MiB 3 auxiliary assets
Entrypoint frame 5.42 KiB = frame.js
Entrypoint modalForm 2.71 MiB = modalForm.css 484 KiB modalForm.js 2.24 MiB
Entrypoint options 24.1 MiB (168 KiB) = options.css 2.81 MiB options.js 21.3 MiB 4 auxiliary assets
Entrypoint support 5.6 KiB = support.js
Entrypoint action 11.1 MiB (199 KiB) = action.css 1.71 MiB action.js 9.37 MiB 5 auxiliary assets
Entrypoint permissionsPopup 1.91 MiB = permissionsPopup.css 483 KiB permissionsPopup.js 1.44 MiB
Entrypoint vendors 8.88 MiB = vendors.js
Entrypoint script 2.73 MiB = script.js
webpack compiled successfully in 21554 ms

@twschiller twschiller merged commit d0ff2f6 into main Sep 22, 2021
@twschiller twschiller deleted the F/dev/saner-webpack-output branch September 22, 2021 18:25
twschiller added a commit that referenced this pull request Sep 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants