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

Missing styles when using vite build.

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

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
react, typescript, vite

调研方向

首先,使用列出的 @uiw/react-codemirror、CodeMirror、theme 和 Vite 软件包版本复现报告,并使用所示的 imports 运行 vite build。将构建输出与预期的 CodeMirror 和 theme 样式进行比较;完成的标准是生成的 distribution 包含这些样式,或记录一个可正常工作的 import workaround。

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

描述

When trying to build my app with vite build. The generated code won't include the styles of codemirror or any themes. It looks like in a previous version (5). There was the .css file on the dist folder of the module that devs could import directly but now there is no such file and vite is having difficulties bundling the styles.

here is how im importing the editor:
import CodeMirror, { EditorView, basicSetup } from '@uiw/react-codemirror';
import { sql } from '@codemirror/lang-sql';
import { vscodeLight, vscodeLightInit } from '@uiw/codemirror-theme-vscode';
import { autocompletion, Completion, CompletionContext } from '@codemirror/autocomplete';
import { useEffect, useState } from 'react';
import { TableData } from '../../utils/utils';
import React from 'react';
import { LanguageSupport } from '@codemirror/language';

the version of the pacakges:
"@codemirror/lang-sql": "^6.8.0",
"@uiw/codemirror-theme-eclipse": "^4.23.6",
"@uiw/codemirror-theme-vscode": "^4.23.6",
"@uiw/react-codemirror": "^4.23.6",
"codemirror": "^6.0.1",
"vite": "^5.4.0"

Is there a work around this, so I can run the build and include the styles?
Thanks for the help in advance

主要语言
TypeScript
星标
2.3k
派生
162
平均合并
2 小时 41 分钟
30 天内合并 PR
1

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

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

uiwjs/react-codemirror 的其他 Issue

查看 uiwjs/react-codemirror 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

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