UNPKG

889 BJavaScriptView Raw
1'use strict';
2
3const babel = require('rollup-plugin-babel');
4const json = require('rollup-plugin-json');
5const commonjs = require('rollup-plugin-commonjs');
6const resolve = require('rollup-plugin-node-resolve');
7const external = require('@yelo/rollup-node-external');
8const paths = require('./paths');
9const basePresets = require('./babel.js');
10
11const config = {
12 input: paths.srcPath,
13 output: {
14 file: paths.buildPath,
15 format: 'cjs',
16 banner: `require('${require
17 .resolve('source-map-support')
18 .indexOf(process.cwd()) === 0
19 ? 'source-map-support/register'
20 : require.resolve('source-map-support/register')}')`,
21 },
22 sourcemap: true,
23 plugins: [
24 resolve(),
25 babel({
26 exclude: 'node_modules/**',
27 babelrc: true,
28 presets: basePresets,
29 }),
30 commonjs(),
31 json(),
32 ],
33 external: external(),
34};
35
36module.exports = config;