lhapaipai / vite-bundle

Integration with your Symfony app & Vite
https://symfony-vite.pentatrion.com
MIT License
230 stars 24 forks source link

twig does not recognize vite directives #89

Closed dj-Andres closed 2 months ago

dj-Andres commented 2 months ago

I have a problem, the twig view does not recognize the vite directives

{% block stylesheets %}
{{ vite_entry_link_tags('app') }}
{% endblock %}

{% block javascripts %}
{{ vite_entry_script_tags('app') }}
{% endblock %}

When I inspect in the browser, the app.js and app.css files are not found, either when I do the build or in development.

I attach my vite configuration file

I attach my vite configuration file

import { defineConfig } from "vite";
import { viteStaticCopy } from "vite-plugin-static-copy";
import path from "path";
import symfonyPlugin from "vite-plugin-symfony";

export default defineConfig({
  plugins: [
    symfonyPlugin(),
    viteStaticCopy({
      targets: [
        {
          src: 'assets/images',
          dest: 'bundles/'
        },
        {
          src: 'assets/fonts',
          dest: 'bundles/'
        },
        {
          src: 'assets/webfonts',
          dest: 'bundles/'
        },
        {
            src: 'assets/index.php',
            dest: ''
        }
      ]
  ]},
  build: {
    outDir: "public",
    assetsDir: "bundles",
    rollupOptions: {
      input: {
        app: "./assets/app.js",
      }
    },
  },
});
lhapaipai commented 2 months ago

hi @dj-Andres, can you please open your issue in the principal repository : https://github.com/lhapaipai/symfony-vite-dev/issues like mentionned in the template : https://github.com/lhapaipai/vite-bundle/issues/new

The issues that are still present here were opened before I implemented the template, that's why they were not closed.

Thanks