-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrollup.config.js
More file actions
28 lines (26 loc) · 802 Bytes
/
Copy pathrollup.config.js
File metadata and controls
28 lines (26 loc) · 802 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
26
27
28
import { createRequire } from 'node:module';
import { dts } from 'rollup-plugin-dts';
import { swc, defineRollupSwcOption } from 'rollup-plugin-swc3';
const require = createRequire(import.meta.url);
const pkg = require('./package.json');
export default [
{
input: 'src/Monome.js',
output: [{ file: pkg.module, format: 'es' }],
plugins: [swc()],
},
{
input: 'src/Monome.js',
output: [
{ name: 'Monome', file: pkg.browser, format: 'umd', exports: 'named' },
{ file: pkg.main, format: 'cjs', exports: 'named' },
{ file: pkg.module.replace('js', 'min.js'), format: 'es' },
],
plugins: [swc(defineRollupSwcOption({ minify: true }))],
},
{
input: 'src/Monome.js',
output: [{ file: pkg.types, format: 'es' }],
plugins: [dts({ compilerOptions: { allowJs: true } })],
},
];