Skip to content

Commit b54746e

Browse files
authored
feat(content): add spaLoadingTemplate to content resolution (#907)
1 parent 910bf1c commit b54746e

4 files changed

Lines changed: 6 additions & 2 deletions

File tree

docs/content/2.tailwind/1.config.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ When you install the module, the default Tailwind configuration for your project
2020
"{srcDir}/utils/**/*.{js,ts,mjs}",
2121
"{srcDir}/{A,a}pp.{vue,js,jsx,mjs,ts,tsx}",
2222
"{srcDir}/{E,e}rror.{vue,js,jsx,mjs,ts,tsx}",
23-
"{srcDir}/app.config.{js,ts,mjs}"
23+
"{srcDir}/app.config.{js,ts,mjs}",
24+
"{srcDir}/app/spa-loading-template.html"
2425
],
2526
"plugins": []
2627
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<div class="bg-orange-700">hello</div>

playground/nuxt.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ const logger = consola.withTag('nuxt:tailwindcss:playground')
1111

1212
export default defineNuxtConfig({
1313
extends: ['./theme'],
14+
// ssr: false,
1415

1516
// builder: 'webpack',
1617
modules: [

src/resolvers.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ const resolveContentPaths = (srcDir: string, nuxtOptions = useNuxt().options) =>
5353
r(`{A,a}pp${sfcExtensions}`),
5454
r(`{E,e}rror${sfcExtensions}`),
5555
r(`app.config${defaultExtensions}`),
56-
].filter(Boolean)
56+
!nuxtOptions.ssr && nuxtOptions.spaLoadingTemplate !== false && r(typeof nuxtOptions.spaLoadingTemplate === 'string' ? nuxtOptions.spaLoadingTemplate : 'app/spa-loading-template.html'),
57+
].filter((p): p is string => Boolean(p))
5758
}
5859

5960
/**

0 commit comments

Comments
 (0)