Remove redundant comments when astro add
update astro.config.mjs
(#6412)
* Remove redundant comments when update * add \n --------- Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
This commit is contained in:
parent
0abd1d3e42
commit
cd8469947b
2 changed files with 6 additions and 1 deletions
5
.changeset/lovely-elephants-peel.md
Normal file
5
.changeset/lovely-elephants-peel.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
'astro': patch
|
||||
---
|
||||
|
||||
Remove redundant comments when `astro add` update `astro.config.mjs`
|
|
@ -507,7 +507,7 @@ async function updateAstroConfig({
|
|||
let output = await generate(ast);
|
||||
const comment = '// https://astro.build/config';
|
||||
const defaultExport = 'export default defineConfig';
|
||||
output = output.replace(` ${comment}`, '');
|
||||
output = output.replace(`\n${comment}`, '');
|
||||
output = output.replace(`${defaultExport}`, `\n${comment}\n${defaultExport}`);
|
||||
|
||||
if (input === output) {
|
||||
|
|
Loading…
Reference in a new issue