当前位置:网站首页>Can't the dist packaged by vite be opened directly in the browser
Can't the dist packaged by vite be opened directly in the browser
2022-07-02 05:50:00 【User experience officer Dalong】
You can't
reason
Vite It depends on itself Native ES modular To do module loading , And the original ES Module is not supported file://
Locally accessible .
terms of settlement
Scheme 1 : Use http-server Plug in Launch
1. install node.js;( Installed, skipping )
2. install http-server.
npm install http-server -g
or
yarn global add http-server
3、 Get into dist The root directory executes the startup project
http-server
Option two : Use nginx start-up
1、 hold dist Copy to nginx Of html Under the table of contents ( Other directories will do , Need to be in nginx Internal configuration root);
2、 To configure nginx.conf
3、 Save and start nginx, visit http://127.0.0.1:3000 that will do .
( End )
边栏推荐
- 1037 Magic Coupon
- PHP parent
- Lingyunguang rushes to the scientific innovation board: the annual accounts receivable reaches 800million. Dachen and Xiaomi are shareholders
- all3dp. All Arduino projects in com website (2022.7.1)
- 【論文翻譯】GCNet: Non-local Networks Meet Squeeze-Excitation Networks and Beyond
- Alibaba: open source and self-developed liquid cooling data center technology
- “簡單”的無限魔方
- 我所理解的DRM显示框架
- 1036 Boys vs Girls
- [Chongqing Guangdong education] selected reading reference materials of British and American literature of Nanyang Normal University
猜你喜欢
JVM class loading mechanism
[personal test] copy and paste code between VirtualBox virtual machine and local
idea開發工具常用的插件合集匯總
RNN recurrent neural network
【技术随记-08】
Lantern Festival gift - plant vs zombie game (realized by Matlab)
The Hong Kong Stock Exchange learned from US stocks and pushed spac: the follow-up of many PE companies could not hide the embarrassment of the world's worst stock market
kmp思想及模板代码
Cube magique infini "simple"
all3dp.com网站中全部Arduino项目(2022.7.1)
随机推荐
金融门户相关信息
来啦~ 使用 EasyExcel 导出时进行数据转换系列新篇章!
Fabric. JS basic brush
软件测试答疑篇
Thread pool overview
idea開發工具常用的插件合集匯總
Gcnet: non - local Networks meet Squeeze excitation Networks and Beyond
js判断移动端还是pc端
460. LFU 缓存 双向链表
PHP obtains some values in the string according to the specified characters, and reorganizes the remaining strings into a new array
1036 Boys vs Girls
在线音乐播放器app
Oled12864 LCD screen
Opencv LBP features
数据挖掘方向研究生常用网站
all3dp.com网站中全部Arduino项目(2022.7.1)
Installation du tutoriel MySQL 8.0.22 par centos8
Thunder on the ground! Another domestic 5g chip comes out: surpass Huawei and lead the world in performance?
1035 Password
中小型项目手撸过滤器实现认证与授权