Skip to content

[Performance] Extension bundle size too large at approximately 50MB #32

@ashtonckj

Description

@ashtonckj

Extension Version

v0.3.4

Description

The extension package is significantly larger than expected at approximately 50MB. This causes slow installation and longer load times. The suspected causes are the bundling of prettier in full, and the inclusion of assert which is a testing utility that should not be present in a production build.

Current Behaviour

Extension installs at ~50MB, which is unusually large for a language support extension.

Suspected problematic imports found in the codebase:

import * as prettier from 'prettier';  // large library, likely bundled in full
import * as assert from 'assert';      // testing utility, should not be in production

Expected Behaviour

The extension bundle size should be significantly smaller. Suggested steps to investigate:

  • Replace import * as prettier from 'prettier' with a dynamic import or lighter alternative
  • Remove import * as assert from 'assert' from any non-test files
  • Run a bundle analyser (e.g. webpack-bundle-analyzer) to identify other large contributors

Steps to Reproduce

  1. Download and install the extension from the VS Code Marketplace
  2. Check the installed extension folder size
  3. Observe it is approximately 50MB

Additional Context

vscode, path, and fs imports are fine — they are either provided
by VS Code at runtime or are Node.js built-ins and do not contribute to bundle size.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions