mirror of
https://github.com/unjs/unplugin.git
synced 2025-12-08 20:26:33 +00:00
chore: make webpack call compactible with 4 and 5
This commit is contained in:
parent
cfc198d5aa
commit
5e71cd2c6b
@ -52,6 +52,7 @@
|
||||
"fs-extra": "^10.1.0",
|
||||
"jiti": "^1.14.0",
|
||||
"magic-string": "^0.26.2",
|
||||
"picocolors": "^1.0.0",
|
||||
"rollup": "^2.77.2",
|
||||
"tsup": "^6.2.0",
|
||||
"typescript": "^4.7.4",
|
||||
|
||||
2
pnpm-lock.yaml
generated
2
pnpm-lock.yaml
generated
@ -19,6 +19,7 @@ specifiers:
|
||||
fs-extra: ^10.1.0
|
||||
jiti: ^1.14.0
|
||||
magic-string: ^0.26.2
|
||||
picocolors: ^1.0.0
|
||||
rollup: ^2.77.2
|
||||
tsup: ^6.2.0
|
||||
typescript: ^4.7.4
|
||||
@ -52,6 +53,7 @@ devDependencies:
|
||||
fs-extra: 10.1.0
|
||||
jiti: 1.14.0
|
||||
magic-string: 0.26.2
|
||||
picocolors: 1.0.0
|
||||
rollup: 2.77.2
|
||||
tsup: 6.2.0_typescript@4.7.4
|
||||
typescript: 4.7.4
|
||||
|
||||
@ -2,7 +2,7 @@ import * as path from 'path'
|
||||
import { it, describe, expect, vi, afterEach, Mock } from 'vitest'
|
||||
import * as vite from 'vite'
|
||||
import * as rollup from 'rollup'
|
||||
import { webpack } from 'webpack'
|
||||
import * as webpack from 'webpack'
|
||||
import * as esbuild from 'esbuild'
|
||||
import { createUnplugin, UnpluginOptions } from '../../../src'
|
||||
|
||||
@ -83,7 +83,7 @@ describe('resolveId hook', () => {
|
||||
const plugin = createUnpluginWithCallback(mockResolveIdHook).webpack
|
||||
|
||||
await new Promise((resolve) => {
|
||||
webpack(
|
||||
(webpack.webpack || webpack)(
|
||||
{
|
||||
entry: path.resolve(__dirname, 'test-src/entry.js'),
|
||||
plugins: [plugin()]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user