2018-12-17 10:45:42 +03:00
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
//@ts-check
const path = require ( 'path' ) ;
/**@type {import('webpack').Configuration}*/
const config = {
target : 'node' , // vscode extensions run in a Node.js-context 📖 -> https://webpack.js.org/configuration/node/
node : {
_ _dirname : false ,
_ _filename : false ,
} ,
2019-11-13 04:49:43 +03:00
entry : {
"extension.bundle" : './extension.bundle.ts' , // the entry point of this extension, 📖 -> https://webpack.js.org/configuration/entry-context/
} ,
2018-12-17 10:45:42 +03:00
output : { // the bundle is stored in the 'dist' folder (check package.json), 📖 -> https://webpack.js.org/configuration/output/
path : path . resolve ( _ _dirname , 'dist' ) ,
2019-11-13 04:49:43 +03:00
filename : '[name].js' ,
2018-12-17 10:45:42 +03:00
libraryTarget : "commonjs2" ,
devtoolModuleFilenameTemplate : "../[resource-path]" ,
} ,
externals : {
2020-05-21 13:29:54 +03:00
'applicationinsights-native-metrics' : 'commonjs applicationinsights-native-metrics' , // ignored because we don't ship native module
2020-05-26 08:58:34 +03:00
'diagnostic-channel-publishers' : 'commonjs diagnostic-channel-publishers' ,
2018-12-17 10:45:42 +03:00
vscode : "commonjs vscode" , // the vscode-module is created on-the-fly and must be excluded. Add other modules that cannot be webpack'ed, 📖 -> https://webpack.js.org/configuration/externals/
} ,
devtool : 'source-map' ,
resolve : { // support reading TypeScript and JavaScript files, 📖 -> https://github.com/TypeStrong/ts-loader
extensions : [ '.ts' , '.js' ] ,
} ,
module : {
rules : [ {
test : /\.ts$/ ,
exclude : /node_modules/ ,
use : [ {
loader : 'ts-loader' ,
} ]
} ]
2021-08-03 08:49:53 +03:00
}
2018-12-17 10:45:42 +03:00
}
module . exports = config ;