diff --git a/src/rspack/index.ts b/src/rspack/index.ts index 9985b4e6..4381a9ca 100644 --- a/src/rspack/index.ts +++ b/src/rspack/index.ts @@ -146,6 +146,7 @@ export function getRspackPlugin>( unpluginName: plugin.name, }, }], + type: 'javascript/auto', }) } diff --git a/src/webpack/index.ts b/src/webpack/index.ts index 65ec9e30..23f41da3 100644 --- a/src/webpack/index.ts +++ b/src/webpack/index.ts @@ -170,6 +170,7 @@ export function getWebpackPlugin>( unpluginName: plugin.name, }, }], + type: 'javascript/auto', }) } diff --git a/test/fixtures/virtual-module/unplugin.js b/test/fixtures/virtual-module/unplugin.js index 5b267478..418f89f5 100644 --- a/test/fixtures/virtual-module/unplugin.js +++ b/test/fixtures/virtual-module/unplugin.js @@ -1,4 +1,4 @@ -const { createUnplugin } = require('unplugin') +const { createUnplugin } = require('../../../') module.exports = createUnplugin(() => { return {