-
Notifications
You must be signed in to change notification settings - Fork 482
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrade to the stable babel 7 release (#460)
* Upgrade to the stable babel 7 release * fix the CI * [core] Upgrade the dependencies
- Loading branch information
1 parent
510f650
commit 28b3e51
Showing
55 changed files
with
4,139 additions
and
3,633 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
.git | ||
/.next/ | ||
node_modules | ||
/.next | ||
/coverage | ||
/docs/export | ||
/docs/src/modules/utils/find.js | ||
/flow/interfaces | ||
lib/ | ||
/next.config.js | ||
/docs/src/modules/utils/find.js | ||
/docs/export/ | ||
lib/ | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,163 @@ | ||
let defaultPresets; | ||
|
||
// We release a ES version of Material-UI. | ||
// It's something that matches the latest official supported features of JavaScript. | ||
// Nothing more (stage-1, etc), nothing less (require, etc). | ||
if (process.env.BABEL_ENV === 'es') { | ||
defaultPresets = []; | ||
} else { | ||
defaultPresets = [ | ||
[ | ||
'@babel/preset-env', | ||
{ | ||
targets: { | ||
ie: 10, | ||
edge: 14, | ||
firefox: 28, | ||
chrome: 29, | ||
safari: 9, | ||
node: '6.11', | ||
}, | ||
modules: ['modules', 'production-umd'].includes(process.env.BABEL_ENV) ? false : 'commonjs', | ||
}, | ||
], | ||
]; | ||
} | ||
|
||
module.exports = { | ||
presets: defaultPresets.concat(['@babel/preset-react']), | ||
plugins: [ | ||
['@babel/plugin-proposal-class-properties', { loose: true }], | ||
[ | ||
'@babel/plugin-proposal-object-rest-spread', | ||
{ | ||
// Workaround for /~https://github.com/babel/babel/issues/8323 | ||
loose: process.env.BABEL_ENV !== 'es', | ||
}, | ||
], | ||
'@babel/plugin-transform-object-assign', | ||
'@babel/plugin-transform-runtime', | ||
], | ||
env: { | ||
coverage: { | ||
plugins: [ | ||
'babel-plugin-istanbul', | ||
[ | ||
'babel-plugin-module-resolver', | ||
{ | ||
root: ['./'], | ||
alias: { | ||
pages: './pages', | ||
'react-swipeable-views': './packages/react-swipeable-views/src', | ||
'react-swipeable-views-utils': './packages/react-swipeable-views-utils/src', | ||
'react-swipeable-views-core': './packages/react-swipeable-views-core/src', | ||
docs: './docs', | ||
}, | ||
}, | ||
], | ||
], | ||
}, | ||
development: {}, | ||
'docs-development': { | ||
plugins: [ | ||
'babel-plugin-preval', | ||
[ | ||
'babel-plugin-module-resolver', | ||
{ | ||
alias: { | ||
'react-swipeable-views': './packages/react-swipeable-views/src', | ||
'react-swipeable-views-core': './packages/react-swipeable-views-core/src', | ||
'react-swipeable-views-utils': './packages/react-swipeable-views-utils/src', | ||
docs: './docs', | ||
pages: './pages', | ||
}, | ||
}, | ||
], | ||
], | ||
}, | ||
'docs-production': { | ||
plugins: [ | ||
'babel-plugin-preval', | ||
[ | ||
'babel-plugin-module-resolver', | ||
{ | ||
alias: { | ||
'react-swipeable-views': './packages/react-swipeable-views/src', | ||
'react-swipeable-views-core': './packages/react-swipeable-views-core/src', | ||
'react-swipeable-views-utils': './packages/react-swipeable-views-utils/src', | ||
docs: './docs', | ||
pages: './pages', | ||
}, | ||
}, | ||
], | ||
'transform-react-constant-elements', | ||
'transform-dev-warning', | ||
['react-remove-properties', { properties: ['data-mui-test'] }], | ||
['transform-react-remove-prop-types', { mode: 'remove' }], | ||
], | ||
}, | ||
es: { | ||
plugins: [ | ||
'transform-react-constant-elements', | ||
'transform-dev-warning', | ||
['react-remove-properties', { properties: ['data-mui-test'] }], | ||
[ | ||
'transform-react-remove-prop-types', | ||
{ | ||
mode: 'wrap', | ||
}, | ||
], | ||
], | ||
// It's most likely a babel bug. | ||
// We are using this ignore option in the CLI command but that has no effect. | ||
ignore: ['**/*.test.js'], | ||
}, | ||
production: { | ||
plugins: [ | ||
'transform-react-constant-elements', | ||
'transform-dev-warning', | ||
['react-remove-properties', { properties: ['data-mui-test'] }], | ||
[ | ||
'transform-react-remove-prop-types', | ||
{ | ||
mode: 'wrap', | ||
}, | ||
], | ||
], | ||
// It's most likely a babel bug. | ||
// We are using this ignore option in the CLI command but that has no effect. | ||
ignore: ['**/*.test.js'], | ||
}, | ||
'production-umd': { | ||
plugins: [ | ||
'transform-react-constant-elements', | ||
'transform-dev-warning', | ||
['react-remove-properties', { properties: ['data-mui-test'] }], | ||
[ | ||
'transform-react-remove-prop-types', | ||
{ | ||
mode: 'wrap', | ||
}, | ||
], | ||
], | ||
}, | ||
test: { | ||
sourceMaps: 'both', | ||
plugins: [ | ||
[ | ||
'babel-plugin-module-resolver', | ||
{ | ||
root: ['./'], | ||
alias: { | ||
'react-swipeable-views': './packages/react-swipeable-views/src', | ||
'react-swipeable-views-core': './packages/react-swipeable-views-core/src', | ||
'react-swipeable-views-utils': './packages/react-swipeable-views-utils/src', | ||
docs: './docs', | ||
pages: './pages', | ||
}, | ||
}, | ||
], | ||
], | ||
}, | ||
}, | ||
}; |
Oops, something went wrong.