From a205139d1deaa36089e0c684661e39ab2a6559c6 Mon Sep 17 00:00:00 2001 From: Thorn Walli Date: Tue, 12 Sep 2023 09:56:00 +0200 Subject: [PATCH] fix(module): remove unnecessary templates --- src/module.mjs | 28 +++++++++------------------- src/runtime/tmpl/fontConfig.mjs | 1 - src/runtime/tmpl/fonts.css | 1 - src/runtime/tmpl/fonts.mjs | 1 - 4 files changed, 9 insertions(+), 22 deletions(-) delete mode 100644 src/runtime/tmpl/fontConfig.mjs delete mode 100644 src/runtime/tmpl/fonts.css delete mode 100644 src/runtime/tmpl/fonts.mjs diff --git a/src/module.mjs b/src/module.mjs index 26ad02f5c3..843e7cde56 100644 --- a/src/module.mjs +++ b/src/module.mjs @@ -107,24 +107,21 @@ async function addBuildTemplates(nuxt, options) { }); addTemplate({ - src: resolver.resolve('runtime/tmpl', 'fontConfig.mjs'), - fileName: MODULE_NAME + '/fontConfig.mjs', - write: true, - options: { content: getFontConfigTemplate(fontConfig) } + filename: MODULE_NAME + '/fontConfig.mjs', + getContents: () => getFontConfigTemplate(fontConfig), + write: true }); addTemplate({ - src: resolver.resolve('runtime/tmpl', 'fonts.mjs'), - fileName: MODULE_NAME + '/fonts.mjs', - write: true, - options: { content: getFontConfigCSSTemplate(fontConfig) } + filename: MODULE_NAME + '/fonts.mjs', + getContents: () => getFontConfigCSSTemplate(fontConfig), + write: true }); addTemplate({ - src: resolver.resolve('runtime/tmpl', 'fonts.css'), - fileName: MODULE_NAME + '/fonts.css', - write: true, - options: { content: fontConfig.toCSS() } + filename: MODULE_NAME + '/fonts.css', + getContents: () => fontConfig.toCSS(), + write: true }); ['client', 'server'].forEach(mode => { @@ -159,13 +156,6 @@ async function addBuildTemplates(nuxt, options) { supportedBrowserDetector } }); - - addTemplate({ - src: resolver.resolve('runtime/tmpl', 'fonts.css'), - fileName: MODULE_NAME + '/fonts.css', - write: true, - options: { content: fontConfig.toCSS() } - }); } async function addModules(nuxt, moduleOptions) { diff --git a/src/runtime/tmpl/fontConfig.mjs b/src/runtime/tmpl/fontConfig.mjs deleted file mode 100644 index ba6b8a65ec..0000000000 --- a/src/runtime/tmpl/fontConfig.mjs +++ /dev/null @@ -1 +0,0 @@ -<%= options.content %> diff --git a/src/runtime/tmpl/fonts.css b/src/runtime/tmpl/fonts.css deleted file mode 100644 index ba6b8a65ec..0000000000 --- a/src/runtime/tmpl/fonts.css +++ /dev/null @@ -1 +0,0 @@ -<%= options.content %> diff --git a/src/runtime/tmpl/fonts.mjs b/src/runtime/tmpl/fonts.mjs deleted file mode 100644 index ba6b8a65ec..0000000000 --- a/src/runtime/tmpl/fonts.mjs +++ /dev/null @@ -1 +0,0 @@ -<%= options.content %>