当前位置:网站首页>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 )
边栏推荐
- File contains vulnerabilities (II)
- Appnuim environment configuration and basic knowledge
- Technologists talk about open source: This is not just using love to generate electricity
- Determine whether there is an element in the string type
- PHP read file (read the specified line containing a string in the file)
- Fabric. JS iText sets the color and background color of the specified text
- Yyds dry inventory what is test driven development
- Zzuli:1067 faulty odometer
- File contains vulnerability (I)
- Fabric. JS centered element
猜你喜欢

3D printer G code command: complete list and tutorial

idea开发工具常用的插件合集汇总

Minimum value ruler method for the length of continuous subsequences whose sum is not less than s

软件测试基础篇

Practice C language advanced address book design

Appnuim environment configuration and basic knowledge

Win10 copy files, save files... All need administrator permission, solution

记录sentry的踩坑之路

RGB infinite cube (advanced version)

【论文翻译】GCNet: Non-local Networks Meet Squeeze-Excitation Networks and Beyond
随机推荐
Brew install * failed, solution
all3dp.com网站中全部Arduino项目(2022.7.1)
Stick to the big screen UI, finereport development diary
【LeetCode】Day92-盛最多水的容器
I want to understand the swift code before I learn it. I understand it
Lingyunguang rushes to the scientific innovation board: the annual accounts receivable reaches 800million. Dachen and Xiaomi are shareholders
php读文件(读取文件内含有某字符串的指定行)
PHP extensions
Uva548 tree
File contains vulnerability (I)
在线音乐播放器app
Reading notes of cgnf: conditional graph neural fields
Here comes a new chapter in the series of data conversion when exporting with easyexcel!
kmp思想及模板代码
Fundamentals of software testing
A collection of commonly used plug-ins for idea development tools
15 C language advanced dynamic memory management
【论文翻译】GCNet: Non-local Networks Meet Squeeze-Excitation Networks and Beyond
Zzuli:1068 binary number
js判断移动端还是pc端