diff options
author | 2022-04-22 15:01:16 -0400 | |
---|---|---|
committer | 2022-04-22 15:01:16 -0400 | |
commit | eda4979997aa01aaee4dd9f57b0dac24183209d9 (patch) | |
tree | e92ea697b6c05b5d36a63e6dc94d40a438735197 /packages/create-astro/src | |
parent | 7ccda57c1d34529446bff99131ded899f1b678ab (diff) | |
download | astro-eda4979997aa01aaee4dd9f57b0dac24183209d9.tar.gz astro-eda4979997aa01aaee4dd9f57b0dac24183209d9.tar.zst astro-eda4979997aa01aaee4dd9f57b0dac24183209d9.zip |
feat: remove online editor configs (#3175)
Diffstat (limited to 'packages/create-astro/src')
-rw-r--r-- | packages/create-astro/src/index.ts | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/packages/create-astro/src/index.ts b/packages/create-astro/src/index.ts index 2286c13f5..9c102c37e 100644 --- a/packages/create-astro/src/index.ts +++ b/packages/create-astro/src/index.ts @@ -36,6 +36,7 @@ const { version } = JSON.parse( fs.readFileSync(new URL('../package.json', import.meta.url), 'utf-8') ); +const FILES_TO_REMOVE = ['.stackblitzrc', 'sandbox.config.json']; // some files are only needed for online editors when using astro.new. Remove for create-astro installs. const POSTPROCESS_FILES = ['package.json', 'astro.config.mjs', 'CHANGELOG.md']; // some files need processing after copying. export async function main() { @@ -179,8 +180,12 @@ export async function main() { } // Post-process in parallel - await Promise.all( - POSTPROCESS_FILES.map(async (file) => { + await Promise.all([ + ...FILES_TO_REMOVE.map(async (file) => { + const fileLoc = path.resolve(path.join(cwd, file)); + return fs.promises.rm(fileLoc); + }), + ...POSTPROCESS_FILES.map(async (file) => { const fileLoc = path.resolve(path.join(cwd, file)); switch (file) { @@ -232,8 +237,8 @@ export async function main() { break; } } - }) - ); + }), + ]); // Inject framework components into starter template if (selectedTemplate?.value === 'starter') { |