mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-23 22:25:12 +00:00
ef7a42649d
nuxt-start and nuxt/legacy are also coming!
23 lines
542 B
JavaScript
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)
|
|
})
|