Skip to content

feat: web extension#732

Closed
andi1984 wants to merge 1 commit into
developfrom
claude/code-review-01VZswgNn4LvHrJQPYpnkjVM
Closed

feat: web extension#732
andi1984 wants to merge 1 commit into
developfrom
claude/code-review-01VZswgNn4LvHrJQPYpnkjVM

Conversation

@andi1984

Copy link
Copy Markdown
Owner

Implements web extension compatibility to enable the TinyPNG extension to work in VSCode's web environment (vscode.dev). This addresses issue #232.

Key changes:

  • Created tinify-web.ts: Web-compatible TinyPNG API wrapper using Fetch API instead of Node.js tinify library
  • Created extension.web.ts: Web-compatible extension entry point using VSCode's FileSystem API instead of Node.js fs module
  • Added webpack bundling configuration for both web and Node.js targets
  • Updated package.json with browser field and webpack build scripts
  • Added webpack, webpack-cli, and ts-loader as dev dependencies
  • Updated tsconfig.json to include DOM types for web APIs

Technical details:

  • Web version uses direct HTTP calls to TinyPNG API via fetch()
  • Replaced fsPath file access with VSCode FileSystem API
  • Git stage compression feature not available in web version (requires child_process which is Node.js only)
  • Both desktop and web versions are built and bundled separately

Build outputs:

  • dist/web/extension.web.js: Web extension bundle (5.7 KB)
  • dist/node/extension.js: Node.js extension bundle (250 KB)

Resolves #232

@andi1984 andi1984 self-assigned this Nov 21, 2025
Implements web extension compatibility to enable the TinyPNG extension
to work in VSCode's web environment (vscode.dev). This addresses issue #232.

Key changes:
- Created tinify-web.ts: Web-compatible TinyPNG API wrapper using Fetch API
  instead of Node.js tinify library
- Created extension.web.ts: Web-compatible extension entry point using
  VSCode's FileSystem API instead of Node.js fs module
- Added webpack bundling configuration for both web and Node.js targets
- Updated package.json with browser field and webpack build scripts
- Added webpack, webpack-cli, and ts-loader as dev dependencies
- Updated tsconfig.json to include DOM types for web APIs

Technical details:
- Web version uses direct HTTP calls to TinyPNG API via fetch()
- Replaced fsPath file access with VSCode FileSystem API
- Git stage compression feature not available in web version
  (requires child_process which is Node.js only)
- Both desktop and web versions are built and bundled separately

Build outputs:
- dist/web/extension.web.js: Web extension bundle (5.7 KB)
- dist/node/extension.js: Node.js extension bundle (250 KB)

Resolves #232
@andi1984
andi1984 force-pushed the claude/code-review-01VZswgNn4LvHrJQPYpnkjVM branch from d33a142 to 35a0d96 Compare November 21, 2025 23:11
@andi1984

Copy link
Copy Markdown
Owner Author

Can not be done as TinyPNG API does not seem to support CORS.

@andi1984 andi1984 closed this Nov 21, 2025
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.

Make the extension available as web extension (vscode.dev)

2 participants