vitjs / vit Goto Github PK
View Code? Open in Web Editor NEW🚀 React application framework inspired by UmiJS / 类 UmiJS 的 React 应用框架
License: MIT License
🚀 React application framework inspired by UmiJS / 类 UmiJS 的 React 应用框架
License: MIT License
我看到有一个.vit/vit.tsx 文件作为入口,但是修改这里每次重新启动都会重置,有办法自定义么?
yarn run v1.22.17
$ tsc && vite build
node_modules/@ant-design/pro-form/lib/components/ColorPicker/index.d.ts:2:40 - error TS7016: Could not find a declaration file for module 'react-color'. 'C:/Users/pwt/src/vitereacttest/node_modules/react-color/lib/index.js' implicitly has an 'any' type.
Try npm i --save-dev @types/react-color
if it exists or add a new declaration (.d.ts) file containing declare module 'react-color';
2 import type { SketchPickerProps } from 'react-color';
~~~~~~~~~~~~~
node_modules/@ant-design/pro-utils/lib/types/index.d.ts:4:40 - error TS7016: Could not find a declaration file for module 'react-color'. 'C:/Users/pwt/src/vitereacttest/node_modules/react-color/lib/index.js' implicitly has an 'any' type.
Try npm i --save-dev @types/react-color
if it exists or add a new declaration (.d.ts) file containing declare module 'react-color';
4 import type { SketchPickerProps } from 'react-color';
~~~~~~~~~~~~~
Found 2 errors in 2 files.
Errors Files
1 node_modules/@ant-design/pro-form/lib/components/ColorPicker/index.d.ts:2
1 node_modules/@ant-design/pro-utils/lib/types/index.d.ts:4
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
没看到有例子
前辈们好,目前在实作使用到像这样的动态路由
{ path: '/process-pending/:id/detail', icon: 'FileSearch', name: '查询明细', component: './pages/ProcessPending/Detail/index.jsx', hideInMenu: true },
使用开发模式 vite 可正常执行,但执行 vite build 打包却会出现路径不合法的错误
error during build: Error: Illegal characters in path. at pathArg (C:\Users\BLKsherry\Desktop\Project\frontend\node_modules\mkdirp\lib\path-arg.js:20:27) at Function.mkdirpSync [as sync] (C:\Users\BLKsherry\Desktop\Project\frontend\node_modules\mkdirp\index.js:18:10) at Service.writeFile (C:\Users\BLKsherry\Desktop\Project\frontend\node_modules\@vitjs\core\dist\Service\index.js:49:26) at C:\Users\Sherry.Bing\Desktop\Project\Bothwell\bothwell\frontend\node_modules\@vitjs\vit\dist\preset\exportStatic.js:23:17 at Array.map (<anonymous>) at exportStatic (C:\Users\BLKsherry\Desktop\Project\frontend\node_modules\@vitjs\vit\dist\preset\exportStatic.js:18:12) at Object.closeBundle (C:\Users\BLKsherry\Desktop\Project\frontend\node_modules\@vitjs\vit\dist\vitApp.js:37:39) at file:///C:/Users/BLKsherry/Desktop/Project/frontend/node_modules/rollup/dist/es/shared/rollup.js:22748:40 at processTicksAndRejections (node:internal/process/task_queues:96:5) at async Promise.all (index 0) at async PluginDriver.hookParallel (file:///C:/Users/BLKsherry/Desktop/Project/frontend/node_modules/rollup/dist/es/shared/rollup.js:22676:9) at async Object.close (file:///C:/Users/BLKsherry/Desktop/Project/frontend/node_modules/rollup/dist/es/shared/rollup.js:23750:13) at async Promise.all (index 0) at async build (file:///C:/Users/BLKsherry/Desktop/Project/frontend/node_modules/vite/dist/node/chunks/dep-c842e491.js:46421:13) at async CAC.<anonymous> (file:///C:/Users/BLKsherry/Desktop/Project/frontend/node_modules/vite/dist/node/cli.js:756:9)
想请问应该怎麽设置呢?谢谢!
the code below seems not working :
// vite.config.ts
export default defineConfig({
vitApp({
// vit configs ...
}),
// some other vite configs ...
resolve: {
alias: {
"~/": path.resolve(__dirname, "./"),
"~": path.resolve(__dirname, "./node_modules/"),
"@/": path.resolve(__dirname, "/src/"),
"~@/": path.resolve(__dirname, "/src/"),
"lodash": 'lodash-es',
"~antd": path.resolve(__dirname, "./node_modules/antd/"),
},
},
})
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.