
Security News
OWASP 2025 Top 10 Adds Software Supply Chain Failures, Ranked Top Community Concern
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.
vite-plugin-path-resolve
Advanced tools
这个plugin主要是解决 vue2 + webpack 迁移至 vite 中的路径问题.
case1: src/demo1/index.vue
case2: src/demo2/index.js
case3: src/demo3.vue
这在webpack是没问题的, 但是vite的话就会报错. 因为这个路径找不到对应文件
// ❌ in vite ,👌 in webpack
import demo1 from 'src/demo1'
import demo2 from 'src/demo2'
import demo3 from 'src/demo3'
to
// 🙆
import demo1 from 'src/demo1/index.vue'
import demo2 from 'src/demo2/index.js'
import demo3 from 'src/demo3.vue'
$ npm i vite-plugin-path-resolve -D
// vite.config.js
import pathResolve from 'vite-plugin-path-resolve'
function getPath(dir) {
return path.resolve(path.dirname(fileURLToPath(import.meta.url)), dir)
}
export default defineConfig({
plugins: [
pathResolve({ src: getPath('src') }),
]
})
| Name | Description | Default |
|---|---|---|
Object | required 需要处理的绝对路径对象集合 | null |
传入这个对象, 这个plugin将会只处理这个路径集合下的文件
请务必注意要绝对路径
FAQs
vite-plugin-path-resolve
The npm package vite-plugin-path-resolve receives a total of 8 weekly downloads. As such, vite-plugin-path-resolve popularity was classified as not popular.
We found that vite-plugin-path-resolve demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.