From 352cb797b1b029dce4750d7673f52e7274e56429 Mon Sep 17 00:00:00 2001 From: Mika Andrianarijaona Date: Tue, 8 Oct 2019 00:23:52 +0200 Subject: [PATCH] fix(boilerplate): replace .babelrc with babel.config.js - fixes #249 (#264 by @mikaoelitiana) --- boilerplate.js | 3 ++- boilerplate/.babelrc | 15 --------------- boilerplate/babel.config.js | 15 +++++++++++++++ 3 files changed, 17 insertions(+), 16 deletions(-) delete mode 100644 boilerplate/.babelrc create mode 100644 boilerplate/babel.config.js diff --git a/boilerplate.js b/boilerplate.js index def58fcc..b74517ba 100644 --- a/boilerplate.js +++ b/boilerplate.js @@ -87,6 +87,7 @@ async function install(context) { // remove the __tests__ directory, App.js, and unnecessary config files that come with React Native const filesToRemove = [ ".babelrc", + "babel.config.js", ".buckconfig", ".eslintrc.js", ".prettierrc.js", @@ -131,7 +132,7 @@ async function install(context) { { template: ".env.example", target: ".env" }, { template: ".prettierignore", target: ".prettierignore" }, { template: ".solidarity", target: ".solidarity" }, - { template: ".babelrc", target: ".babelrc" }, + { template: "babel.config.js", target: "babel.config.js" }, { template: "react-native.config.js", target: "react-native.config.js" }, { template: "tsconfig.json", target: "tsconfig.json" }, { template: "app/app.tsx.ejs", target: "app/app.tsx" }, diff --git a/boilerplate/.babelrc b/boilerplate/.babelrc deleted file mode 100644 index a9e56b24..00000000 --- a/boilerplate/.babelrc +++ /dev/null @@ -1,15 +0,0 @@ -{ - "presets": ["module:metro-react-native-babel-preset", "module:react-native-dotenv"], - "env": { - "production": {} - }, - "plugins": [ - [ - "@babel/plugin-proposal-decorators", - { - "legacy": true - } - ], - ["@babel/plugin-proposal-optional-catch-binding"] - ] -} diff --git a/boilerplate/babel.config.js b/boilerplate/babel.config.js new file mode 100644 index 00000000..d1fbc455 --- /dev/null +++ b/boilerplate/babel.config.js @@ -0,0 +1,15 @@ +module.exports = { + presets: ["module:metro-react-native-babel-preset", "module:react-native-dotenv"], + env: { + production: {} + }, + plugins: [ + [ + "@babel/plugin-proposal-decorators", + { + legacy: true + } + ], + ["@babel/plugin-proposal-optional-catch-binding"] + ] +}