We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
astro add
astro.config.mjs
1 parent 0abd1d3 commit cd84699Copy full SHA for cd84699
2 files changed
.changeset/lovely-elephants-peel.md
@@ -0,0 +1,5 @@
1
+---
2
+'astro': patch
3
4
+
5
+Remove redundant comments when `astro add` update `astro.config.mjs`
packages/astro/src/core/add/index.ts
@@ -507,7 +507,7 @@ async function updateAstroConfig({
507
let output = await generate(ast);
508
const comment = '// https://astro.build/config';
509
const defaultExport = 'export default defineConfig';
510
- output = output.replace(` ${comment}`, '');
+ output = output.replace(`\n${comment}`, '');
511
output = output.replace(`${defaultExport}`, `\n${comment}\n${defaultExport}`);
512
513
if (input === output) {
0 commit comments