1
1
import resolve from '@rollup/plugin-node-resolve' ;
2
2
import babel from 'rollup-plugin-babel' ;
3
- import { terser } from "rollup-plugin-terser" ;
4
3
import clear from "rollup-plugin-clear" ;
5
-
6
- const babelOptionsES5 = {
7
- runtimeHelpers : false ,
8
- externalHelpers : false ,
9
- babelrc : false ,
10
- presets : [
11
- [
12
- "@babel/env" ,
13
- {
14
- targets : {
15
- ie : '11' ,
16
- edge : '17' ,
17
- firefox : '60' ,
18
- chrome : '71' ,
19
- safari : '11.1' ,
20
- } ,
21
- }
22
- ]
23
- ] ,
24
- plugins : [
25
- [ "@babel/plugin-proposal-class-properties" , { loose : true } ] ,
26
- [ "@babel/plugin-proposal-private-property-in-object" , { loose : true } ] ,
27
- [ "@babel/plugin-proposal-private-methods" , { loose : true } ] ,
28
- ]
29
- } ;
4
+ import { terser } from "rollup-plugin-terser" ;
30
5
31
6
const babelOptionsES2018 = {
32
7
runtimeHelpers : false ,
@@ -35,54 +10,23 @@ const babelOptionsES2018 = {
35
10
plugins : [
36
11
[ "@babel/plugin-proposal-class-properties" , { loose : true } ] ,
37
12
[ "@babel/plugin-proposal-private-property-in-object" , { loose : true } ] ,
38
- [ "@babel/plugin-proposal-private-methods" , { loose : true } ] ,
13
+ [ "@babel/plugin-proposal-private-methods" , { loose : true } ] ,
39
14
]
40
15
} ;
41
16
42
17
// https://rollupjs.org/guide/en#big-list-of-options
43
18
export default [
44
- // ES2015 Minified
45
- {
46
- input : './src/index.js' ,
47
- output : {
48
- file : './dist/parser.min.js' ,
49
- format : 'umd' ,
50
- name : 'BBCode' ,
51
- compact : true ,
52
- sourcemap : true ,
53
- } ,
54
- plugins : [
55
- resolve ( ) ,
56
- clear ( { targets : [ './dist' ] } ) ,
57
- babel ( babelOptionsES5 ) ,
58
- terser ( ) ,
59
- ]
60
- } ,
61
- // ES2015 None-Minified
62
- {
63
- input : './src/index.js' ,
64
- output : {
65
- file : './dist/parser.js' ,
66
- format : 'umd' ,
67
- name : 'BBCode' ,
68
- compact : false ,
69
- sourcemap : true ,
70
- } ,
71
- plugins : [
72
- resolve ( ) ,
73
- babel ( babelOptionsES5 ) ,
74
- ]
75
- } ,
76
19
// ES Modules Minified
77
20
{
78
21
input : './src/index.js' ,
79
22
output : {
80
- file : './dist/parser.esm. min.js' ,
23
+ file : './dist/parser.min.js' ,
81
24
format : 'esm' ,
82
25
compact : true ,
83
26
sourcemap : true ,
84
27
} ,
85
28
plugins : [
29
+ clear ( { targets : [ './dist' ] } ) ,
86
30
resolve ( ) ,
87
31
babel ( babelOptionsES2018 ) ,
88
32
terser ( ) ,
@@ -92,7 +36,7 @@ export default [
92
36
{
93
37
input : './src/index.js' ,
94
38
output : {
95
- file : './dist/parser.esm. js' ,
39
+ file : './dist/parser.js' ,
96
40
format : 'esm' ,
97
41
compact : false ,
98
42
sourcemap : true ,
@@ -102,43 +46,11 @@ export default [
102
46
babel ( babelOptionsES2018 ) ,
103
47
]
104
48
} ,
105
- // ES2015 Minified
106
- {
107
- input : './src/simple.js' ,
108
- output : {
109
- file : './dist/simple.min.js' ,
110
- format : 'umd' ,
111
- name : 'BBCode' ,
112
- compact : true ,
113
- sourcemap : true ,
114
- } ,
115
- plugins : [
116
- resolve ( ) ,
117
- clear ( { targets : [ './dist' ] } ) ,
118
- babel ( babelOptionsES5 ) ,
119
- terser ( ) ,
120
- ]
121
- } ,
122
- // ES2015 None-Minified
123
- {
124
- input : './src/simple.js' ,
125
- output : {
126
- file : './dist/simple.js' ,
127
- format : 'umd' ,
128
- name : 'BBCode' ,
129
- compact : false ,
130
- sourcemap : true ,
131
- } ,
132
- plugins : [
133
- resolve ( ) ,
134
- babel ( babelOptionsES5 ) ,
135
- ]
136
- } ,
137
49
// ES Modules Minified
138
50
{
139
51
input : './src/simple.js' ,
140
52
output : {
141
- file : './dist/simple.esm. min.js' ,
53
+ file : './dist/simple.min.js' ,
142
54
format : 'esm' ,
143
55
compact : true ,
144
56
sourcemap : true ,
@@ -153,7 +65,7 @@ export default [
153
65
{
154
66
input : './src/simple.js' ,
155
67
output : {
156
- file : './dist/simple.esm. js' ,
68
+ file : './dist/simple.js' ,
157
69
format : 'esm' ,
158
70
compact : false ,
159
71
sourcemap : true ,
0 commit comments