-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrollup.config.cjs
More file actions
23 lines (21 loc) · 860 Bytes
/
Copy pathrollup.config.cjs
File metadata and controls
23 lines (21 loc) · 860 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
const commonjs = require('@rollup/plugin-commonjs');
const { defineConfig } = require('rollup');
const path = require('path');
const packageJson = require('./package.json');
module.exports = defineConfig({
input: path.resolve(__dirname, 'src', 'index.js'),
output: {
file: `dist/${packageJson.name}.umd.js`,
format: 'umd',
name: packageJson.name,
},
plugins: [
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Temporary patch because rollup doesn't support commonjs natively.
// I don't want to use ES modules because I need a prototype that I can
// write with as little tools as possible. On the other side, I couldn't
// use ES modules because Jest doesn't support them natively.
commonjs(),
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
],
});