Repository: withastro/astro
File: packages/astro/src/core/dev/restart.ts (TypeScript)

Code before:
			shouldRestart = settings.preferences.ignoreNextPreferenceReload ? false : true;

			settings.preferences.ignoreNextPreferenceReload = false;
		}
	}

	if (!shouldRestart && settings.watchFiles.length > 0) {
		// If the config file didn't change, check if any of the watched files changed.
		shouldRestart = settings.watchFiles.some(
			(path) => vite.normalizePath(path) === vite.normalizePath(changedFile),
		);
	}

	return shouldRestart;
}

async function restartContainer(container: Container): Promise<Container | Error> {
	const { logger, close, settings: existingSettings } = container;
	container.restartInFlight = true;

	try {
		const { astroConfig } = await resolveConfig(container.inlineConfig, 'dev', container.fs);
		if (astroConfig.experimental.csp) {
			logger.info(
				'config',
				"Be aware that due to the nature of the development server, CSP won't work as expected. To see the final results, you have to build the project and run the preview server.",
			);
		}
		const settings = await createSettings(astroConfig, fileURLToPath(existingSettings.config.root));
		await close();
		return await createRestartedContainer(container, settings);
	} catch (_err) {
		const error = createSafeError(_err);
		// Print all error messages except ZodErrors from AstroConfig as the pre-logged error is sufficient
		if (!isAstroConfigZodError(_err)) {
			logger.error(
				'config',
				formatErrorMessage(collectErrorMetadata(error), logger.level() === 'debug') + '\n',
			);
		}
		// Inform connected clients of the config error
		container.viteServer.hot.send({
			type: 'error',
			err: {
				message: error.message,
				stack: error.stack || '',
			},
		});
		container.restartInFlight = false;
		logger.error(null, 'Continuing with previous valid configuration\n');
		return error;

Review comment (security):
```suggestion
				"Astro's Content Security Policy (CSP) does not work in development mode. To verify your CSP implementation, build the project and run the preview server.",
```
what about something like this? Probably simpler to just say "doesn't work." 



Code after:
			shouldRestart = settings.preferences.ignoreNextPreferenceReload ? false : true;

			settings.preferences.ignoreNextPreferenceReload = false;
		}
	}

	if (!shouldRestart && settings.watchFiles.length > 0) {
		// If the config file didn't change, check if any of the watched files changed.
		shouldRestart = settings.watchFiles.some(
			(path) => vite.normalizePath(path) === vite.normalizePath(changedFile),
		);
	}

	return shouldRestart;
}

async function restartContainer(container: Container): Promise<Container | Error> {
	const { logger, close, settings: existingSettings } = container;
	container.restartInFlight = true;

	try {
		const { astroConfig } = await resolveConfig(container.inlineConfig, 'dev', container.fs);
		if (astroConfig.experimental.csp) {
			logger.warn(
				'config',
				"Astro's Content Security Policy (CSP) does not work in development mode. To verify your CSP implementation, build the project and run the preview server.",
			);
		}
		const settings = await createSettings(astroConfig, fileURLToPath(existingSettings.config.root));
		await close();
		return await createRestartedContainer(container, settings);
	} catch (_err) {
		const error = createSafeError(_err);
		// Print all error messages except ZodErrors from AstroConfig as the pre-logged error is sufficient
		if (!isAstroConfigZodError(_err)) {
			logger.error(
				'config',
				formatErrorMessage(collectErrorMetadata(error), logger.level() === 'debug') + '\n',
			);
		}
		// Inform connected clients of the config error
		container.viteServer.hot.send({
			type: 'error',
			err: {
				message: error.message,
				stack: error.stack || '',
			},
		});
		container.restartInFlight = false;
		logger.error(null, 'Continuing with previous valid configuration\n');
		return error;