forked from DasRed/js-bbcode-parser
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.js
78 lines (76 loc) · 1.98 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
import resolve from '@rollup/plugin-node-resolve';
import babel from 'rollup-plugin-babel';
import clear from "rollup-plugin-clear";
import {terser} from "rollup-plugin-terser";
const babelOptionsES2018 = {
runtimeHelpers: false,
externalHelpers: false,
babelrc: false,
plugins: [
["@babel/plugin-proposal-class-properties", {loose: true}],
["@babel/plugin-proposal-private-property-in-object", {loose: true}],
["@babel/plugin-proposal-private-methods", {loose: true}],
]
};
// https://rollupjs.org/guide/en#big-list-of-options
export default [
// ES Modules Minified
{
input: './src/index.js',
output: {
file: './dist/parser.min.js',
format: 'esm',
compact: true,
sourcemap: true,
},
plugins: [
clear({targets: ['./dist']}),
resolve(),
babel(babelOptionsES2018),
terser(),
]
},
// ES Modules None-Minified
{
input: './src/index.js',
output: {
file: './dist/parser.js',
format: 'esm',
compact: false,
sourcemap: true,
},
plugins: [
resolve(),
babel(babelOptionsES2018),
]
},
// ES Modules Minified
{
input: './src/simple.js',
output: {
file: './dist/simple.min.js',
format: 'esm',
compact: true,
sourcemap: true,
},
plugins: [
resolve(),
babel(babelOptionsES2018),
terser(),
]
},
// ES Modules None-Minified
{
input: './src/simple.js',
output: {
file: './dist/simple.js',
format: 'esm',
compact: false,
sourcemap: true,
},
plugins: [
resolve(),
babel(babelOptionsES2018),
]
},
];