0.160.4 • Published 2 years ago

vite-plugin-local-scoped-modules v0.160.4

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

vite-plugin-local-scoped-modules

This is a vite plugin that intends to avoid typing relative paths.Use relative paths like local modules instead.

Install

 yarn add  --dev  vite-plugin-local-scoped-modules 

Usage

Below is a sample of config in vite.config.js on what it is going to be like:

 import { defineConfig } from 'vite'
 import reactRefresh from '@vitejs/plugin-react-refresh'
 
 import localScopedModules from 'vite-plugin-local-scoped-modules'
 export default defineConfig({
  
    plugins: [
   
        localScopedModules({
            "scopes": [
                {
                    "name": "@components",
                    "dir": "~/src/components"
                }
            ]
        }),
        reactRefresh(),
    ]
})
 

Now is a sample in usage, anywhere under the project you can:

import App from '@components/App.jsx'

Relatives:

Lisense

MIT

0.160.3

2 years ago

0.160.4

2 years ago

0.160.1

2 years ago

0.160.2

2 years ago

0.160.0

2 years ago

0.120.1-alpha

2 years ago

0.120.1-alpha-1

2 years ago

0.111.1

3 years ago

0.110.1-zz

3 years ago

0.110.1-z

3 years ago

0.110.1

3 years ago