-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.js
28 lines (26 loc) · 1.05 KB
/
rollup.config.js
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
26
27
28
const typescript = require('@rollup/plugin-typescript');
const terser = require('@rollup/plugin-terser');
const pkg = require('./package.json');
const name = pkg.name;
module.exports = [
{
input: ['src/index.ts'],
output: [{ dir: 'dist/esm', format: 'esm', entryFileNames: '[name].mjs' }],
plugins: [typescript({ tsconfig: './tsconfig.json', outDir: 'dist/esm' })],
},
{
input: ['src/index.ts'],
output: [{ dir: 'dist/cjs', format: 'cjs', entryFileNames: '[name].js' }],
plugins: [typescript({ tsconfig: './tsconfig.json', outDir: 'dist/cjs' })],
},
{
input: ['src/index.ts'],
output: [{ dir: 'dist/umd', format: 'umd', entryFileNames: '[name].js', name }],
plugins: [typescript({ tsconfig: './tsconfig.json', outDir: 'dist/umd' }), terser()],
},
{
input: ['src/index.ts'],
output: [{ dir: 'dist/amd', format: 'amd', entryFileNames: '[name].js', name }],
plugins: [typescript({ tsconfig: './tsconfig.json', outDir: 'dist/amd' }), terser()],
},
]