Closed Vincz closed 2 years ago
Ok, it's just a matter of root directory. Reconfigure the path relative to the root of the project instead of ./assets
fix the problem.
The new default config file should be something like this:
// vite.config.js
import {defineConfig} from "vite";
import symfonyPlugin from "vite-plugin-symfony";
/* if you're using React */
// import reactRefresh from "@vitejs/plugin-react-refresh";
export default defineConfig({
plugins: [
/* reactRefresh(), // if you're using React */
symfonyPlugin(),
],
root: "./", // <--- INSTEAD OF ./assets/
/* your outDir web path prefix */
base: "/build/",
build: {
manifest: true,
emptyOutDir: true,
assetsDir: "",
outDir: "./public/build/", // <--- INSTEAD OF ../public/build/
rollupOptions: {
input: {
app: "./assets/app.ts" // <--- INSTEAD OF "./app.ts
},
},
}
});
Thanks @Vincz for your feedback ! I adapted the configuration with your vite config. good night
this makes vite hang forever for some reason, maybe because the root dir is set to "./" and it wants to scan my whole project (its really big)
With the latest vite version (2.8), we get the following error due to the Symfony Plugin:
Entry points must be inside Vite root directory