index.tsx 빌드 오류
안녕하세요
강의에 사용된 버전이나 pnpm을 사용하는 등 다른게 진행한 부분이 있습니다만 빌드할때 에러가 나는데 이해가 안되는 부분이 있어 질문드립니다.
pakage.json
"name": "@twosday/ui",
"description": "Design System for twosday",
"private": false,
"publishConfig": {
"access": "public"
},
"files": [
"dist"
],
"main": "dist/index.umd.js",
"module": "dist/index.es.js",
"types": "dist/index.d.ts",
"exports": {
".": {
"import": "./dist/index.es.js",
"require": "./dist/index.umd.js",
"types": "./dist/index.d.ts"
},
"./styles": {
"import": "./dist/styles/index.css"
}
},
"version": "0.0.1",
"type": "module",
"license": "MIT",import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import { vanillaExtractPlugin } from "@vanilla-extract/vite-plugin";
import svgr from "vite-plugin-svgr";
import path from "path";
import dts from "vite-plugin-dts";
import { viteStaticCopy } from "vite-plugin-static-copy";
// https://vitejs.dev/config/
export default defineConfig({
resolve: {
alias: {
"@": path.resolve(__dirname, "src"),
},
},
plugins: [
react(),
vanillaExtractPlugin({
identifiers: ({ hash }) => `css_${hash}`,
}),
svgr(),
dts(),
viteStaticCopy({
targets: [{ src: "src/index.css", dest: "" }],
}),
],
build: {
lib: {
name: "@twosday/ui",
entry: path.resolve(__dirname, "src/index.tsx"),
fileName: (format) => `index.${format}.js`,
},
rollupOptions: {
external: ["react", "react-dom"],
output: {
globals: {
react: "React",
"react-dom": "ReactDOM",
},
},
},
sourcemap: true,
emptyOutDir: true,
},
});

grs04@BOOK-NN36R5QM7J MINGW64 ~/Desktop/sideproject/my-story-book (main)
$ pnpm build
> @twosday/ui@0.0.1 build C:\Users\grs04\Desktop\sideproject\my-story-book
> tsc -b && vite build
vite v5.3.5 building for production...
src/index.tsx:1:38 - error TS6142: Module './component/LoginForm' was resolved to 'C:/Users/grs04/Desktop/sideproject/my-story-book/src/component/LoginForm.tsx', but '--jsx' is not set.
1 export { default as LoginForm } from "./component/LoginForm";
~~~~~~~~~~~~~~~~~~~~~~~
src/index.tsx:2:35 - error TS6142: Module './component/Button' was resolved to 'C:/Users/grs04/Desktop/sideproject/my-story-book/src/component/Button.tsx', but '--jsx' is not set.
2 export { default as Button } from "./component/Button";
~~~~~~~~~~~~~~~~~~~~
✓ 15 modules transformed.
[vite:dts] Start generate declaration files...
dist/style.css 0.18 kB │ gzip: 0.15 kB
dist/index.es.js 22.47 kB │ gzip: 6.77 kB │ map: 67.56 kB
[vite:dts] Declaration files built in 589ms.
[vite-plugin-static-copy] Copied 1 items.
dist/style.css 0.18 kB │ gzip: 0.15 kB
dist/index.umd.js 14.88 kB │ gzip: 5.90 kB │ map: 65.89 kB
✓ built in 1.12s
vite.config.ts에서 build 에 작성한 부분을 지우고 기본설정으로 하면 잘 되는데 강의처럼 build부분을 작성을 하면 jsx flag를 설정하라고 나오면서 component 폴더에 d.ts 파일들이 생성이 안됩니다.
Answer 2
스토리북에 대해서
0
57
1
Storybook 10에서 argTypes에 action 설정 시
0
74
1
storybook setup
0
86
2
실무 적용 관련해서 질문이 있습니다!
0
63
2
storybook 프로젝트 세팅 중 궁금한 점이 있습니다.
0
133
2
스토리북 테스트에 대한 질문
0
101
2
tailwind 4.x 버전 변경된 CSS 추출(?) 커맨드
1
207
2
스토리북 테마에 대해 질문 드립니다.
0
158
2
테일윈드를 안쓰고 스타일 컴포넌트만 사용하는 환경에서는요?
0
144
2
[질문 x 공유용] tailwind v4.0 으로 강의랑 다를 때 (import 다름, tailwind.config.js 없어짐 등)
6
484
2
react-toastify 를 storybook에 출력 시키기
0
181
1
react에서 modal & portal 사용시 에는 어떻게 작성해야될까요
0
374
3
tsconfig
0
180
1
vite 초기설정
0
344
2
스토리 내 args에서 에러가 발생합니다.
0
208
2
Nextjs에서 tailwind를 사용할 때
0
278
2
제공해주시는 Figma 색상 코드가 강의와 달라 글 남깁니다!
0
141
2
Visual Test
1
127
1
NavigationBar 배경색
0
129
1
defaultValue 질문 드립니다!
0
123
1
svg를 public 말고 src>assets안에 넣는다면 import를 어떻게해야하나요?
1
265
2
tailwind css 코드 스플릿팅이 가능한가요?
0
279
1
StoryBook 관련 궁금 사항입니다.
1
260
1
type-error 해결 방법 질문
2
406
4

