feat: remove online editor configs (#3175)
This commit is contained in:
parent
7ccda57c1d
commit
eda4979997
1 changed files with 9 additions and 4 deletions
|
@ -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') {
|
||||
|
|
Loading…
Reference in a new issue