From 7ed3467440b701f4960354afc647a88e9560f59f Mon Sep 17 00:00:00 2001 From: Thorn Walli Date: Thu, 14 Dec 2023 15:44:56 +0100 Subject: [PATCH] fix(module): fix missing mjs files --- nuxt-speedkit.code-workspace | 2 +- src/module.js | 10 +++++----- src/runtime/tmpl/{entry.js => entry.mjs} | 0 src/runtime/tmpl/{plugin.js => plugin.mjs} | 0 4 files changed, 6 insertions(+), 6 deletions(-) rename src/runtime/tmpl/{entry.js => entry.mjs} (100%) rename src/runtime/tmpl/{plugin.js => plugin.mjs} (100%) diff --git a/nuxt-speedkit.code-workspace b/nuxt-speedkit.code-workspace index c787d033c0..c2aaa1c47a 100644 --- a/nuxt-speedkit.code-workspace +++ b/nuxt-speedkit.code-workspace @@ -14,7 +14,7 @@ "editor.minimap.showSlider": "always", "editor.smoothScrolling": true, "editor.codeActionsOnSave": { - "source.fixAll": true + "source.fixAll": "explicit" }, "eslint.validate": [ "javascript", diff --git a/src/module.js b/src/module.js index dab8350f67..a9951b35e9 100644 --- a/src/module.js +++ b/src/module.js @@ -55,14 +55,14 @@ export default defineNuxtModule({ nuxt.hook( 'webpack:config', registerAppEntryWebpack( - resolve(nuxt.options.buildDir, MODULE_NAME, 'entry.js') + resolve(nuxt.options.buildDir, MODULE_NAME, 'entry.mjs') ) ); } else { nuxt.hook( 'vite:extend', registerAppEntryVite( - resolve(nuxt.options.buildDir, MODULE_NAME, 'entry.js') + resolve(nuxt.options.buildDir, MODULE_NAME, 'entry.mjs') ) ); } @@ -111,7 +111,7 @@ async function addBuildTemplates(nuxt, options) { ['client', 'server'].forEach(mode => { addPluginTemplate({ - src: resolver.resolve('runtime/tmpl', 'plugin.js'), + src: resolver.resolve('runtime/tmpl', 'plugin.mjs'), fileName: MODULE_NAME + `/plugin.${mode}.js`, write: true, mode, @@ -127,8 +127,8 @@ async function addBuildTemplates(nuxt, options) { }); addTemplate({ - src: resolver.resolve('runtime/tmpl', 'entry.js'), - fileName: MODULE_NAME + '/entry.js', + src: resolver.resolve('runtime/tmpl', 'entry.mjs'), + fileName: MODULE_NAME + '/entry.mjs', write: true, options: { webpack: isWebpackBuild(nuxt), diff --git a/src/runtime/tmpl/entry.js b/src/runtime/tmpl/entry.mjs similarity index 100% rename from src/runtime/tmpl/entry.js rename to src/runtime/tmpl/entry.mjs diff --git a/src/runtime/tmpl/plugin.js b/src/runtime/tmpl/plugin.mjs similarity index 100% rename from src/runtime/tmpl/plugin.js rename to src/runtime/tmpl/plugin.mjs