2018-03-27 22:28:17 +00:00
|
|
|
import nodeResolve from 'rollup-plugin-node-resolve'
|
|
|
|
import json from 'rollup-plugin-json'
|
|
|
|
import commonjs from 'rollup-plugin-commonjs'
|
|
|
|
import defaultsDeep from 'lodash/defaultsDeep'
|
|
|
|
|
|
|
|
export default ({ name, input, plugins = [], options }) => defaultsDeep({}, options, {
|
|
|
|
input,
|
|
|
|
output: {
|
|
|
|
file: `dist/${name}.js`,
|
|
|
|
format: 'cjs',
|
|
|
|
sourcemap: true
|
|
|
|
},
|
|
|
|
plugins: [
|
|
|
|
nodeResolve({
|
|
|
|
modulesOnly: true,
|
|
|
|
preferBuiltins: true,
|
2018-06-01 11:29:10 +00:00
|
|
|
only: ['./'],
|
2018-03-27 22:28:17 +00:00
|
|
|
extensions: ['.mjs', '.js']
|
|
|
|
}),
|
|
|
|
commonjs(),
|
|
|
|
json()
|
|
|
|
].concat(plugins)
|
|
|
|
})
|