-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.js
42 lines (37 loc) · 875 Bytes
/
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
41
42
import babel from 'rollup-plugin-babel';
import { eslint } from 'rollup-plugin-eslint';
import { terser } from 'rollup-plugin-terser';
import { version, author, name, license } from './package.json';
const banner =
'/*!\n' +
` * ${name} v${version}\n` +
` * (c) 2019-${new Date().getFullYear()} ${author.name}\n` +
` * Released under the ${license} License.\n` +
' */';
const defaultOutputOptions = {
banner,
format: 'umd',
name: 'SData',
};
const moduleFileName = defaultOutputOptions.name.toLowerCase();
const config = {
input: 'src/index.js',
output: [
{
...defaultOutputOptions,
file: `dist/${moduleFileName}.js`,
},
{
...defaultOutputOptions,
file: `dist/${moduleFileName}.min.js`,
plugins: [
terser(),
],
},
],
plugins: [
eslint(),
babel(),
],
};
export default config;