clarkio / vscode-twitch-highlighter

This is a VS Code extension that will allow your Twitch chat to highlight a line of code via a command message. Example: `!line 8 server.js`. See master branch README.md for more details
https://clarkio.com
203 stars 14 forks source link

Using Webpack to reduce our extension size #66

Closed parithon closed 5 years ago

parithon commented 5 years ago

Instead of including node_modules/ with our extension (upwards of 3300 files) in this PR I use webpack to reduce that to 15 files. Not to mention it reduces our size by an awesome 91%!

Without webpack: image

With webpack: image

Files in VSIX: image

parithon commented 5 years ago

There appears to be an issue with the source maps that Webpack creates. You set a breakpoint on line 25, but when debugging the breakpoints are in a different location (line 90).

Breakpoint before debug: image

Breakpoint during debug: image

parithon commented 5 years ago

Because of the issues with the source maps using Webpack during debugging we will only use Webpack when packaging (pre-publishing) the extension prior to publishing to the marketplace. Webpack will clear out the 'out' folder prior to packaging the javascript.

clarkio commented 5 years ago

Wow, this is awesome! My only concern is I don't know how to use Webpack but this will finally force me to learn more about it 😄