Friendly import-on-demand popmotion for babel-plugin-import.
npm install popmotion-xFriendly __import-on-demand__ popmotion for babel-plugin-import.
First, install popmotion-x:
``bash`
yarn add popmotion-x
Second, set .babelrc as follows:
`json`
{
"plugins": [
["import", {
"libraryName": "popmotion-x"
}]
]
}
Then, you can import popmotion on demand:
`js`
import {
action,
calc,
chain,
composite,
crossfade,
css,
decay,
delay,
easing,
everyFrame,
keyframes,
listen,
merge,
multicast,
multitouch,
parallel,
physics,
pointer,
schedule,
scroll,
spring,
stagger,
styler,
svg,
timeline,
transform,
tween,
valueTypes,
value
} from 'popmotion-x'
These will be transformed to someting like:
`js
const action = require('popmotion-x/lib/action')
const calc = require('popmotion-x/lib/calc')
// ......
const valueTypes = require('popmotion-x/lib/value-types')
const value = require('popmotion-x/lib/value')
``