当前位置:网站首页>Vite's public directory
Vite's public directory
2022-06-10 10:41:00 【Bean paste,】
One ,public Catalog
1.public A directory is a way to store static resources .
2. When the project is initialized, it defaults to public A folder serving as a static resource . We can do it in vite.config.js Revision in China publicDir.
3. The files in this directory were created during development at / Provided by , And during the build will public Files in the folder ( It doesn't contain public In itself ) Copied to the outDir Root directory .
4.public The files under will be completely copied to the root directory of the target directory , Keep the original file name , It won't be hash.
Two , visit public Directory resources
1. In development, we can use / Direct access at the beginning public Directory of resources 

2. When a project is deployed under a nested public path , We need to specify base Configuration item , from JS Introduced resources URL,CSS Medium url() Quotation and .html The resources referenced in the file will be automatically adjusted during the construction process , To fit this option .
The above resources will become 
3. When dynamic connection is needed in the access process url when , Cannot be automatically adjusted , Global injection can be used import.meta.env.BASE_URL Variable , Its value is the common base path .
边栏推荐
猜你喜欢

Phpstorm configuration database connection

Axure pop-up settings

Leetcode 1991. Find the middle position of the array (brute force enumeration)

"Great freehand flower and bird painting master Mr. likuchan" blockbuster digital collection launched in the whole network

Development of NFT chain game gamefi system and construction of meta universe games

ADB log fetching

fcpx插件:PremiumVFX Animation Presets(动画循环预设) v1.0.1特别版
常用Shell命令 - 02 压缩和解压缩

MAC下安装MySQL+Django详细步骤
![[730. statistics of different palindrome subsequences]](/img/88/2a64eb20899ccc428f6011eb7ef72e.png)
[730. statistics of different palindrome subsequences]
随机推荐
For details of imitated Taobao products, pull down to switch to picture details, and pull up to switch to graphic introduction
Binary find a specific value in an ordered array
PV操作每日一题-缓冲区问题(进阶版)
MySQL practice 45 lectures_ 8_ Deepen the understanding of MySQL repeatable reading from a problem
MDB to DB file
xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Deve
NFT链游GameFi系统开发,元宇宙游戏搭建
Today, 19:30 | graphics special session - Gao Lin, teacher team of Institute of computing technology, Chinese Academy of Sciences
"Bookofsongs" themed cultural digital collection winners announced
“隔离险”成“网红”产品,不少投保者却表示:理赔难
dried food! Training method of machinetranslation model based on mask label smoothing
钰泰半导体冲刺科创板:年营收8.3亿 实控人为美国籍
Print: Entry, ':CFBundleIdentifier', Does Not Exist
[concurrent programming JUC] four ways to create threads
怎样简洁明了地说清楚产品需求?
基于SSH的音乐检索系统
Download and use of finalshell
可以在网上炒股开户吗?是安全的吗?
9、 Delegation mode
7、 Policy mode