marvin-vite-image-test
v1.0.5
Published
A library built with Vite
Readme
Marvin Vite Image Test
React 라이브러리로, 이미지를 포함한 컴포넌트를 제공합니다.
설치
npm install marvin-vite-image-test사용법
React 애플리케이션에서 사용 (ES 모듈 또는 CommonJS)
import { MyComponent } from "marvin-vite-image-test";
function App() {
return (
<div>
<h1>My App</h1>
<MyComponent title="Custom Title" />
</div>
);
}브라우저에서 직접 사용 (UMD)
<!DOCTYPE html>
<html>
<head>
<title>React App</title>
<!-- React를 먼저 로드해야 합니다 -->
<script
crossorigin
src="https://unpkg.com/react@18/umd/react.production.min.js"
></script>
<script
crossorigin
src="https://unpkg.com/react-dom@18/umd/react-dom.production.min.js"
></script>
<!-- 라이브러리 로드 -->
<script src="https://unpkg.com/marvin-vite-image-test"></script>
</head>
<body>
<div id="root"></div>
<script>
const App = () => {
return React.createElement("div", null, [
React.createElement("h1", null, "My App"),
React.createElement(MarvinViteImageTest.MyComponent, {
title: "Custom Title",
}),
]);
};
ReactDOM.render(
React.createElement(App),
document.getElementById("root")
);
</script>
</body>
</html>주의사항
브라우저에서 UMD 형식으로 사용할 때는 React와 ReactDOM이 전역 변수로 제공되어야 합니다.
개발
# 설치
npm install
# 개발 서버 실행
npm run dev
# 빌드
npm run build:all