File tree 2 files changed +4
-5
lines changed 2 files changed +4
-5
lines changed Original file line number Diff line number Diff line change 23
23
"." : {
24
24
"import" : " ./dist/module.mjs" ,
25
25
"require" : " ./dist/module.cjs"
26
- },
27
- "./lodash" : {
28
- "import" : " ./dist/runtime/lodash.mjs"
29
26
}
30
27
},
31
28
"main" : " ./dist/module.cjs" ,
Original file line number Diff line number Diff line change 1
- import { addImports , defineNuxtModule } from '@nuxt/kit'
1
+ import { addImports , createResolver , defineNuxtModule } from '@nuxt/kit'
2
2
import * as lodash from 'lodash-es'
3
3
import excludeDefaults from './exclude'
4
4
@@ -57,6 +57,8 @@ export default defineNuxtModule<ModuleOptions>({
57
57
upperAfterPrefix : true
58
58
} ,
59
59
setup ( options , nuxt ) {
60
+ const { resolve } = createResolver ( import . meta. url )
61
+
60
62
const aliasMap = new Map < string , string > ( options . alias )
61
63
const excludes = [ ...options . exclude , ...excludeDefaults ]
62
64
const prefixSkip = options . prefixSkip ? lodash . isArray ( options . prefixSkip ) ? options . prefixSkip : [ options . prefixSkip ] : [ ]
@@ -66,7 +68,7 @@ export default defineNuxtModule<ModuleOptions>({
66
68
const alias = aliasMap . has ( name ) ? aliasMap . get ( name ) ! : name
67
69
const prefix = ( ! prefixSkip . some ( key => alias . startsWith ( key ) ) && options . prefix ) || ''
68
70
const as = prefix ? prefix + ( options . upperAfterPrefix ? lodash . upperFirst ( alias ) : alias ) : alias
69
- addImports ( { name, as, from : 'nuxt-lodash/ lodash' } )
71
+ addImports ( { name, as, from : resolve ( './runtime/ lodash') } )
70
72
}
71
73
}
72
74
}
You can’t perform that action at this time.
0 commit comments