2019-04-21 18:30:00 +00:00
|
|
|
'use strict';
|
|
|
|
|
2019-07-24 13:49:01 +00:00
|
|
|
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
|
2019-04-21 18:30:00 +00:00
|
|
|
const TerserPlugin = require('terser-webpack-plugin');
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
target: 'node',
|
|
|
|
entry: './src/extension.ts',
|
|
|
|
output: {
|
|
|
|
filename: 'extension.js',
|
|
|
|
libraryTarget: 'commonjs2'
|
|
|
|
},
|
|
|
|
devtool: 'source-map',
|
|
|
|
externals: {
|
|
|
|
vscode: 'commonjs vscode'
|
|
|
|
},
|
|
|
|
resolve: {
|
|
|
|
extensions: ['.ts', '.js', '.json']
|
|
|
|
},
|
|
|
|
plugins: [
|
|
|
|
new CleanWebpackPlugin()
|
|
|
|
],
|
|
|
|
optimization: {
|
|
|
|
minimizer: [
|
|
|
|
new TerserPlugin({
|
|
|
|
cache: false,
|
|
|
|
parallel: true,
|
|
|
|
sourceMap: true,
|
2019-08-03 12:16:17 +00:00
|
|
|
extractComments: true,
|
2019-04-21 18:30:00 +00:00
|
|
|
terserOptions: {
|
|
|
|
ecma: 8,
|
2019-08-03 12:16:17 +00:00
|
|
|
mangle: false,
|
|
|
|
keep_classnames: true,
|
|
|
|
keep_fnames: true
|
2019-04-21 18:30:00 +00:00
|
|
|
}
|
|
|
|
})
|
|
|
|
]
|
|
|
|
},
|
|
|
|
module: {
|
|
|
|
rules: [{
|
|
|
|
test: /\.ts$/,
|
|
|
|
use: 'ts-loader',
|
|
|
|
exclude: /node_modules/
|
|
|
|
}]
|
|
|
|
}
|
|
|
|
};
|