1 Star 0 Fork 24

bluehow/vscode-drawio

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
webpack.config.ts 1.23 KB
一键复制 编辑 原始数据 按行查看 历史
Henning Dieterichs 提交于 2021-07-12 01:22 +08:00 . Makes the extension browser ready.
import * as webpack from "webpack";
import path = require("path");
import { CleanWebpackPlugin } from "clean-webpack-plugin";
import * as CopyPlugin from "copy-webpack-plugin";
const r = (file: string) => path.resolve(__dirname, file);
module.exports = {
entry: r("./src/index"),
output: {
path: r("./dist/extension"),
filename: "index.js",
libraryTarget: "commonjs2",
devtoolModuleFilenameTemplate: "../../[resource-path]",
},
devtool: "source-map",
externals: {
vscode: "commonjs vscode",
},
resolve: {
extensions: [".ts", ".js"],
fallback: {
path: require.resolve("path-browserify"),
fs: false,
},
},
module: {
rules: [
{
test: /\.html$/i,
loader: "raw-loader",
},
{
test: /\.ts$/,
exclude: /node_modules/,
use: [
{
loader: "ts-loader",
},
],
},
],
},
node: {
__dirname: false,
},
plugins: [
new CleanWebpackPlugin(),
new webpack.EnvironmentPlugin({
DEV: "0",
}),
// Without `as any`, I get "Excessive stack depth comparing types with TS 3.2"
new webpack.IgnorePlugin({ resourceRegExp: /^canvas$/ }) as any,
new CopyPlugin({
patterns: [
{ from: "./src/features/LiveshareFeature/assets", to: "." },
],
}),
],
} as webpack.Configuration;
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
TypeScript
1
https://gitee.com/bluehow/vscode-drawio.git
git@gitee.com:bluehow/vscode-drawio.git
bluehow
vscode-drawio
vscode-drawio
master

搜索帮助