Skip to content

Conversation

alilo113
Copy link

Problem

In development mode, custom aliases like $broke:/ were not resolved correctly, causing import errors. In production, the aliases worked fine.

Solution

  • Removed the colon / from the alias names ($broke:/$broke, $okay:/$okay)
  • Updated imports to match the new aliases
  • Verified that both dev and production builds correctly resolve the aliases

This ensures consistent behavior across dev and production environments.

import { defineConfig } from "vite";
import path from "node:path";

export default defineConfig({
  resolve: {
    alias: [
      { find: "$okay", replacement: path.resolve(__dirname, "src") },
      { find: "$broke", replacement: path.resolve(__dirname, "src") },
    ],
  },
});

@sapphi-red sapphi-red marked this pull request as draft August 18, 2025 02:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant