28 Star 20 Fork 14

openKylin/cmake-intellisence

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
webpack.config.js 1.76 KB
一键复制 编辑 原始数据 按行查看 历史
Mason 提交于 2024-06-20 15:15 +08:00 . 简化 webpack 配置
//@ts-check
"use strict";
const { resolve: _resolve } = require("path");
//@ts-check
/** @typedef {import('webpack').Configuration} WebpackConfig **/
/** @type WebpackConfig */
const baseConfig = {
mode: "none", // this leaves the source code as close as possible to the original (when packaging we set this to 'production')
target: "node",
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/
// modules added here also need to be added in the .vscodeignore file
},
resolve: {
extensions: [".ts", ".js"],
},
devtool: "nosources-source-map",
infrastructureLogging: {
level: "log", // enables logging required for problem matchers
},
module: {
rules: [
{
test: /\.ts$/,
exclude: /node_modules/,
use: [{
loader: "ts-loader",
options: {
'projectReferences': true,
}
}],
},
],
},
};
// Config for extension source code (to be run in a Node-based context)
/** @type WebpackConfig */
const extensionConfig = {
...baseConfig,
entry: "./client/src/extension.ts",
output: {
path: _resolve(__dirname, "dist"),
filename: "client.js",
libraryTarget: "commonjs2",
},
};
const serverConfig = {
...baseConfig,
target: "node",
entry: "./server/src/server.ts",
output: {
path: _resolve(__dirname, "dist"),
filename: "server.js",
libraryTarget: "commonjs2",
},
};
module.exports = [extensionConfig, serverConfig];
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/openkylin/cmake-intellisence.git
git@gitee.com:openkylin/cmake-intellisence.git
openkylin
cmake-intellisence
cmake-intellisence
main

搜索帮助