增加.node文件loader

This commit is contained in:
xuewei 2022-08-31 12:26:38 +08:00
parent 827476cfca
commit f3711e61ca
1 changed files with 8 additions and 2 deletions

View File

@ -10,7 +10,7 @@ const path = require('path');
/** @type WebpackConfig */
const extensionConfig = {
target: 'node', // VS Code extensions run in a Node.js-context 📖 -> https://webpack.js.org/configuration/node/
mode: 'none', // this leaves the source code as close as possible to the original (when packaging we set this to 'production')
mode: 'none', // this leaves the source code as close as possible to the original (when packaging we set this to 'production')
entry: './src/extension.ts', // the entry point of this extension, 📖 -> https://webpack.js.org/configuration/entry-context/
output: {
@ -37,6 +37,12 @@ const extensionConfig = {
loader: 'ts-loader'
}
]
},
{
test: /\.node$/,
use: [
{ loader: 'node-loader' }
]
}
]
},
@ -45,4 +51,4 @@ const extensionConfig = {
level: "log", // enables logging required for problem matchers
},
};
module.exports = [ extensionConfig ];
module.exports = [extensionConfig];