Laravel 10 использует Vitejs -> [plugin:inject]rollup-plugin-inject: не удалось проанализироватьCSS

Разбираемся в CSS
Ответить Пред. темаСлед. тема
Anonymous
 Laravel 10 использует Vitejs -> [plugin:inject]rollup-plugin-inject: не удалось проанализировать

Сообщение Anonymous »


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
Реклама
Ответить Пред. темаСлед. тема

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

  • Похожие темы
    Ответы
    Просмотры
    Последнее сообщение
  • Rollup-plugin-sass не включает модули scss
    Anonymous » » в форуме CSS
    0 Ответы
    16 Просмотры
    Последнее сообщение Anonymous
  • Как использовать Assisted Inject и Inject с рукояткой кинжала?
    Гость » » в форуме Android
    0 Ответы
    79 Просмотры
    Последнее сообщение Гость
  • Невозможно найти пакет импорта javax.inject.Inject.
    Anonymous » » в форуме JAVA
    0 Ответы
    44 Просмотры
    Последнее сообщение Anonymous
  • @Inject lateinit var против конструктора @Inject на рукояти кинжала
    Anonymous » » в форуме Android
    0 Ответы
    35 Просмотры
    Последнее сообщение Anonymous
  • @Inject lateinit var против конструктора @Inject на рукояти кинжала
    Anonymous » » в форуме Android
    0 Ответы
    21 Просмотры
    Последнее сообщение Anonymous

Вернуться в «CSS»