我是 Vite 新手,对 Laravel 的经验很少,我正在尝试将 Vite 与 Laravel 一起使用来进行资产捆绑。
我遵循 Laravel 官方文档的说明:https://laravel.com/docs/9.x/vite#blade-processing-static-assets
由于我使用的是 TypeScript,所以我的入口点文件名是:
resources/ts/app.ts
当我尝试写作时
import.meta.glob([
'../resources/img/..',
]);
我能够得到
Property 'glob' does not exist on type 'ImportMeta'.ts(2339)
。我明白一旦文件被构建,我必须使用
<img src="{{ Vite::asset('resources/images/logo.png') }}">
能够查看文件,但因为我要跳过更新 app.ts
文件。
我可以看到
logo.png
为
<imgsrc="https://sensitiveUrl.com/logo.a766f7e6.js"
我正在尝试捆绑静态资源(图像),就像我对 css/js 所做的那样。