emersonbottero / vitepress-plugin-search

Provide local search to your documentation site.
MIT License
242 stars 30 forks source link

problem with resolve.alias #2

Closed iqorex closed 2 years ago

iqorex commented 2 years ago

Hey,

I followed the instruction but after creating index and trying to check searchbox i can still see old algolia component how can i fix this?

I am using 1.0.0-alpha4

My current vite config

import { defineConfig } from "vite";

export default defineConfig({
  resolve: {
    alias: {
      "./components/AlgoliaSearchBox.vue":
      "vitepress-plugin-search/src/Search.vue",
    },
  },
});
emersonbottero commented 2 years ago

this file should be inside docs folder, not in the root. If this don't solve the problem you can share a repo and I can check it out.

iqorex commented 2 years ago

i hade this file already in my docs folder here is my repo : https://github.com/iqorex/vitepress-demo

emersonbottero commented 2 years ago

You are correct, they made some changes in the last version, they also added more slots that I probably could use now.

to work as it is you can use

import { defineConfig } from "vite";

export default defineConfig({
  resolve: {
    alias: {
      "./VPNavBarSearch.vue": "vitepress-plugin-search/src/Search.vue",
    },
  },
});
iqorex commented 2 years ago

thanks it works like a charm