mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-13 09:33:54 +00:00
c954ad4763
* Add missing devDependencies This avoids relying on transitively installed dependencies. * rollup: avoid bundling any NPM module This is a hack relying on how rollup-plugin-node-resolve filters the path, but it works as intended.
24 lines
562 B
JavaScript
24 lines
562 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,
|
|
only: ['./'],
|
|
extensions: ['.mjs', '.js']
|
|
}),
|
|
commonjs(),
|
|
json()
|
|
].concat(plugins)
|
|
})
|