Laravel Vite不在移动设备上加载CSS

发布于 2025-02-13 15:03:18 字数 681 浏览 0 评论 0原文

我的vite有一个奇怪的问题...

我在开发人员中有一个网站,当我从PC上查看它时,Laravel微风的尾风CSS完美地加载了,没有错误。但是,当我从Mobil设备尝试相同的情况时,它说它不能加载CSS也不能加载JS,因为连接被拒绝。

它如何在PC上工作而不是在移动设备上工作?我的Vite Config:

import { defineConfig } from 'vite';
import laravel from 'laravel-vite-plugin';

export default defineConfig({
    plugins: [
        laravel([
            './public/css/app.css',
            './public/js/app.js',
        ]),
    ],
});

Mobile上的错误消息:

GET http://127.0.0.1:3000/public/css/app.css net::ERR_CONNECTION_REFUSED

app.js相同

,我需要在某个地方指定产品IP吗?还是使用SSL?还是需要将文件放在其他DIRS上?还是什么?在台式机上,它在移动设备(和/或Windows平板电脑上!)上都可以完美地工作。

先感谢您!

I have a strange problem with my vite...

I have a site in dev, and when I view it from PC, the laravel breeze tailwind css is perfectly loaded, there are no errors. But when I try the same from a mobil device, it says that it can't load neither the css nor the js, because connection refused.

How can it be, that it works on PC and not on mobile? My vite config:

import { defineConfig } from 'vite';
import laravel from 'laravel-vite-plugin';

export default defineConfig({
    plugins: [
        laravel([
            './public/css/app.css',
            './public/js/app.js',
        ]),
    ],
});

My error message on mobile:

GET http://127.0.0.1:3000/public/css/app.css net::ERR_CONNECTION_REFUSED

Same for app.js

Do I need to specify the prod IP somewhere? Or that it uses SSL? Or need to put the files to other dirs? Or what? On desktop it works perfectly, on mobile (and/or on windows tablet!) it does not at all.

Thank you in advance!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文