Skip to content
This repository was archived by the owner on Dec 25, 2024. It is now read-only.

Commit 982d7b5

Browse files
authored
fix: defu.default is not a function (#99)
1 parent 7605ed0 commit 982d7b5

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/nuxt.ts

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
import defu from 'defu'
1+
import * as defu from 'defu'
22
import type { PluginOptions } from './types'
33
import unplugin from '.'
44

55
function scriptSetupModule(this: any, inlineOptions: PluginOptions = {}) {
6-
const options = defu(inlineOptions, this.nuxt.options.scriptSetup)
6+
// FIXME: defu cjs types should changed
7+
const options = (defu.default || defu)(inlineOptions, this.nuxt.options.scriptSetup)
78

89
// install webpack plugin
910
this.extendBuild((config: any) => {
@@ -19,6 +20,3 @@ function scriptSetupModule(this: any, inlineOptions: PluginOptions = {}) {
1920
}
2021

2122
export default scriptSetupModule
22-
module.exports = scriptSetupModule
23-
module.exports.default = scriptSetupModule
24-
Object.defineProperty(module.exports, '__esModule', { value: true })

0 commit comments

Comments
 (0)