Skip to content

Commit

Permalink
Use loose mode for class properties transform (#366)
Browse files Browse the repository at this point in the history
  • Loading branch information
Andarist authored and erikras committed Nov 15, 2018
1 parent 1e4d1f4 commit 8add9ad
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 72 deletions.
40 changes: 0 additions & 40 deletions .babelrc

This file was deleted.

36 changes: 36 additions & 0 deletions .babelrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
const { NODE_ENV } = process.env
const test = NODE_ENV === 'test'
const loose = true

module.exports = {
presets: [
[
'@babel/preset-env',
{
loose,
...(test ? { targets: { node: '8' } } : {})
}
],
'@babel/preset-react',
'@babel/preset-flow'
],
plugins: [
'@babel/plugin-transform-flow-strip-types',
'@babel/plugin-syntax-dynamic-import',
'@babel/plugin-syntax-import-meta',
['@babel/plugin-proposal-class-properties', { loose }],
'@babel/plugin-proposal-json-strings',
[
'@babel/plugin-proposal-decorators',
{
legacy: true
}
],
'@babel/plugin-proposal-function-sent',
'@babel/plugin-proposal-export-namespace-from',
'@babel/plugin-proposal-numeric-separator',
'@babel/plugin-proposal-throw-expressions',
test && '@babel/plugin-transform-react-jsx-source',
test && 'istanbul'
].filter(Boolean)
}
33 changes: 1 addition & 32 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,38 +68,7 @@ export default {
flow(),
commonjs({ include: 'node_modules/**' }),
babel({
exclude: 'node_modules/**',
babelrc: false,
runtimeHelpers: true,
presets: [
[
'@babel/preset-env',
{
loose: true,
modules: false
}
],
'@babel/preset-react',
'@babel/preset-flow'
],
plugins: [
['@babel/plugin-transform-runtime', { useESModules: !cjs }],
'@babel/plugin-transform-flow-strip-types',
'@babel/plugin-syntax-dynamic-import',
'@babel/plugin-syntax-import-meta',
'@babel/plugin-proposal-class-properties',
'@babel/plugin-proposal-json-strings',
[
'@babel/plugin-proposal-decorators',
{
legacy: true
}
],
'@babel/plugin-proposal-function-sent',
'@babel/plugin-proposal-export-namespace-from',
'@babel/plugin-proposal-numeric-separator',
'@babel/plugin-proposal-throw-expressions'
]
exclude: 'node_modules/**'
}),
umd
? replace({
Expand Down

0 comments on commit 8add9ad

Please sign in to comment.