Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

feat: disable specific built-in feature (or change it's config)

未关闭
#597 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 3 天内回复

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
55/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
活跃
技术栈
typescript
领域
devtools, security

调研方向

Start by tracing the builtinDevTools configuration and the configResolved hook to find where built-in features, especially terminal, are registered. Compare that path with terminalsVite({ shell: '/usr/bin/nologin' }); done means users can keep other built-in or package devtools enabled while excluding terminal through configuration.

由索引模型根据 Issue 内容生成。

描述

enhancement
Clear and concise description of the problem

Hello and thanks to everyone!

I would like to disable the terminal feature. As of today, the only way to do so is by set

devtools: {
      builtinDevTools: false,
},

but this disables all the vite devtools entirely (even the ones from @vitejs/devtools-vite package).

I understand terminal is not active if no authentication is provided, but once it is (and I may want to open devtools for other reasons) I still feel like having it it's a security hole that must be closed. (such terminal is capable of doing too much thing, everything actually - install packages, sudo, reading envs and .bash_history as well as ssh into other machines).

I understand every hole I described can be done in many different way just with a bad package, but at least I would not like to have a terminal in my browser window and potentially accessibile in the network.

I tried to write a custom plugin that hook into the configResolved function to intercept the configuration, but I only managed to entirely disable the tools and I could not manage to reach the configuration.

Suggested solution

From a config perspective, it may be done in different ways, the one I prefer is something like

devtools: {
  builtinDevTools: true,
  excludeBuiltIn: ['terminal']
},
Alternative

Another way can be to override that specific plugin configuration

import { terminalsVite } from '@devframes/plugin-terminals/vite'
//...
plugins: [
  ...terminalsVite({
    shell: '/usr/bin/nologin'
  }),
]
Additional context

I never went that deep into vite: I never needed that (and that thanks to your awesome work, btw!), so I don't know that much of vite internal structure, but if the leading team decides this can be a feature, I can get my hands on it and try to prepare a PR (I feel like it's a small if somewhere, just I don't know where this "somewhere" is)

Validations
主要语言
TypeScript
星标
1.2k
派生
92
平均合并
3 天 16 小时
30 天内合并 PR
14

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

vitejs/devtools 的其他 Issue

查看 vitejs/devtools 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。