vite-tsconfig-paths
Advanced tools
Comparing version 2.0.0-alpha.3 to 2.0.0-alpha.4
{ | ||
"name": "vite-tsconfig-paths", | ||
"version": "2.0.0-alpha.3", | ||
"version": "2.0.0-alpha.4", | ||
"description": "Vite resolver for TypeScript compilerOptions.paths", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -1,3 +0,2 @@ | ||
import type { Plugin } from 'vite' | ||
import { relative, resolve, sep } from 'path' | ||
import { normalizePath, Plugin } from 'vite' | ||
import { createMatchPath, loadConfig } from 'tsconfig-paths' | ||
@@ -26,3 +25,3 @@ | ||
configResolved({ root, logger }) { | ||
root = resolve(opts.root || root) + sep | ||
root = (opts.root ? normalizePath(opts.root) : root) + '/' | ||
@@ -59,3 +58,3 @@ const config = loadConfig(root) | ||
if (path) { | ||
path = '/' + relative(process.cwd(), path) | ||
path = normalizePath(path) | ||
@@ -66,6 +65,8 @@ const resolution = await this.resolve(path, importer, { | ||
if (resolution) { | ||
resolved.set(id, (path = resolution.id)) | ||
debug(`resolved "${id}" to "${path}"`) | ||
if (!resolution) { | ||
return null | ||
} | ||
resolved.set(id, (path = resolution.id)) | ||
debug(`resolved "${id}" to "${path}"`) | ||
} | ||
@@ -79,3 +80,3 @@ } | ||
const nodeModulesRE = /\bnode_modules\b/ | ||
const nodeModulesRE = /\/node_modules\// | ||
@@ -82,0 +83,0 @@ /** Returns true when `path` is within `root` and not an installed dependency. */ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
13325