discord-vscode/webpack.config.js

44 lines
788 B
JavaScript
Raw Normal View History

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