-
Notifications
You must be signed in to change notification settings - Fork 66
/
rollup.config.js
40 lines (39 loc) · 1.09 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
const { join } = require('path');
const json = require('rollup-plugin-json');
const resolve = require('rollup-plugin-node-resolve');
const babel = require('rollup-plugin-babel');
module.exports = {
input: join('src', 'createMollieClient.ts'),
external: [
// These Node.js internals are external to our bundles…
'crypto', '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: '' }
};
}
}
],
};