Subwaytime / vite-aliases

Alias auto generation for Vite
https://www.npmjs.com/package/vite-aliases
MIT License
213 stars 13 forks source link

No overload matches this call. Type 'Plugin_2' is not assignable to type 'PluginOption'. #72

Open issam-seghir opened 10 months ago

issam-seghir commented 10 months ago

image

My vite config :

import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import { ViteAliases } from "vite-aliases";
import svgr from "vite-plugin-svgr";

export default defineConfig({
    base: "/instagram-clone/",
    // Getting rid of hashes in generated filenames
    filenameHashing: true,
    build: {
        // change output location
        rollupOptions: {
            output: {
                assetFileNames: (assetInfo) => {
                    if (assetInfo.name.endsWith(".gif")) {
                        return "[name].[ext]";
                    }
                    return `[name].[hash].[ext]`;
                },
            },
        },
    },
    resolve: {
        extensions: [".js", ".jsx", ".ts", ".tsx", ".json"],
    plugins: [
        [react()],
        ViteAliases({
            dir: "src",
            prefix: "@",
            deep: true,
            depth: 2,
            adjustDuplicates: true,
            useConfig: true,
            /**
             * Disables any terminal output
             */
            silent: false,
        }) ,
        svgr({
            include: "**/*.svg",
        }),
    ],
});
Osmon11 commented 10 months ago

+1

Subwaytime commented 10 months ago

Hey there, thanks for the report! This should've been resolved a while ago.. :thinking: Currently it does not appear for me, but i will investigate and try to include a fix in the upcoming 0.12!