Skip to content
Branch: master
Find file History
Latest commit 0b3a31b Jul 31, 2019
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
.vscode Various fixes for #174 Apr 16, 2019
src Remove use stricts from ts files May 31, 2019
.gitignore ignore dist-folder Sep 20, 2018
.vscodeignore fix #119 Nov 15, 2018
README.md Fixed typo Jan 24, 2019
package-lock.json update dependencies Jul 31, 2019
package.json update dependencies Jul 31, 2019
tsconfig.json Don't set explicit `lib` in tsconfigs May 31, 2019
tslint.json Fixing lint errors for many of the projects May 10, 2019
webpack.config.js add tests to webpack-sample Mar 4, 2019

README.md

Webpack & Extensions

This is an extension that uses https://webpack.js.org to bundle and minify its sources. Using webpack will help to reduce the install- and startup-time of large extensions because instead of hundreds of files, a single file is produced.

Configuration

Webpack in configured in the webpack.config.js-file. Find annotation inside the file itself or refer to the excellent webpack documentation: https://webpack.js.org/configuration/. In short, the config-files defines the entry point of the extension, to use TypeScript, to produce a commonjs-module, and what modules not to bundle.

Scripts

The scripts-section of the package.json-file has entries for webpack. Those compile TypeScript and produce the bundle as well as producing a minified production build. Note, that there is no dedicated TypeScript-script as webpack takes care of that.

More

If you use vscode-nls to localize your extension that you likely also use vscode-nls-dev to create language bundles at build time. To support webpack, a loader has been added to vscode-nls-dev. Add the section below to the modules/rules-configuration.

{
  // vscode-nls-dev loader:
  // * rewrite nls-calls
  loader: 'vscode-nls-dev/lib/webpack-loader',
  options: {
    base: path.join(__dirname, 'src')
}

A good sample is the shared config built-in extensions use: https://github.com/Microsoft/vscode/blob/bf5b0585d2a8759541690b2c564b96cb604ff92e/extensions/shared.webpack.config.js#L29-L51

You can’t perform that action at this time.