2021-04-18 00:49:55 +05:30
//@ts-check
'use strict' ;
const path = require ( 'path' ) ;
// const {} = require('webpack');
/**@type {import('webpack').Configuration}*/
const config = {
target : 'node' , // vscode extensions run in a Node.js-context 📖 -> https://webpack.js.org/configuration/node/
entry : {
extension : path . join ( _ _dirname , 'src' , 'extension.ts' ) ,
} , // the entry point of this extension, 📖 -> https://webpack.js.org/configuration/entry-context/
output : {
// the bundle is stored in the 'dist' folder (check package.json), 📖 -> https://webpack.js.org/configuration/output/
path : path . resolve ( _ _dirname , 'dist' ) ,
filename : '[name].js' ,
libraryTarget : 'commonjs2' ,
devtoolModuleFilenameTemplate : '../[resource-path]'
} ,
2021-04-18 11:52:42 +05:30
// devtool: 'source-map',
2021-04-18 00:49:55 +05:30
externals : {
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/
} ,
2021-04-18 11:52:42 +05:30
optimization : {
minimize : true ,
innerGraph : true ,
usedExports : true
} ,
2021-04-18 00:49:55 +05:30
resolve : {
// support reading TypeScript and JavaScript files, 📖 -> https://github.com/TypeStrong/ts-loader
extensions : [ '.ts' , '.js' ] ,
plugins : [ ]
} ,
2021-04-18 11:52:42 +05:30
// stats:'minimal',
2021-04-18 00:49:55 +05:30
module : {
rules : [
{
test : /\.ts$/ ,
exclude : /node_modules/ ,
use : [
{
loader : 'ts-loader' ,
options : {
configFile : 'tsconfig.json'
}
}
] ,
}
]
} ,
} ;
module . exports = config ;