【发布时间】:2022-08-09 20:35:55
【问题描述】:
我正在处理与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,
},
},
}),
],
});
-
你有什么节点版本?
node -v -
节点:
v16.13.1与 npm:8.14.0 -
也许您需要在 vite config 中更改构建目录,打开 vite.config.js 并在输入数组
buildDirectory: \'../../public/build\',下添加,看看它是否有效。 -
我可以将
buildDirectory: \'../public/build\',放入export default defineConfig或`plugins:` 中吗?你能把conf 序列发给我吗?
标签: php laravel vite laravel-9