diff --git a/CHANGELOG.md b/CHANGELOG.md index 9f8dd8a8..77eb56b3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +### [0.2.7](https://github.com/unjs/unplugin/compare/v0.2.6...v0.2.7) (2021-09-01) + + +### Bug Fixes + +* use default export for `unpath`, close [#10](https://github.com/unjs/unplugin/issues/10) ([5a3645a](https://github.com/unjs/unplugin/commit/5a3645ac25ebf0cb26ac75adbd567e53c57e9fe5)) + ### [0.2.6](https://github.com/unjs/unplugin/compare/v0.2.5...v0.2.6) (2021-08-31) diff --git a/package.json b/package.json index 537a2ba3..caa011d7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "unplugin", - "version": "0.2.6", + "version": "0.2.7", "description": "Unified plugin system for build tools", "repository": "unjs/unplugin", "license": "MIT", diff --git a/src/webpack/index.ts b/src/webpack/index.ts index 878a1e0d..b325a3f3 100644 --- a/src/webpack/index.ts +++ b/src/webpack/index.ts @@ -1,13 +1,13 @@ import fs from 'fs' import { fileURLToPath } from 'url' -import { dirname, join, resolve } from 'upath' -import type { Resolver } from 'enhanced-resolve' +import path from 'upath' import VirtualModulesPlugin from 'webpack-virtual-modules' +import type { Resolver } 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