Skip to content

Commit

Permalink
Merge branch 'next' into tech/add-docs-to-standalone
Browse files Browse the repository at this point in the history
  • Loading branch information
shilman committed Jul 6, 2021
2 parents cdaf6f0 + 76d155e commit 2a11c56
Show file tree
Hide file tree
Showing 3,959 changed files with 204,000 additions and 124,670 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
56 changes: 52 additions & 4 deletions .babelrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,30 @@ const withTests = {
],
};

// type BabelMode = 'cjs' | 'esm' | 'modern';

const modules = process.env.BABEL_MODE === 'cjs' ? 'auto' : false;

// FIXME: optional chaining introduced in chrome 80, not supported by wepback4
// https://github.com/webpack/webpack/issues/10227#issuecomment-642734920
const targets = process.env.BABEL_MODE === 'modern' ? { chrome: '79' } : 'defaults';

module.exports = {
ignore: [
'./lib/codemod/src/transforms/__testfixtures__',
'./lib/postinstall/src/__testfixtures__',
],
presets: [
['@babel/preset-env', { shippedProposals: true, useBuiltIns: 'usage', corejs: '3' }],
[
'@babel/preset-env',
{
shippedProposals: true,
useBuiltIns: 'usage',
corejs: '3',
targets,
modules,
},
],
'@babel/preset-typescript',
'@babel/preset-react',
'@babel/preset-flow',
Expand Down Expand Up @@ -52,7 +69,16 @@ module.exports = {
{
test: './lib',
presets: [
['@babel/preset-env', { shippedProposals: true, useBuiltIns: 'usage', corejs: '3' }],
[
'@babel/preset-env',
{
shippedProposals: true,
useBuiltIns: 'usage',
corejs: '3',
modules,
targets,
},
],
'@babel/preset-react',
],
plugins: [
Expand All @@ -62,7 +88,6 @@ module.exports = {
['@babel/plugin-proposal-class-properties', { loose: true }],
'babel-plugin-macros',
['emotion', { sourceMap: true, autoLabel: true }],
'@babel/plugin-transform-react-constant-elements',
'babel-plugin-add-react-displayname',
],
env: {
Expand All @@ -72,6 +97,11 @@ module.exports = {
{
test: [
'./lib/node-logger',
'./lib/core',
'./lib/core-common',
'./lib/core-server',
'./lib/builder-webpack4',
'./lib/builder-webpack5',
'./lib/codemod',
'./addons/storyshots',
'**/src/server/**',
Expand All @@ -84,8 +114,9 @@ module.exports = {
shippedProposals: true,
useBuiltIns: 'usage',
targets: {
node: '8.11',
node: '10',
},
modules,
corejs: '3',
},
],
Expand All @@ -105,5 +136,22 @@ module.exports = {
test: withTests,
},
},
{
test: ['**/virtualModuleEntry.template.js'],
presets: [
[
'@babel/preset-env',
{
shippedProposals: true,
useBuiltIns: 'usage',
targets: {
node: '10',
},
corejs: '3',
modules: false,
},
],
],
},
],
};
16 changes: 0 additions & 16 deletions .bettercodehub.yml

This file was deleted.

0 comments on commit 2a11c56

Please sign in to comment.