forked from mollie/mollie-api-node
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.js
40 lines (39 loc) · 1.06 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
29
30
31
32
33
34
35
36
37
38
39
40
import { join } from 'path';
import json from 'rollup-plugin-json';
import resolve from 'rollup-plugin-node-resolve';
import babel from 'rollup-plugin-babel';
export default {
input: join('src', 'createMollieClient.ts'),
external: [
// These Node.js interenals are external to our bundles…
'https', 'querystring', 'url', 'util',
// …as are the dependencies listed in our package.json.
...Object.keys(require('./package.json').dependencies),
],
output: [{ file: join('dist', 'mollie.cjs.js'), format: 'cjs' }, { file: join('dist', 'mollie.esm.js'), format: 'es' }],
plugins: [
json(),
resolve({
extensions: ['.ts'],
customResolveOptions: {
moduleDirectory: 'src',
},
preferBuiltins: true,
}),
babel({
extensions: ['.ts'],
}),
{
name: 'cert',
transform(code, id) {
if (id.endsWith('.pem') == false) {
return null;
}
return {
code: `export default ${JSON.stringify(code)}`,
map: { mappings: '' }
};
}
}
],
};