1
0
Fork 0
freesewing/packages/holmes/rollup.config.js

42 lines
1 KiB
JavaScript
Raw Normal View History

import babel from 'rollup-plugin-babel'
import resolve from 'rollup-plugin-node-resolve'
import commonjs from 'rollup-plugin-commonjs'
import json from 'rollup-plugin-json'
import minify from 'rollup-plugin-babel-minify'
import peerDepsExternal from 'rollup-plugin-peer-deps-external'
import { name, version, description, author, license, main, module } from './package.json'
2019-09-13 15:56:35 +01:00
const output = [
{
file: main,
format: 'cjs',
sourcemap: true
}
]
if (typeof module !== 'undefined')
output.push({
file: module,
format: 'es',
sourcemap: true
})
2019-09-13 15:56:35 +01:00
export default {
input: 'src/index.js',
output,
2019-09-13 15:56:35 +01:00
plugins: [
peerDepsExternal(),
resolve({ modulesOnly: true }),
commonjs(),
json(),
2019-09-13 15:56:35 +01:00
babel({
exclude: 'node_modules/**',
plugins: ['@babel/plugin-proposal-object-rest-spread']
2019-09-13 15:56:35 +01:00
}),
minify({
comments: false,
sourceMap: true,
banner: `/**\n * ${name} | v${version}\n * ${description}\n * (c) ${new Date().getFullYear()} ${author}\n * @license ${license}\n */`
})
]
}