-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(build): upgrade rollup & add esm build
- Loading branch information
Raphaël Benitte
authored and
Raphaël Benitte
committed
Mar 21, 2019
1 parent
670d22d
commit f6d6480
Showing
55 changed files
with
262 additions
and
670 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,8 +9,7 @@ package-lock.json | |
|
||
build | ||
|
||
/packages/*/cjs | ||
/packages/*/umd | ||
/packages/*/dist | ||
|
||
*.lerna_backup | ||
|
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
This file was deleted.
Oops, something went wrong.
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,80 +1,58 @@ | ||
'use strict' | ||
|
||
const plugins = [ | ||
[ | ||
require.resolve('babel-plugin-transform-es2015-template-literals'), | ||
{ | ||
loose: true, | ||
}, | ||
], | ||
require.resolve('babel-plugin-transform-es2015-literals'), | ||
require.resolve('babel-plugin-transform-es2015-function-name'), | ||
require.resolve('babel-plugin-transform-es2015-arrow-functions'), | ||
require.resolve('babel-plugin-transform-es2015-block-scoped-functions'), | ||
require.resolve('babel-plugin-transform-class-properties'), | ||
[ | ||
require.resolve('babel-plugin-transform-es2015-classes'), | ||
{ | ||
loose: true, | ||
}, | ||
], | ||
require.resolve('babel-plugin-transform-es2015-object-super'), | ||
require.resolve('babel-plugin-transform-es2015-shorthand-properties'), | ||
[ | ||
require.resolve('babel-plugin-transform-es2015-computed-properties'), | ||
{ | ||
loose: true, | ||
}, | ||
], | ||
require.resolve('babel-plugin-check-es2015-constants'), | ||
[ | ||
require.resolve('babel-plugin-transform-es2015-spread'), | ||
{ | ||
loose: true, | ||
}, | ||
], | ||
require.resolve('babel-plugin-transform-es2015-parameters'), | ||
[ | ||
require.resolve('babel-plugin-transform-es2015-destructuring'), | ||
{ | ||
loose: true, | ||
}, | ||
], | ||
require.resolve('babel-plugin-transform-es2015-block-scoping'), | ||
require.resolve('babel-plugin-transform-object-rest-spread'), | ||
require.resolve('babel-plugin-transform-react-jsx'), | ||
require.resolve('babel-plugin-syntax-jsx'), | ||
] | ||
|
||
const env = process.env.BABEL_ENV || process.env.NODE_ENV | ||
|
||
if (env === 'commonjs') { | ||
plugins.push.apply(plugins, [ | ||
module.exports = () => { | ||
const presets = [ | ||
[ | ||
require.resolve('babel-plugin-transform-es2015-modules-commonjs'), | ||
{ | ||
loose: true, | ||
}, | ||
`@babel/env`, | ||
{} | ||
], | ||
]) | ||
} | ||
|
||
if (env === 'es') { | ||
plugins.push.apply(plugins, [require.resolve('./use-lodash-es')]) | ||
} | ||
[ | ||
`@babel/react`, | ||
{} | ||
] | ||
] | ||
|
||
if (env === 'test') { | ||
plugins.push.apply(plugins, [ | ||
require.resolve('babel-plugin-istanbul'), | ||
const plugins = [ | ||
`@babel/proposal-class-properties`, | ||
[ | ||
require.resolve('babel-plugin-transform-es2015-modules-commonjs'), | ||
`lodash`, | ||
{ | ||
loose: true, | ||
}, | ||
], | ||
]) | ||
} | ||
id: ['lodash', 'recompose'] | ||
} | ||
] | ||
] | ||
|
||
const env = process.env.BABEL_ENV || process.env.NODE_ENV | ||
|
||
if (env === 'commonjs') { | ||
plugins.push.apply(plugins, [ | ||
[ | ||
require.resolve('babel-plugin-transform-es2015-modules-commonjs'), | ||
{ | ||
loose: true, | ||
}, | ||
], | ||
]) | ||
} | ||
|
||
if (env === 'es') { | ||
plugins.push.apply(plugins, [require.resolve('./use-lodash-es')]) | ||
} | ||
|
||
if (env === 'test') { | ||
plugins.push.apply(plugins, [ | ||
require.resolve('babel-plugin-istanbul'), | ||
[ | ||
require.resolve('babel-plugin-transform-es2015-modules-commonjs'), | ||
{ | ||
loose: true, | ||
}, | ||
], | ||
]) | ||
} | ||
|
||
module.exports = { | ||
plugins, | ||
return { | ||
presets, | ||
plugins | ||
} | ||
} |
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 was deleted.
Oops, something went wrong.
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
This file was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
Oops, something went wrong.