diff --git a/package.json b/package.json index 7c6b645..d91e9f0 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "test:build": "yarn build && jiti scripts/buildFixtures.ts" }, "dependencies": { - "pathe": "^0.0.2", + "upath": "^2.0.1", "webpack-virtual-modules": "^0.4.3" }, "devDependencies": { diff --git a/src/webpack/index.ts b/src/webpack/index.ts index 31cbe23..8b18316 100644 --- a/src/webpack/index.ts +++ b/src/webpack/index.ts @@ -1,13 +1,13 @@ import fs from 'fs' import { fileURLToPath } from 'url' -import { join, resolve, dirname } from 'pathe' +import path from 'upath' import VirtualModulesPlugin from 'webpack-virtual-modules' import type { Resolver, ResolveRequest } from 'enhanced-resolve' import type { UnpluginContextMeta, UnpluginInstance, UnpluginFactory, WebpackCompiler, ResolvedUnpluginOptions } from '../types' -const _dirname = typeof __dirname !== 'undefined' ? __dirname : dirname(fileURLToPath(import.meta.url)) -const TRANSFORM_LOADER = resolve(_dirname, 'webpack/loaders/transform.js') -const LOAD_LOADER = resolve(_dirname, 'webpack/loaders/load.js') +const _dirname = typeof __dirname !== 'undefined' ? __dirname : path.dirname(fileURLToPath(import.meta.url)) +const TRANSFORM_LOADER = path.resolve(_dirname, 'webpack/loaders/transform.js') +const LOAD_LOADER = path.resolve(_dirname, 'webpack/loaders/load.js') export function getWebpackPlugin ( factory: UnpluginFactory @@ -27,7 +27,7 @@ export function getWebpackPlugin ( rawPlugin, { __unpluginMeta: meta, - __virtualModulePrefix: join(process.cwd(), 'virtual:') + __virtualModulePrefix: path.join(process.cwd(), 'virtual:') } ) as ResolvedUnpluginOptions diff --git a/yarn.lock b/yarn.lock index ee636a1..f29bce0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4203,11 +4203,6 @@ path-type@^4.0.0: resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b" integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== -pathe@^0.0.2: - version "0.0.2" - resolved "https://registry.yarnpkg.com/pathe/-/pathe-0.0.2.tgz#d690780e578a8127e1d65828387609c153afc309" - integrity sha512-mmK20YtPb4yXHlaPuOD/uPIpRu7iIK45GA/GiRSlNpIdfWDG5aEQmFT1HHtBmJB+t/6DvFOtOsEipsPA8Bx2cw== - picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.3: version "2.3.0" resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.0.tgz#f1f061de8f6a4bf022892e2d128234fb98302972" @@ -5219,6 +5214,11 @@ universalify@^2.0.0: resolved "https://registry.yarnpkg.com/universalify/-/universalify-2.0.0.tgz#75a4984efedc4b08975c5aeb73f530d02df25717" integrity sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ== +upath@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/upath/-/upath-2.0.1.tgz#50c73dea68d6f6b990f51d279ce6081665d61a8b" + integrity sha512-1uEe95xksV1O0CYKXo8vQvN1JEbtJp7lb7C5U9HMsIp6IVwntkH/oNUzyVNQSd4S1sYk2FpSSW44FqMc8qee5w== + uri-js@^4.2.2: version "4.4.1" resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.4.1.tgz#9b1a52595225859e55f669d928f88c6c57f2a77e"