This project is no longer maintained.
Life got busy — work, kids, and the usual chaos. I no longer have the time or energy to keep up with issues or updates. Use it if it works for you, but don't expect updates or support.

Custom Aliases

If you use custom aliases, you may need to help Preview.js resolve imports.

Since Preview.js uses Vite under the hood, you just need to configure Vite with resolve.alias.

For example if you want ui-components/Button to map to src/ui/components/Button.tsx, you will need the following configuration:

// vite.config.js

export default {
  resolve: {
    alias: {
      "ui-components": "src/ui/components",
    },
  },
};

js/tsconfig.json support

Preview.js can automatically detect aliases from tsconfig.json (as well as jsconfig.json). As a result, you may not need to explicitly provide aliases.