@culur/config-vite
v1.4.0
Published
Culur's vite configuration
Readme
@culur/config-vite
✨ Features
The library is a shareable vite/vitest configuration. It has some key features as follows:
- Include
vite-tsconfig-pathsplugin by default. - Include
vitestconfig by default (withtypecheck,coverage). - Customizable for more complex applications.
💿 Installation
Add @culur/config-vite dependency to your project.
# Using npm
npm install @culur/config-vite --save-dev
# Using pnpm
pnpm install @culur/config-vite --dev
# Using yarn
yarn add @culur/config-vite --devOther packages:
- For
viteusage, you need to installvitepackage in devDependencies. - For
vitestusage, you need to installvitest,@vitest/ui,@vitest/coverage-v8packages in devDependencies. - For typecheck:
- Use
tsc(fromtypescriptpackage) - Use
vue-tsc(fromvue-tscpackage).
- Use
📖 Usage
1. Use default config
In vite.config.mts:
import { vite } from '@culur/config-vite';
export default vite;In vitest.config.mts:
import { vitest } from '@culur/config-vite';
export default vitest;2. Use custom config
In vite.config.ts or vitest.config.mts:
import { defineConfig } from '@culur/config-vite';
export default defineConfig({
test: true, // or false
// other configs...
});📜 Scripts
Some commonly used scripts in package.json.
{
"scripts": {
"test": "vitest run",
"test-tsc": "tsc --noEmit && vitest run",
"test-vue-tsc": "vue-tsc --noEmit && vitest run",
"test-ui": "vitest --ui"
}
}🗃️ Changelog
See CHANGELOG for more information on what has changed recently.
🔒 License
See LICENSE for license rights and limitations (MIT).
