File tree Expand file tree Collapse file tree 5 files changed +143
-480
lines changed
playgrounds/module-starter Expand file tree Collapse file tree 5 files changed +143
-480
lines changed Original file line number Diff line number Diff line change 27
27
"@antfu/ni" : " ^0.21.12" ,
28
28
"@nuxt/devtools" : " workspace:*" ,
29
29
"@nuxt/devtools-ui-kit" : " workspace:*" ,
30
- "@nuxt/module-builder" : " ^0.8 .0" ,
30
+ "@nuxt/module-builder" : " ~0.6 .0" ,
31
31
"@nuxt/schema" : " ^3.12.2" ,
32
32
"@types/markdown-it" : " ^14.1.1" ,
33
33
"@types/node" : " ^20.14.7" ,
Original file line number Diff line number Diff line change
1
+ import { fileURLToPath } from 'node:url'
1
2
import { defineBuildConfig } from 'unbuild'
2
3
3
4
export default defineBuildConfig ( {
@@ -22,4 +23,32 @@ export default defineBuildConfig({
22
23
rollup : {
23
24
inlineDependencies : true ,
24
25
} ,
26
+ hooks : {
27
+ // Patch @nuxt /module-builder@0.6.0 not adding .mjs extension for runtime files
28
+ // https://github.com/nuxt/module-builder/issues/261
29
+ 'rollup:options' : ( _ , options ) => {
30
+ options . plugins ||= [ ]
31
+ if ( ! Array . isArray ( options . plugins ) )
32
+ options . plugins = [ options . plugins ]
33
+
34
+ const runtimeDir = fileURLToPath ( new URL ( './src/runtime' , import . meta. url ) )
35
+ options . plugins . unshift ( {
36
+ name : 'unbuild:runtime-build:patch' ,
37
+ async resolveId ( id , importter ) {
38
+ if ( ! id . includes ( 'runtime' ) )
39
+ return
40
+ const resolved = await this . resolve ( id , importter , { skipSelf : true } )
41
+ if ( resolved ?. id . startsWith ( runtimeDir ) ) {
42
+ let id = resolved . id
43
+ if ( ! id . endsWith ( '.mjs' ) )
44
+ id += '.mjs'
45
+ return {
46
+ external : true ,
47
+ id,
48
+ }
49
+ }
50
+ } ,
51
+ } )
52
+ } ,
53
+ } ,
25
54
} )
Original file line number Diff line number Diff line change 46
46
"@nuxt/devtools-kit" : " workspace:*" ,
47
47
"@nuxt/devtools-wizard" : " workspace:*" ,
48
48
"@nuxt/kit" : " ^3.12.2" ,
49
- "@vue/devtools-applet" : " 7.1.3" ,
50
- "@vue/devtools-core" : " 7.1.3" ,
51
- "@vue/devtools-kit" : " 7.1.3" ,
52
49
"birpc" : " ^0.2.17" ,
53
50
"consola" : " ^3.2.3" ,
54
51
"cronstrue" : " ^2.50.0" ,
99
96
"@unocss/preset-uno" : " ^0.61.0" ,
100
97
"@unocss/runtime" : " ^0.61.0" ,
101
98
"@vitest/ui" : " ^1.6.0" ,
99
+ "@vue/devtools-applet" : " 7.1.3" ,
100
+ "@vue/devtools-core" : " 7.1.3" ,
101
+ "@vue/devtools-kit" : " 7.1.3" ,
102
102
"@vueuse/nuxt" : " ^10.11.0" ,
103
103
"esno" : " ^4.7.0" ,
104
104
"floating-vue" : " 5.0.2" ,
Original file line number Diff line number Diff line change 30
30
"@iconify-json/carbon" : " ^1.1.36" ,
31
31
"@nuxt/devtools" : " workspace:*" ,
32
32
"@nuxt/devtools-ui-kit" : " workspace:*" ,
33
- "@nuxt/module-builder" : " ^0.8 .0" ,
33
+ "@nuxt/module-builder" : " ~0.6 .0" ,
34
34
"@nuxt/schema" : " ^3.12.2" ,
35
35
"@nuxt/test-utils" : " ^3.13.1" ,
36
36
"eslint" : " ^9.5.0" ,
You can’t perform that action at this time.
0 commit comments