You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

36 lines
929 B

'use strict';
const path = require('path');
const nodeExternals = require('webpack-node-externals');
module.exports = function(env, argv) {
if (env === undefined) {
env = {};
}
const production = !!env.production;
return {
entry: './src/extension.ts',
mode: production ? 'production' : 'development',
target: 'node',
devtool: !production ? 'eval-source-map' : undefined,
output: {
libraryTarget: 'commonjs2',
filename: 'extension.js',
path: path.resolve(__dirname, 'out')
},
resolve: {
extensions: ['.tsx', '.ts', '.js']
},
externals: [nodeExternals()],
module: {
rules: [
{
test: /\.tsx?$/,
use: 'ts-loader',
exclude: /node_modules/
}
]
}
};
};