Skip to content

Commit c5a9a2d

Browse files
committed
Add base babel config removal step
1 parent 70e95c6 commit c5a9a2d

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

src/main/setup/setup.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { addGitAttributesStep } from "./steps/add-git-attributes"
99
import { addGithubWorkflowStep } from "./steps/add-github-workflow"
1010
import { addReadmeStep } from "./steps/add-readme/add-readme"
1111
import { addBaseBabelConfigStep } from "./steps/babel/add-base-babel-config"
12+
import { removeBaseBabelConfigStep } from "./steps/babel/remove-base-babel-config copy"
1213
import { copyAssetsStep } from "./steps/copy-assets"
1314
import { createNextAppStep } from "./steps/create-next-app"
1415
import { formatProjectStep } from "./steps/format-project"
@@ -72,6 +73,9 @@ export const performSetupSteps = async (
7273
addContentStep,
7374
addReadmeStep,
7475

76+
// Cleanup
77+
removeBaseBabelConfigStep,
78+
7579
// Format & initial commit
7680
formatProjectStep,
7781
gitCommitStep,
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { promises as fs } from "fs"
2+
import { remove } from "../../../helpers/remove"
3+
import { Step } from "../../step"
4+
import { baseBabelConfigString } from "./add-base-babel-config"
5+
6+
export const removeBaseBabelConfigStep: Step = {
7+
description: "removing default Babel configuration",
8+
9+
shouldRun: async () => {
10+
const babelConfig = await fs.readFile(".babelrc")
11+
return babelConfig.toString() === baseBabelConfigString
12+
},
13+
14+
didRun: false,
15+
16+
run: async () => {
17+
await remove(".babelrc")
18+
},
19+
}

0 commit comments

Comments
 (0)