forked from shachar731945/light-classnames
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrollup.config.js
More file actions
25 lines (21 loc) · 708 Bytes
/
rollup.config.js
File metadata and controls
25 lines (21 loc) · 708 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import typescript from '@rollup/plugin-typescript';
import {terser} from 'rollup-plugin-terser';
import pkg from './package.json';
const externals = []
.concat(Object.keys(pkg.dependencies || {}))
.concat(Object.keys(pkg.peerDependencies || {}));
const generateConfig = format => ({
external: path => externals.some(external => path.startsWith(external)),
input: 'src/index.ts',
output: {
exports: 'auto',
file: `dist/bundle.${format}.min.js`,
name: format === 'umd' ? 'lcn' : undefined,
format
},
plugins: [
typescript({tsconfig: './tsconfig.json'}),
terser()
]
});
export default ['esm', 'cjs', 'umd'].map(generateConfig);