54 lines
1.3 KiB
TypeScript
54 lines
1.3 KiB
TypeScript
import * as path from 'path';
|
|
import * as webpack from 'webpack';
|
|
import TerserPlugin from 'terser-webpack-plugin';
|
|
|
|
const config: webpack.Configuration = {
|
|
target: 'node',
|
|
entry: './src/extension.ts',
|
|
output: {
|
|
path: path.resolve(__dirname, 'out'),
|
|
filename: 'extension.js',
|
|
libraryTarget: 'commonjs2',
|
|
devtoolModuleFilenameTemplate: '../[resource-path]',
|
|
},
|
|
devtool: 'source-map',
|
|
optimization: {
|
|
concatenateModules: true,
|
|
minimize: true,
|
|
minimizer: [
|
|
new TerserPlugin({
|
|
extractComments: false,
|
|
terserOptions: {
|
|
compress: {
|
|
unsafe: true,
|
|
},
|
|
format: {
|
|
comments: false,
|
|
},
|
|
},
|
|
}),
|
|
],
|
|
},
|
|
externals: {
|
|
vscode: 'commonjs vscode',
|
|
},
|
|
resolve: {
|
|
extensions: ['.js', '.ts'],
|
|
},
|
|
module: {
|
|
rules: [
|
|
{
|
|
test: /\.ts$/,
|
|
exclude: /node_modules/,
|
|
use: [
|
|
{
|
|
loader: 'ts-loader',
|
|
},
|
|
],
|
|
},
|
|
],
|
|
},
|
|
};
|
|
|
|
export default config;
|