1 | 'use strict';
|
2 |
|
3 | const babel = require('rollup-plugin-babel');
|
4 | const json = require('rollup-plugin-json');
|
5 | const commonjs = require('rollup-plugin-commonjs');
|
6 | const resolve = require('rollup-plugin-node-resolve');
|
7 | const external = require('@yelo/rollup-node-external');
|
8 | const paths = require('./paths');
|
9 | const basePresets = require('./babel.js');
|
10 |
|
11 | const 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 |
|
36 | module.exports = config;
|