forked from node-fetch/node-fetch
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrollup.config.js
More file actions
27 lines (25 loc) · 795 Bytes
/
rollup.config.js
File metadata and controls
27 lines (25 loc) · 795 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
import isBuiltin from 'is-builtin-module';
import babel from 'rollup-plugin-babel';
import tweakDefault from './build/rollup-plugin';
process.env.BABEL_ENV = 'rollup';
export default {
input: 'src/index.js',
output: [
{ file: 'lib/index.js', format: 'cjs', exports: 'named' },
{ file: 'lib/index.es.js', format: 'es', exports: 'named', intro: 'process.emitWarning("The .es.js file is deprecated. Use .mjs instead.");' },
{ file: 'lib/index.mjs', format: 'es', exports: 'named' },
],
plugins: [
babel({
runtimeHelpers: true
}),
tweakDefault()
],
external: function (id) {
if (isBuiltin(id)) {
return true;
}
id = id.split('/').slice(0, id[0] === '@' ? 2 : 1).join('/');
return !!require('./package.json').dependencies[id];
}
};