Nuxt/scripts/rollup/rollup.config.js
Clark Du ef7a42649d misc: improve coverage and packaging (#3121)
nuxt-start and nuxt/legacy are also coming!
2018-03-28 02:58:17 +04:30

23 lines
542 B
JavaScript

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,
extensions: ['.mjs', '.js']
}),
commonjs(),
json()
].concat(plugins)
})