diff --git a/packages/react-scripts/config/webpack.config.dev.js b/packages/react-scripts/config/webpack.config.dev.js index 67ba6f122a3..6c1c19743cb 100644 --- a/packages/react-scripts/config/webpack.config.dev.js +++ b/packages/react-scripts/config/webpack.config.dev.js @@ -29,6 +29,10 @@ var publicPath = '/'; var publicUrl = ''; // Get enrivonment variables to inject into our app. var env = getClientEnvironment(publicUrl); +var babelPresets = process.env.BABEL_PRESETS || '[]'; +babelPresets = JSON.parse(babelPresets); +var babelPlugins = process.env.BABEL_PLUGINS || '[]'; +babelPlugins = JSON.parse(babelPlugins); // This is the development configuration. // It is focused on developer experience and fast rebuilds. @@ -119,7 +123,8 @@ module.exports = { query: { // @remove-on-eject-begin babelrc: false, - presets: [require.resolve('babel-preset-react-app')], + presets: [require.resolve('babel-preset-react-app')].concat(babelPresets), + plugins: babelPlugins, // @remove-on-eject-end // This is a feature of `babel-loader` for webpack (not Babel itself). // It enables caching results in ./node_modules/.cache/react-scripts/ diff --git a/packages/react-scripts/config/webpack.config.prod.js b/packages/react-scripts/config/webpack.config.prod.js index 6549b4d8d1d..00fac976b56 100644 --- a/packages/react-scripts/config/webpack.config.prod.js +++ b/packages/react-scripts/config/webpack.config.prod.js @@ -46,6 +46,10 @@ var publicPath = ensureSlash(homepagePathname, true); var publicUrl = ensureSlash(homepagePathname, false); // Get enrivonment variables to inject into our app. var env = getClientEnvironment(publicUrl); +var babelPresets = process.env.BABEL_PRESETS || '[]'; +babelPresets = JSON.parse(babelPresets); +var babelPlugins = process.env.BABEL_PLUGINS || '[]'; +babelPlugins = JSON.parse(babelPlugins); // Assert this just to be safe. // Development builds of React are slow and not intended for production. @@ -123,7 +127,8 @@ module.exports = { // @remove-on-eject-begin query: { babelrc: false, - presets: [require.resolve('babel-preset-react-app')], + presets: [require.resolve('babel-preset-react-app')].concat(babelPresets), + plugins: babelPlugins }, // @remove-on-eject-end }, diff --git a/packages/react-scripts/package.json b/packages/react-scripts/package.json index 4ce1b4d4196..0e1571db96f 100644 --- a/packages/react-scripts/package.json +++ b/packages/react-scripts/package.json @@ -1,14 +1,14 @@ { - "name": "react-scripts", + "name": "@philiptzou/react-scripts", "version": "0.6.1", - "description": "Configuration and scripts for Create React App.", - "repository": "facebookincubator/create-react-app", + "description": "Configuration and scripts for Create React App. Customized by Stanford HIVDB team.", + "repository": "philiptzou/create-react-app", "license": "BSD-3-Clause", "engines": { "node": ">=4" }, "bugs": { - "url": "https://github.com/facebookincubator/create-react-app/issues" + "url": "https://github.com/philiptzou/create-react-app/issues" }, "files": [ ".babelrc",