diff options
| author | Christoph Schlosser <christoph@linux.com> | 2019-10-08 22:49:29 +0200 |
|---|---|---|
| committer | Christoph Schlosser <christoph@linux.com> | 2019-10-08 22:49:29 +0200 |
| commit | 7a3c0c308db835101e45942e444d1f65e85b1f60 (patch) | |
| tree | 816945c3943818667994d53378f39c2e81720e81 /webpack.config.js | |
| parent | c5e85c18f4ee818253d3f761a583da2002365075 (diff) | |
| download | doxdocgen-make-vsix-smaller.tar.gz | |
Add webpackmake-vsix-smaller
Diffstat (limited to 'webpack.config.js')
| -rw-r--r-- | webpack.config.js | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/webpack.config.js b/webpack.config.js new file mode 100644 index 0000000..a76643b --- /dev/null +++ b/webpack.config.js @@ -0,0 +1,41 @@ +//@ts-check + +'use strict'; + +const path = require('path'); + +/**@type {import('webpack').Configuration}*/ +const config = { + target: 'node', // vscode extensions run in a Node.js-context 📖 -> https://webpack.js.org/configuration/node/ + + entry: './src/extension.ts', // the entry point of this extension, 📖 -> https://webpack.js.org/configuration/entry-context/ + output: { + // the bundle is stored in the 'dist' folder (check package.json), 📖 -> https://webpack.js.org/configuration/output/ + path: path.resolve(__dirname, 'dist'), + filename: 'extension.js', + libraryTarget: 'commonjs2', + devtoolModuleFilenameTemplate: '../[resource-path]' + }, + devtool: 'source-map', + externals: { + vscode: 'commonjs vscode' // the vscode-module is created on-the-fly and must be excluded. Add other modules that cannot be webpack'ed, 📖 -> https://webpack.js.org/configuration/externals/ + }, + resolve: { + // support reading TypeScript and JavaScript files, 📖 -> https://github.com/TypeStrong/ts-loader + extensions: ['.ts', '.js'] + }, + module: { + rules: [ + { + test: /\.ts$/, + exclude: /node_modules/, + use: [ + { + loader: 'ts-loader' + } + ] + } + ] + } +}; +module.exports = config;
\ No newline at end of file |