Nuxt/scripts/rollup/rollup.config.js

20 lines
436 B
JavaScript
Raw Normal View History

import json from 'rollup-plugin-json'
import commonjs from 'rollup-plugin-commonjs'
import defaultsDeep from 'lodash/defaultsDeep'
2018-06-01 12:00:17 +00:00
import externals from './externals'
export default ({ name, input, plugins = [], options }) => defaultsDeep({}, options, {
input,
output: {
file: `dist/${name}.js`,
format: 'cjs',
sourcemap: true
},
2018-06-01 12:00:17 +00:00
external: externals,
plugins: [
commonjs(),
json()
].concat(plugins)
})