Skip to content

Use Webpack in production mode for releases#1963

Merged
koesie10 merged 2 commits intomainfrom
koesie10/webpack-production-build
Jan 17, 2023
Merged

Use Webpack in production mode for releases#1963
koesie10 merged 2 commits intomainfrom
koesie10/webpack-production-build

Conversation

@koesie10
Copy link
Copy Markdown
Member

This will set the mode of Webpack to production for release builds. It will also stop inlining the sourcemap and instead produce a separate file which is excluded by .vscodeignore.

In terms of the bundled extension, this will add 1 file (out/webview.js.LICENSE.txt). It decreases the size of the VSIX file from 4.28MB to 1.77MB.

Checklist

  • CHANGELOG.md has been updated to incorporate all user visible changes made by this pull request.
  • Issues have been created for any UI or other user-facing changes made by this pull request.
  • [Maintainers only] If this pull request makes user-facing changes that require documentation changes, open a corresponding docs pull request in the github/codeql repo and add the ready-for-doc-review label there.

This will set the `mode` of Webpack to `production` for release builds.
It will also stop inlining the sourcemap and instead produce a separate
file which is excluded by `.vscodeignore`.

In terms of the bundled extension, this will add 1 file
(`out/webview.js.LICENSE.txt`). It decreases the size of the VSIX file
from 4.28MB to 1.77MB.
@koesie10 koesie10 requested a review from a team January 13, 2023 12:28
@koesie10 koesie10 requested a review from a team as a code owner January 13, 2023 12:28
Copy link
Copy Markdown
Contributor

@charisk charisk left a comment

Choose a reason for hiding this comment

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

The change LGTM (although I've not tested at all).

I'd be keen to hear from previous folks (e.g. @aeisenberg) why we were using dev mode. Perhaps there was a reason, not just tech debt?

@aeisenberg
Copy link
Copy Markdown
Contributor

The main reason was for debugging. When a user has an error, they can send their stack traces to us and we can more easily debug. We found it quite helpful in the past, but of course it adds to the size of the extension. It's up to you all what you want to do.

To allow us to reconstruct a stack trace, this will upload the
sourcemaps for all release builds.
@koesie10
Copy link
Copy Markdown
Member Author

The main reason was for debugging. When a user has an error, they can send their stack traces to us and we can more easily debug. We found it quite helpful in the past, but of course it adds to the size of the extension. It's up to you all what you want to do.

Thanks for adding some context! I've pushed a commit that will upload the sourcemaps on release builds. This should still allow us to reconstruct the stack trace, even if we're building in production mode.

@koesie10 koesie10 merged commit 7b5e5a6 into main Jan 17, 2023
@koesie10 koesie10 deleted the koesie10/webpack-production-build branch January 17, 2023 08:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants