背景
我是新来的维特和很少的经验,在拉腊维尔,我试图使用维特与拉腊维尔的资产捆绑。
我遵循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一样。
1条答案
按热度按时间mbyulnm01#
增加**“类型”:[“vite/client”]**在项目根目录的tsconfig.json中。
tsconfig.json vite.cofing.js文件也应该正确配置。