Skip to content

sajmoni/enable-absolute-paths

Repository files navigation

enable-absolute-paths

Enable absolute paths in a TypeScript project

Import files with ~/. Assumes a ./src folder.

src/example.ts -> ~/example

Usage

npx enable-absolute-paths@latest

vite

If using vite, add this to your vite.config.ts

resolve: {
    alias: {
      '~': resolve(__dirname, 'src'),
    },
  },

About

Enable absolute paths in a TypeScript project

Resources

License

Stars

Watchers

Forks

Packages

No packages published