2018-09-19 17:54:55 +02:00
/ * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
* Copyright ( c ) Microsoft Corporation . All rights reserved .
* Licensed under the MIT License . See License . txt in the project root for license information .
* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- * /
//@ts-check
'use strict' ;
const path = require ( 'path' ) ;
/**@type {import('webpack').Configuration}*/
const config = {
2018-09-20 15:45:12 +02:00
target : 'node' , // vscode extensions run in a Node.js-context 📖 -> https://webpack.js.org/configuration/node/
entry : './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/
2018-09-19 17:54:55 +02:00
path : path . resolve ( _ _dirname , 'dist' ) ,
filename : 'extension.js' ,
2018-09-20 13:03:06 +02:00
libraryTarget : "commonjs2" ,
devtoolModuleFilenameTemplate : "../[resource-path]" ,
2018-09-19 17:54:55 +02:00
} ,
devtool : 'source-map' ,
externals : {
2018-09-20 15:45:12 +02: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/
} ,
resolve : { // support reading TypeScript and JavaScript files, 📖 -> https://github.com/TypeStrong/ts-loader
extensions : [ '.ts' , '.js' ]
2018-09-19 17:54:55 +02:00
} ,
module : {
rules : [ {
test : /\.ts$/ ,
exclude : /node_modules/ ,
use : [ {
loader : 'ts-loader' ,
2019-03-04 14:15:54 +01:00
options : {
compilerOptions : {
"module" : "es6" // override `tsconfig.json` so that TypeScript emits native JavaScript modules.
}
}
2018-09-19 17:54:55 +02:00
} ]
} ]
} ,
}
module . exports = config ;