summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.changeset/kind-cameras-type.md5
-rw-r--r--packages/astro/src/content/server-listeners.ts5
2 files changed, 7 insertions, 3 deletions
diff --git a/.changeset/kind-cameras-type.md b/.changeset/kind-cameras-type.md
new file mode 100644
index 000000000..7b4621cd3
--- /dev/null
+++ b/.changeset/kind-cameras-type.md
@@ -0,0 +1,5 @@
+---
+'astro': patch
+---
+
+Warn about setting the `allowJs` compiler option only when the `content` directory exists. \ No newline at end of file
diff --git a/packages/astro/src/content/server-listeners.ts b/packages/astro/src/content/server-listeners.ts
index 4631aa2bd..52efc0331 100644
--- a/packages/astro/src/content/server-listeners.ts
+++ b/packages/astro/src/content/server-listeners.ts
@@ -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);