Permalink
Browse files

Fix babel-preset regression

  • Loading branch information...
tannerlinsley committed Dec 21, 2018
1 parent bf18831 commit aa3bed04fdbc48b7834448c98c2d7543b1f8535b
Showing with 109 additions and 167 deletions.
  1. +1 βˆ’1 archives/old-examples/apollo-redux/.babelrc
  2. +1 βˆ’1 archives/old-examples/apollo/.babelrc
  3. +1 βˆ’1 archives/old-examples/basic-prismic/.babelrc
  4. +1 βˆ’1 archives/old-examples/contentful/.babelrc
  5. +1 βˆ’1 archives/old-examples/custom-routing/.babelrc
  6. +1 βˆ’1 archives/old-examples/documentation/.babelrc
  7. +1 βˆ’1 archives/old-examples/dynamic-imports/.babelrc
  8. +1 βˆ’1 archives/old-examples/firebase-auth/.babelrc
  9. +1 βˆ’1 archives/old-examples/gentics-mesh/.babelrc
  10. +1 βˆ’1 archives/old-examples/graphql-request/.babelrc
  11. +1 βˆ’1 archives/old-examples/less-antdesign/.babelrc
  12. +1 βˆ’1 archives/old-examples/markdown/.babelrc
  13. +1 βˆ’1 archives/old-examples/material-ui/.babelrc
  14. +1 βˆ’1 archives/old-examples/netlifycms/.babelrc
  15. +1 βˆ’1 archives/old-examples/non-static-routing/.babelrc
  16. +1 βˆ’1 archives/old-examples/on-the-fly-routing/.babelrc
  17. +1 βˆ’1 archives/old-examples/pagination/.babelrc
  18. +1 βˆ’1 archives/old-examples/preact/.babelrc
  19. +1 βˆ’1 archives/old-examples/previous-next-navigation/.babelrc
  20. +1 βˆ’1 archives/old-examples/redux/.babelrc
  21. +1 βˆ’1 archives/old-examples/sass/.babelrc
  22. +1 βˆ’1 archives/old-examples/styled-components/.babelrc
  23. +1 βˆ’1 archives/old-examples/styled-jsx/.babelrc
  24. +1 βˆ’1 archives/old-examples/tailwindcss/.babelrc
  25. +1 βˆ’1 archives/old-examples/typescript/.babelrc
  26. +1 βˆ’1 packages/react-static/.babelrc
  27. +75 βˆ’0 packages/react-static/babel-preset.js
  28. +4 βˆ’75 packages/react-static/babelPreset.js
  29. +0 βˆ’1 packages/react-static/package.json
  30. +1 βˆ’1 packages/react-static/src/static/webpack/rules/jsLoader.js
  31. +1 βˆ’1 packages/react-static/src/static/webpack/rules/jsLoaderExternal.js
  32. +1 βˆ’1 packages/react-static/templates/basic/.babelrc
  33. +1 βˆ’1 packages/react-static/templates/blank/.babelrc
  34. +0 βˆ’61 yarn.lock
@@ -1,3 +1,3 @@
{
"presets": ["react-static/babelPreset.js"]
"presets": ["react-static/babel-preset.js"]
}
@@ -1,3 +1,3 @@
{
"presets": ["react-static/babelPreset.js"]
"presets": ["react-static/babel-preset.js"]
}
@@ -1,3 +1,3 @@
{
"presets": ["react-static/babelPreset.js"]
"presets": ["react-static/babel-preset.js"]
}
@@ -1,3 +1,3 @@
{
"presets": ["react-static/babelPreset.js"]
"presets": ["react-static/babel-preset.js"]
}
@@ -1,3 +1,3 @@
{
"presets": ["react-static/babelPreset.js"]
"presets": ["react-static/babel-preset.js"]
}
@@ -1,4 +1,4 @@
{
"presets": ["react-static/babelPreset.js"],
"presets": ["react-static/babel-preset.js"],
"plugins": ["babel-plugin-styled-components"]
}
@@ -1,3 +1,3 @@
{
"presets": ["react-static/babelPreset.js"]
"presets": ["react-static/babel-preset.js"]
}
@@ -1,3 +1,3 @@
{
"presets": ["react-static/babelPreset.js"]
"presets": ["react-static/babel-preset.js"]
}
@@ -1,3 +1,3 @@
{
"presets": ["react-static/babelPreset.js"]
"presets": ["react-static/babel-preset.js"]
}
@@ -1,3 +1,3 @@
{
"presets": ["react-static/babelPreset.js"]
"presets": ["react-static/babel-preset.js"]
}
@@ -1,5 +1,5 @@
{
"presets": ["react-static/babelPreset.js"],
"presets": ["react-static/babel-preset.js"],
"plugins": [
[
"import",
@@ -1,3 +1,3 @@
{
"presets": ["react-static/babelPreset.js"]
"presets": ["react-static/babel-preset.js"]
}
@@ -1,3 +1,3 @@
{
"presets": ["react-static/babelPreset.js"]
"presets": ["react-static/babel-preset.js"]
}
@@ -1,3 +1,3 @@
{
"presets": ["react-static/babelPreset.js"]
"presets": ["react-static/babel-preset.js"]
}
@@ -1,3 +1,3 @@
{
"presets": ["react-static/babelPreset.js"]
"presets": ["react-static/babel-preset.js"]
}
@@ -1,3 +1,3 @@
{
"presets": ["react-static/babelPreset.js"]
"presets": ["react-static/babel-preset.js"]
}
@@ -1,3 +1,3 @@
{
"presets": ["react-static/babelPreset.js"]
"presets": ["react-static/babel-preset.js"]
}
@@ -1,3 +1,3 @@
{
"presets": ["react-static/babelPreset.js"]
"presets": ["react-static/babel-preset.js"]
}
@@ -1,3 +1,3 @@
{
"presets": ["react-static/babelPreset.js"]
"presets": ["react-static/babel-preset.js"]
}
@@ -1,3 +1,3 @@
{
"presets": ["react-static/babelPreset.js"]
"presets": ["react-static/babel-preset.js"]
}
@@ -1,3 +1,3 @@
{
"presets": ["react-static/babelPreset.js"]
"presets": ["react-static/babel-preset.js"]
}
@@ -1,4 +1,4 @@
{
"presets": ["react-static/babelPreset.js"],
"presets": ["react-static/babel-preset.js"],
"plugins": ["babel-plugin-styled-components"]
}
@@ -1,4 +1,4 @@
{
"presets": ["react-static/babelPreset.js"],
"presets": ["react-static/babel-preset.js"],
"plugins": ["styled-jsx/babel"]
}
@@ -1,3 +1,3 @@
{
"presets": ["react-static/babelPreset.js"]
"presets": ["react-static/babel-preset.js"]
}
@@ -1,3 +1,3 @@
{
"presets": ["react-static/babelPreset.js"]
"presets": ["react-static/babel-preset.js"]
}
@@ -1,3 +1,3 @@
{
"presets": ["./babelPreset"]
"presets": ["./babel-preset"]
}
@@ -0,0 +1,75 @@
const r = require.resolve

module.exports = (api, { external, modules, helpers } = {}) => {
const { NODE_ENV, BABEL_ENV } = process.env

const PRODUCTION = (BABEL_ENV || NODE_ENV) === 'production'

return {
...(external
? {
sourceType: 'unambiguous',
}
: {}),
presets: [
!external
? [
r('@babel/preset-env'),
{
targets: {
browsers: PRODUCTION
? ['last 4 versions', 'safari >= 7', 'ie >= 9']
: ['last 2 versions', 'not ie <= 11', 'not android 4.4.3'],
},
useBuiltIns: 'entry',
modules,
},
]
: [
r('@babel/preset-env'),
{
targets: {
ie: 9,
},
ignoreBrowserslistConfig: true,
useBuiltIns: false,
modules: false,
},
],
[r('@babel/preset-react'), { development: !PRODUCTION }],
].filter(Boolean),
plugins: (!external
? [
r('babel-plugin-macros'),
PRODUCTION
? r('babel-plugin-universal-import')
: r('react-hot-loader/babel'),
r('@babel/plugin-transform-destructuring'),
[
r('@babel/plugin-transform-runtime'),
{
helpers: !!helpers,
regenerator: true,
},
],
PRODUCTION && r('babel-plugin-transform-react-remove-prop-types'),
r('@babel/plugin-syntax-dynamic-import'),
r('@babel/plugin-proposal-class-properties'),
r('@babel/plugin-proposal-optional-chaining'),
r('@babel/plugin-proposal-export-default-from'),
]
: [
[
r('@babel/plugin-transform-runtime'),
{
corejs: false,
helpers: !!helpers,
regenerator: true,
useESModules: true,
},
],
r('@babel/plugin-syntax-dynamic-import'),
]
).filter(Boolean),
}
}
@@ -1,75 +1,4 @@
const r = require.resolve

module.exports = (api, options = {}) => {
const { NODE_ENV, BABEL_ENV } = process.env

const PRODUCTION = (BABEL_ENV || NODE_ENV) === 'production'

return {
...(options.external
? {
sourceType: 'unambiguous',
}
: {}),
presets: [
!options.external
? [
r('@babel/preset-env'),
{
targets: {
browsers: PRODUCTION
? ['last 4 versions', 'safari >= 7', 'ie >= 9']
: ['last 2 versions', 'not ie <= 11', 'not android 4.4.3'],
},
useBuiltIns: 'entry',
modules: options.modules,
},
]
: [
r('@babel/preset-env'),
{
targets: {
ie: 9,
},
ignoreBrowserslistConfig: true,
useBuiltIns: false,
modules: false,
},
],
[r('@babel/preset-react'), { development: !PRODUCTION }],
].filter(Boolean),
plugins: (!options.external
? [
r('babel-plugin-macros'),
PRODUCTION
? r('babel-plugin-universal-import')
: r('react-hot-loader/babel'),
r('@babel/plugin-transform-destructuring'),
[
r('@babel/plugin-transform-runtime'),
{
helpers: !!options.helpers,
regenerator: true,
},
],
PRODUCTION && r('babel-plugin-transform-react-remove-prop-types'),
r('@babel/plugin-syntax-dynamic-import'),
r('@babel/plugin-proposal-class-properties'),
r('@babel/plugin-proposal-optional-chaining'),
r('@babel/plugin-proposal-export-default-from'),
]
: [
[
r('@babel/plugin-transform-runtime'),
{
corejs: false,
helpers: !!options.helpers,
regenerator: true,
useESModules: true,
},
],
r('@babel/plugin-syntax-dynamic-import'),
]
).filter(Boolean),
}
}
console.log(
'WARNING: react-static/babelPreset.js has been renamed to react-static/babel-preset.js. Please update your babel configurations to point to the new file.'
)
module.exports = require('./babel-preset')
@@ -46,7 +46,6 @@
"babel-plugin-macros": "^2.4.3",
"babel-plugin-transform-react-remove-prop-types": "^0.4.20",
"babel-plugin-universal-import": "^3.0.2",
"babel-preset-react-static": "^6.0.0-beta.31",
"case-sensitive-paths-webpack-plugin": "^2.1.2",
"chalk": "^2.4.1",
"chokidar": "^2.0.4",
@@ -1,5 +1,5 @@
import fs from 'fs'
import babelPreset from 'babel-preset-react-static'
import babelPreset from '../../../../babel-preset'

// we check which babel config file exists in the project root
const readBabelConfig = root => {
@@ -1,4 +1,4 @@
import babelPreset from 'babel-preset-react-static'
import babelPreset from '../../../../babel-preset'

export default function({ config }) {
return {
@@ -1,3 +1,3 @@
{
"presets": ["react-static/babelPreset.js"]
"presets": ["react-static/babel-preset.js"]
}
@@ -1,3 +1,3 @@
{
"presets": ["react-static/babelPreset.js"]
"presets": ["react-static/babel-preset.js"]
}
Oops, something went wrong.

0 comments on commit aa3bed0

Please sign in to comment.