utils/rollup.config.js
Martin Donnelly c30b36b3f6 init
2020-11-17 11:16:34 +00:00

32 lines
611 B
JavaScript

/**
* Created by WebStorm.
* User: martin
* Date: 01/06/2020
* Time: 15:04
*/
import pkg from './package.json';
import resolve from "@rollup/plugin-node-resolve";
import commonjs from "@rollup/plugin-commonjs";
import {terser} from "rollup-plugin-terser";
export default {
input: 'src/index.js',
output: [{
file: pkg.main,
format: 'cjs',
name: pkg.name
},{
file: pkg.module,
format: 'es',
name: pkg.name
}],
plugins:[resolve(), commonjs()
,terser()
],
external:[
...Object.keys(pkg.dependencies || {}),
...Object.keys(pkg.peerDependencies || {}),
]
};