mirror of
https://github.com/withastro/astro.git
synced 2024-12-16 21:46:22 -05:00
fix(content-collections): warn about allowJs
only when content
directory exists (#6293)
* warn only when `content` directory exists * chore: changeset
This commit is contained in:
parent
a8577278e0
commit
a156ecbb7f
2 changed files with 7 additions and 3 deletions
5
.changeset/kind-cameras-type.md
Normal file
5
.changeset/kind-cameras-type.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
'astro': patch
|
||||
---
|
||||
|
||||
Warn about setting the `allowJs` compiler option only when the `content` directory exists.
|
|
@ -25,9 +25,6 @@ export async function attachContentServerListeners({
|
|||
}: ContentServerListenerParams) {
|
||||
const contentPaths = getContentPaths(settings.config, fs);
|
||||
|
||||
const maybeTsConfigStats = getTSConfigStatsWhenAllowJsFalse({ contentPaths, settings });
|
||||
if (maybeTsConfigStats) warnAllowJsIsFalse({ ...maybeTsConfigStats, logging });
|
||||
|
||||
if (fs.existsSync(contentPaths.contentDir)) {
|
||||
info(
|
||||
logging,
|
||||
|
@ -36,6 +33,8 @@ export async function attachContentServerListeners({
|
|||
contentPaths.contentDir.href.replace(settings.config.root.href, '')
|
||||
)} for changes`
|
||||
);
|
||||
const maybeTsConfigStats = getTSConfigStatsWhenAllowJsFalse({ contentPaths, settings });
|
||||
if (maybeTsConfigStats) warnAllowJsIsFalse({ ...maybeTsConfigStats, logging });
|
||||
await attachListeners();
|
||||
} else {
|
||||
viteServer.watcher.on('addDir', contentDirListener);
|
||||
|
|
Loading…
Reference in a new issue