Laravel 10 использует Vitejs -> [plugin:inject]rollup-plugin-inject: не удалось проанализировать ⇐ CSS
Laravel 10 использует Vitejs -> [plugin:inject]rollup-plugin-inject: не удалось проанализировать
I need a little explanation of how Vite JS works on the build.
I'll tell you what it's about. I have a project with a CSS, images and JS folder in the resources folder. I also have a vendors folder where I have various JS and CSS libraries as well as fonts and images. App.js
import './bootstrap'; import.meta.glob([ '../vendors/common/fonts/**', '../vendors/common/images/**', '../vendors/common/webfonts/**', ]); // JS import '../js/script.js'; import '../js/slider-script.js'; // JS LIB import '../vendors/bootstrap/js/bootstrap.bundle.min.js'; import '../vendors/wow/wow.js'; import '../vendors/owl-carousel/owl.carousel.min.js'; // CSS LIB import '../vendors/bootstrap/css/bootstrap.css'; import '../vendors/fontawesome/css/all.min.css'; import '..//vendors/animate/animate.min.css'; import '../vendors/youtube-popup/youtube-popup.css'; import '../vendors/icomoon/style.css'; import '../vendors/owl-carousel/owl.carousel.min.css'; import '../vendors/owl-carousel/owl.theme.default.min.css'; import '../css/style.css';
import { defineConfig } from 'vite'; import laravel from 'laravel-vite-plugin'; import inject from '@rollup/plugin-inject'; import path from "path"; export default defineConfig({ build: { assetsInlineLimit: 0, }, plugins: [ inject({ jQuery: "jquery", "window.jQuery": "jquery", $: "jquery" }), laravel({ input: ['resources/js/app.js'], refresh: true, }) ] });
I can't understand why when I run npm run build I get problems in the console:
The folder of build : enter image description here
And here are the errors when I launch the build. I'd like the fonts and images in the vendors folder to be added to the assets during the build, but it doesn't work.
[plugin:inject] rollup-plugin-inject: failed to parse /home/www/laralve10/resources/vendors/youtube-popup/you tube-popup.css. Consider restricting the plugin to particular files via options.include
[plugin:inject] rollup-plugin-inject: failed to parse /home/www/laralve10/resources/vendors/icomoon/style.css . Consider restricting the plugin to particular files via options.include
[plugin:inject] rollup-plugin-inject: failed to parse /home/www/laralve10resources/css/style.css. Consider r estricting the plugin to particular files via options.include
[plugin:inject] rollup-plugin-inject: failed to parse /home/www/laralve10/resources/vendors/fontawesome/css/a ll.min.css. Consider restricting the plugin to particular files via options.include
for the rest everything is ok, images are built in the asset folder with css and js
✓ 85 modules transformed. public/build/assets/banner-one-shape-1-D9OP_mXl.png
I haven't created an images folder in public. Is this compulsory? Is it also possible to create an images sub-folder in assets so that the images can be inserted on their own?
Источник: https://stackoverflow.com/questions/780 ... d-to-parse
I need a little explanation of how Vite JS works on the build.
I'll tell you what it's about. I have a project with a CSS, images and JS folder in the resources folder. I also have a vendors folder where I have various JS and CSS libraries as well as fonts and images. App.js
import './bootstrap'; import.meta.glob([ '../vendors/common/fonts/**', '../vendors/common/images/**', '../vendors/common/webfonts/**', ]); // JS import '../js/script.js'; import '../js/slider-script.js'; // JS LIB import '../vendors/bootstrap/js/bootstrap.bundle.min.js'; import '../vendors/wow/wow.js'; import '../vendors/owl-carousel/owl.carousel.min.js'; // CSS LIB import '../vendors/bootstrap/css/bootstrap.css'; import '../vendors/fontawesome/css/all.min.css'; import '..//vendors/animate/animate.min.css'; import '../vendors/youtube-popup/youtube-popup.css'; import '../vendors/icomoon/style.css'; import '../vendors/owl-carousel/owl.carousel.min.css'; import '../vendors/owl-carousel/owl.theme.default.min.css'; import '../css/style.css';
import { defineConfig } from 'vite'; import laravel from 'laravel-vite-plugin'; import inject from '@rollup/plugin-inject'; import path from "path"; export default defineConfig({ build: { assetsInlineLimit: 0, }, plugins: [ inject({ jQuery: "jquery", "window.jQuery": "jquery", $: "jquery" }), laravel({ input: ['resources/js/app.js'], refresh: true, }) ] });
I can't understand why when I run npm run build I get problems in the console:
The folder of build : enter image description here
And here are the errors when I launch the build. I'd like the fonts and images in the vendors folder to be added to the assets during the build, but it doesn't work.
[plugin:inject] rollup-plugin-inject: failed to parse /home/www/laralve10/resources/vendors/youtube-popup/you tube-popup.css. Consider restricting the plugin to particular files via options.include
[plugin:inject] rollup-plugin-inject: failed to parse /home/www/laralve10/resources/vendors/icomoon/style.css . Consider restricting the plugin to particular files via options.include
[plugin:inject] rollup-plugin-inject: failed to parse /home/www/laralve10resources/css/style.css. Consider r estricting the plugin to particular files via options.include
[plugin:inject] rollup-plugin-inject: failed to parse /home/www/laralve10/resources/vendors/fontawesome/css/a ll.min.css. Consider restricting the plugin to particular files via options.include
for the rest everything is ok, images are built in the asset folder with css and js
✓ 85 modules transformed. public/build/assets/banner-one-shape-1-D9OP_mXl.png
I haven't created an images folder in public. Is this compulsory? Is it also possible to create an images sub-folder in assets so that the images can be inserted on their own?
Источник: https://stackoverflow.com/questions/780 ... d-to-parse
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение