⭐️ Auto create alias map for vite config

Overview

vite-plugin-tspaths2alias

This plugin is create alias map for vite config, default use project root tsconfig.json file compilerOptions.paths value

Install

npm install -D vite-plugin-tspaths2alias

Usage

In typesctipt project, you can zero configuration to use this plugin! or provide a json file, but i advice use the tsconfig.json by tsc cli created

import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import tspaths2alias from 'vite-plugin-tspaths2alias'
// https://vitejs.dev/config/
export default defineConfig({
  plugins: [vue(),tspaths2alias({ /** tsConfigPath: './[name].json' **/ })]
})

In javascript project, you want to use this plugin, you can provide alias.json or other name json file

import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import tspaths2alias from 'vite-plugin-tspaths2alias'
// https://vitejs.dev/config/
export default defineConfig({
  plugins: [vue(),tspaths2alias({ tsConfigPath: './alias.json' })]
})

Custom configuration

{
  "@/*": "./src/*",
  "@components": "./src/components",
  "@views": "./src/views",
  "@layout": "./src/layout",
  "@test": "./src/test"
}
You might also like...

A template repository / quick start to build Azure Static Web Apps with a Node.js function. It uses Vue.js v3, Vue Router, Vuex, and Vite.js.

A template repository / quick start to build Azure Static Web Apps with a Node.js function. It uses Vue.js v3, Vue Router, Vuex, and Vite.js.

Azure Static Web App Template with Node.js API This is a template repository for creating Azure Static Web Apps that comes pre-configured with: Vue.js

Jun 25, 2022

⏳ vue3 + electron + ts + vite = mini template

v3-electron 🥳 Electron16 + Vue3 + Vite2 运行项目 # enter the project directory cd v3-electron # install dependency yarn # develop yarn dev # build exe

Nov 11, 2022

Using Cypress with Vite, React, TypeScript, MSW and react-query

Vie + Cypress + MSW + react-query Demo Example of using Cypress with Vite, MSW and react-query. Uses the appReady pattern to signal to Cypress when th

Jul 16, 2022

Fastify boilerplate with Vite & Vitest

Fastify boilerplate with Vite & Vitest Enhance your Fastify DX with the power of Vite & Vitest. Features ⚡ All the power of Vite (Next Generation Fron

Dec 13, 2022

Some compile-time magic for your Vite project

💛 You can help the author become a full-time open-source maintainer by sponsoring him on GitHub. vite-plugin-compile-time Use this plugin to generate

Dec 15, 2022

vite+vue3.2+setup+elementPlus+eslint+js+stylelint

前期准备工作,npm包和vscode配置 !!!很重要,关乎整个Vue3开发阶段的代码提示 Volar使用 使用Vue3开发需要禁用vscode插件Vetur 然后安装 Volar(Vue Language Features),这样Vue3代码提示即使是使用js开发也非常友好 如果volar没有任何

Feb 8, 2022

vue3 + vite + typescript template

Vue 3 + Typescript + Vite This template should help get you started developing with Vue 3 and Typescript in Vite. The template uses Vue 3 script setu

Aug 1, 2022

Minimal setup for a WebXR project using Vite, Babylon.js, TypeScript, and Vue

Minimal setup for a WebXR project using Vite, Babylon.js, TypeScript, and Vue

WebXR-Vite-Babylon-Simple Minimal setup for WebXR development using: vite typescript vue 3 babylonjs 5 (ES6) Intentionally made minimal changes from t

Nov 13, 2022

Modern ThreeJS boilerplate powered by Vite & Typescript

Modern ThreeJS boilerplate powered by Vite & Typescript

Modern ThreeJS ⚡️ Modern ThreeJS boilerplate powered by Vite & Typescript. Features Powered with Vite 📦 GUI controls using Tweakpane 🎛 Typescript 🦾

Jan 4, 2023
Releases(v0.1.0)
Owner
yankit
🚀 npm选手
yankit
Vue 3 + Vite + SSR template based on Vite Plugin SSR and inspired by Vitesse

Vite Vue SSR Starter Vue 3 + Vite + SSR template based on Vite Plugin SSR and inspired by Vitesse Features ⚡️ Vue 3, Vite 2, TypeScript ?? Domain-Driv

Oleg Koval 10 Aug 2, 2022
⚡A zero-config bundler for JavaScript applications.

Poi is a bundler built on the top of webpack, trying to make developing and bundling apps with webpack as easy as possible. The Poi project is support

Eren Bets 5.3k Jan 4, 2023
The standard shareable Vue config for Stylelint.

stylelint-config-standard-vue The standard shareable Vue config for Stylelint. This config: extends the stylelint-config-standard shared config and co

Yosuke Ota 10 Dec 13, 2022
Batteries-included, zero-config Ionic integration for Nuxt

Nuxt Ionic Ionic integration for Nuxt ✨ Changelog ?? Read the documentation ▶️ Online playground Features ⚠️ nuxt-ionic is currently a work in progres

Daniel Roe 211 Dec 28, 2022
Unified utils for auto importing APIs in modules.

unimport Unified utils for auto importing APIs in modules Install # npm npm install unimport # yarn yarn install unimport # pnpm pnpm install unimpo

unjs 180 Jan 9, 2023
Auto generate the corresponding `.env` file.

unplugin-vue-dotenv Auto generate the corresponding .env file. Install npm i unplugin-vue-dotenv Vite // vite.config.ts import Dotenv from 'unplugin-v

Chris 6 Dec 24, 2022
A Marko plugin for Vite

@marko/vite A Marko plugin for Vite. Installation npm install @marko/vite Example config import { defineConfig } from "vite"; import marko from "@mark

Marko 49 Nov 26, 2022
🎉 基于 vite 2.0 + vue 3.0 + vue-router 4.0 + vuex 4.0 + element-plus 的后台管理系统vue3-element-admin

vue3-element-admin ?? 基于 Vite 2.0 + Vue3.0 + Vue-Router 4.0 + Vuex 4.0 + element-plus 的后台管理系统 简介 vue3-element-admin 是一个后台前端解决方案,它基于 vue3 和 element-plu

雪月欧巴 84 Nov 28, 2022
Vite template with TypeScript, Chakra UI, Eslint Airbnb, Prettier

Vite + Typescript + ChakraUI = ❤️ This is a vite template that combines several technologies: Vite React TypeScript ChakraUI Eslint with eslint-config

Lorenzo Rapetti 3 Mar 26, 2022
Integrate Tauri in a Vite project to build cross-platform apps.

vite-plugin-tauri Integrate Tauri in a Vite project to build cross-platform apps Install Make sure to setup your environment for Tauri development. Th

Amr Bashir 95 Dec 15, 2022