-
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) · 805 Bytes
/
rollup.config.js
File metadata and controls
28 lines (26 loc) · 805 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 { terser } from 'rollup-plugin-terser'
import { nodeResolve } from '@rollup/plugin-node-resolve'
import commonjs from '@rollup/plugin-commonjs'
import copy from 'rollup-plugin-copy'
export default {
input: 'src/index.mjs',
output: {
exports: 'named',
format: 'es',
file: 'dist/index.mjs',
sourcemap: true,
},
// rollup won't copy slug.txt to dist/ for us, so we need to setup a copy ourselves
// and declare it as an external dependency so it doesn't throw a warning. It'd
// be nice to have a rollup plugin that detected non-js modules like this and
// copied them for us.
external: ['slug.txt'],
plugins: [
nodeResolve({ browser: true }),
commonjs(),
terser(),
copy({
targets: [{ src: './src/slug.txt', dest: './dist/' }],
}),
],
}