digital-ide/webpack.config.js
2024-09-11 13:32:02 +08:00

25 lines
561 B
JavaScript

const path = require('path');
const config = {
target: 'node',
entry: './out-js/extension.js',
output: {
path: path.resolve(__dirname, 'out'),
filename: 'extension.js',
libraryTarget: 'commonjs2',
devtoolModuleFilenameTemplate: '../[resource-path]',
},
externals: {
vscode: 'commonjs vscode'
},
resolve: {
extensions: ['.ts', '.js'],
},
};
module.exports = (env, argv) => {
if (argv.mode === 'development') {
config.devtool = 'source-map';
}
return config;
};