我从事与laravel 9
和Vite
与laravel-vite
一起工作的项目,
在开发环境中,一切正常,但是在生产cPanel服务器中,我遇到了这个问题。
Vite manifest not found at: /home/???????/cart_shop/public/build/manifest.json
# With
Missing Vite Manifest File
Did you forget to run `npm install && npm run dev`?
我试图解决这个问题,但是什么也没有成功,我需要从vite.config.js更改公用文件夹和sup文件夹构建文件的位置,但是我没有找到方法。
注意: cPanel共享服务器中的文件序列由
- home
- public_html
- cart_shop
- Root
- public
- etc
至
- home
- public_html
- public files and folders // I changed the index URLs too.
- cart_shop
- Root
- etc
我的vite.config.js
配置如下:
import { defineConfig } from 'vite';
import laravel from 'laravel-vite-plugin';
import vue from '@vitejs/plugin-vue';
export default defineConfig({
plugins: [
laravel({
input: 'resources/js/app.js',
}),
vue({
template: {
transformAssetUrls: {
base: null,
includeAbsolute: false,
},
},
}),
],
});
发布于 2022-10-29 07:40:45
在我的例子中,我通过做一些事情解决了这个问题。
首先,我通过运行以下命令安装了npm
npm install
在那之后,我跑了
npm run dev
最后,我跑了
npm run build
有一件事我注意到,我的问题没有得到解决,为此,我执行了一些命令,
php artisan optimize:clear
在运行这个命令之后,我运行了以前运行的那些命令。
最后我的问题解决了。
https://stackoverflow.com/questions/73045616
复制相似问题