泰州网站制作推广,招聘网站制作公司,成全视频免费高清观看在线小说,上海中艺建设集团网站使用Vite作為開發依賴 安裝VITE配置VITE配置文件簡單的VITE配置項更改package.json中的scripts在根目錄中添加index.html現在可以瀏覽你的頁面了 安裝VITE 首先#xff0c;在現有的React項目中安裝VITE npm install vite --save-dev
||
yarn add vite --dev配置VITE配置文件
… 使用Vite作為開發依賴 安裝VITE配置VITE配置文件簡單的VITE配置項更改package.json中的scripts在根目錄中添加index.html現在可以瀏覽你的頁面了 安裝VITE 首先在現有的React項目中安裝VITE npm install vite --save-dev
||
yarn add vite --dev配置VITE配置文件
my-react-vite-app/
├── node_modules/
├── public/
├── src/
├── package.json
├── vite.config.js -- 添加VITE配置目錄
└── README.md簡單的VITE配置項 記住安裝一下 vitejs/plugin-react 包 yarn add vitejs/plugin-react --devimport { defineConfig } from vite;
import react from vitejs/plugin-react;export default defineConfig({plugins: [react()],server: {port: 3000}// 其他配置选项
});更改package.json中的scripts
// ... scripts: {start: vite,build: vite build,lint: eslint . --ext js,jsx --report-unused-disable-directives --max-warnings 0,preview: vite preview},// ...在根目錄中添加index.html 指向的是你的 index.jsx 或 main.jsx !doctype html
html langenheadmeta charsetUTF-8 /link relicon typeimage/svgxml href/vite.svg /meta nameviewport contentwidthdevice-width, initial-scale1.0 /titleVite React/title/headbodydiv idroot/divscript typemodule src/src/main.jsx/script/body
/html現在可以瀏覽你的頁面了