Maybe I didn't understand correctly how to use vite.
I am working with Laravel 9. I have created a package in "packages/mypackage" for my project, and I would like to use vite separately for this subfolder.
When I run "npm run build", It works correctly, generating a public folder in the package, with its own manifest.json.
The main problem is when I want to load those files in a blade view.
My public/build/manifest inside the package:
{
"themes/custom/scss/styles.scss": {
"file": "assets/styles-9b1f12cb.css",
"src": "themes/custom/scss/styles.scss",
"isEntry": true
},
"themes/custom/js/scripts.js": {
"file": "assets/scripts-4ed993c7.js",
"src": "themes/custom/js/scripts.js",
"isEntry": true
}
}
But when I use vite in blade with
@vite(['themes/custom/js/scripts.js', 'themes/custom/scss/styles.scss'])
Chrome shows an exception:
Unable to locate file in Vite manifest: themes/custom/js/scripts.js.
Could someone help me to figure out what I'm doing wrong?
Thanks!