From a30f5896ecf1e06cf852cac81e66f68ae7225f23 Mon Sep 17 00:00:00 2001 From: nikolasdas Date: Fri, 18 Oct 2024 14:53:20 +0200 Subject: [PATCH 1/3] add SPA loading template to content config --- docs/content/2.tailwind/1.config.md | 3 ++- src/resolvers.ts | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/content/2.tailwind/1.config.md b/docs/content/2.tailwind/1.config.md index 617cb344..0e741e80 100644 --- a/docs/content/2.tailwind/1.config.md +++ b/docs/content/2.tailwind/1.config.md @@ -20,7 +20,8 @@ When you install the module, the default Tailwind configuration for your project "{srcDir}/utils/**/*.{js,ts,mjs}", "{srcDir}/{A,a}pp.{vue,js,jsx,mjs,ts,tsx}", "{srcDir}/{E,e}rror.{vue,js,jsx,mjs,ts,tsx}", - "{srcDir}/app.config.{js,ts,mjs}" + "{srcDir}/app.config.{js,ts,mjs}", + "{srcDir}/spa-loading-template.html" ], "plugins": [] } diff --git a/src/resolvers.ts b/src/resolvers.ts index 0be060ef..be13f143 100644 --- a/src/resolvers.ts +++ b/src/resolvers.ts @@ -53,6 +53,7 @@ const resolveContentPaths = (srcDir: string, nuxtOptions = useNuxt().options) => r(`{A,a}pp${sfcExtensions}`), r(`{E,e}rror${sfcExtensions}`), r(`app.config${defaultExtensions}`), + r(`spa-loading-template.html`), ].filter(Boolean) } From 84ba701b5dc4e49e3554dc0918fbaf06c5c4b013 Mon Sep 17 00:00:00 2001 From: Inesh Bose Date: Tue, 22 Oct 2024 22:13:04 +0100 Subject: [PATCH 2/3] chore: up --- playground/app/spa-loading-template.html | 1 + playground/nuxt.config.ts | 1 + src/resolvers.ts | 4 ++-- 3 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 playground/app/spa-loading-template.html diff --git a/playground/app/spa-loading-template.html b/playground/app/spa-loading-template.html new file mode 100644 index 00000000..d790f88e --- /dev/null +++ b/playground/app/spa-loading-template.html @@ -0,0 +1 @@ +
hello
diff --git a/playground/nuxt.config.ts b/playground/nuxt.config.ts index ca443bfe..dbd768bb 100644 --- a/playground/nuxt.config.ts +++ b/playground/nuxt.config.ts @@ -11,6 +11,7 @@ const logger = consola.withTag('nuxt:tailwindcss:playground') export default defineNuxtConfig({ extends: ['./theme'], + // ssr: false, // builder: 'webpack', modules: [ diff --git a/src/resolvers.ts b/src/resolvers.ts index be13f143..1bb7d0dd 100644 --- a/src/resolvers.ts +++ b/src/resolvers.ts @@ -53,8 +53,8 @@ const resolveContentPaths = (srcDir: string, nuxtOptions = useNuxt().options) => r(`{A,a}pp${sfcExtensions}`), r(`{E,e}rror${sfcExtensions}`), r(`app.config${defaultExtensions}`), - r(`spa-loading-template.html`), - ].filter(Boolean) + !nuxtOptions.ssr && nuxtOptions.spaLoadingTemplate !== false && r(typeof nuxtOptions.spaLoadingTemplate === 'string' ? nuxtOptions.spaLoadingTemplate : 'app/spa-loading-template.html'), + ].filter((p): p is string => Boolean(p)) } /** From 609ed139150a8abe5386ccfc496062b4ebb04957 Mon Sep 17 00:00:00 2001 From: Inesh Bose Date: Mon, 28 Oct 2024 17:52:40 +0000 Subject: [PATCH 3/3] Update docs/content/2.tailwind/1.config.md --- docs/content/2.tailwind/1.config.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/2.tailwind/1.config.md b/docs/content/2.tailwind/1.config.md index 0e741e80..9558e1ed 100644 --- a/docs/content/2.tailwind/1.config.md +++ b/docs/content/2.tailwind/1.config.md @@ -21,7 +21,7 @@ When you install the module, the default Tailwind configuration for your project "{srcDir}/{A,a}pp.{vue,js,jsx,mjs,ts,tsx}", "{srcDir}/{E,e}rror.{vue,js,jsx,mjs,ts,tsx}", "{srcDir}/app.config.{js,ts,mjs}", - "{srcDir}/spa-loading-template.html" + "{srcDir}/app/spa-loading-template.html" ], "plugins": [] }