mirror of
https://github.com/unjs/unplugin.git
synced 2026-02-01 16:56:37 +00:00
fix: use default export for unpath, close #10
This commit is contained in:
parent
99ff5772e3
commit
5a3645ac25
@ -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<UserOptions = {}> (
|
||||
factory: UnpluginFactory<UserOptions>
|
||||
@ -27,7 +27,7 @@ export function getWebpackPlugin<UserOptions = {}> (
|
||||
rawPlugin,
|
||||
{
|
||||
__unpluginMeta: meta,
|
||||
__virtualModulePrefix: join(process.cwd(), 'virtual:')
|
||||
__virtualModulePrefix: path.join(process.cwd(), 'virtual:')
|
||||
}
|
||||
) as ResolvedUnpluginOptions
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user