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 2727 "@antfu/ni" : " ^0.21.12" ,
2828 "@nuxt/devtools" : " workspace:*" ,
2929 "@nuxt/devtools-ui-kit" : " workspace:*" ,
30- "@nuxt/module-builder" : " ^0.8 .0" ,
30+ "@nuxt/module-builder" : " ~0.6 .0" ,
3131 "@nuxt/schema" : " ^3.12.2" ,
3232 "@types/markdown-it" : " ^14.1.1" ,
3333 "@types/node" : " ^20.14.7" ,
Original file line number Diff line number Diff line change 1+ import { fileURLToPath } from 'node:url'
12import { defineBuildConfig } from 'unbuild'
23
34export default defineBuildConfig ( {
@@ -22,4 +23,32 @@ export default defineBuildConfig({
2223 rollup : {
2324 inlineDependencies : true ,
2425 } ,
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+ } ,
2554} )
Original file line number Diff line number Diff line change 4646 "@nuxt/devtools-kit" : " workspace:*" ,
4747 "@nuxt/devtools-wizard" : " workspace:*" ,
4848 "@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" ,
5249 "birpc" : " ^0.2.17" ,
5350 "consola" : " ^3.2.3" ,
5451 "cronstrue" : " ^2.50.0" ,
9996 "@unocss/preset-uno" : " ^0.61.0" ,
10097 "@unocss/runtime" : " ^0.61.0" ,
10198 "@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" ,
102102 "@vueuse/nuxt" : " ^10.11.0" ,
103103 "esno" : " ^4.7.0" ,
104104 "floating-vue" : " 5.0.2" ,
Original file line number Diff line number Diff line change 3030 "@iconify-json/carbon" : " ^1.1.36" ,
3131 "@nuxt/devtools" : " workspace:*" ,
3232 "@nuxt/devtools-ui-kit" : " workspace:*" ,
33- "@nuxt/module-builder" : " ^0.8 .0" ,
33+ "@nuxt/module-builder" : " ~0.6 .0" ,
3434 "@nuxt/schema" : " ^3.12.2" ,
3535 "@nuxt/test-utils" : " ^3.13.1" ,
3636 "eslint" : " ^9.5.0" ,
You can’t perform that action at this time.
0 commit comments