Skip to content

Alias error #661

Answered by aklinker1
msamiluludag asked this question in Q&A
May 20, 2024 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

Don't set paths in your tsconfig file. They clash with the paths defined in .wxt/tsconfig.json. instead, set them in the WXT config:

https://wxt.dev/api/wxt/interfaces/InlineConfig.html#alias

import { defineConfig } from "wxt";
import react from "@vitejs/plugin-react";
import { resolve } from "path";

// See https://wxt.dev/api/config.html
export default defineConfig({
  alias: {
    '@': './entrypoints/popup'
  },
  vite: () => ({
    plugins: [react()],
  }),
});

That said, I've never tried overriding the @ alias and don't know if that will work... I recommend using something like this instead: 'popup': './entrypoints/popup'

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@msamiluludag
Comment options

Answer selected by msamiluludag
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants