当前位置:网站首页>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 -gor
yarn global add http-server3、 Get into dist The root directory executes the startup project
http-serverOption 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 )
边栏推荐
猜你喜欢

Fabric. JS centered element

5g market trend in 2020

Opencv LBP features

ThreadLocal memory leak

Youth training camp -- database operation project

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

Software testing Q & A

centos8安装mysql8.0.22教程

centos8安裝mysql8.0.22教程

brew install * 失败,解决方法
随机推荐
1037 Magic Coupon
mysql的约束总结
Determine whether there is an element in the string type
How to change the IP address of computer mobile phone simulator
2022-2-14 learning xiangniuke project - Section 7 account setting
GRBL 软件:简单解释的基础知识
Online music player app
Innovation never stops -- the innovation process of nvisual network visualization platform for Excel import
TypeScript的泛型和泛型约束
Reflection of the soul of the frame (important knowledge)
1035 Password
With an amount of $50billion, amd completed the acquisition of Xilinx
all3dp.com网站中全部Arduino项目(2022.7.1)
mysql事务和隔离级别
3D 打印机 G 代码命令:完整列表和教程
[technical notes-08]
Generate QR code
php父类(parent)
ThreadLocal memory leak
Fabric. JS iText sets the color and background color of the specified text