11import compiler from '@ampproject/rollup-plugin-closure-compiler' ;
22import { terser } from 'rollup-plugin-terser' ;
3- import replace from '@rollup/plugin-replace' ;
4- import { babelPlugin } from './rollup.plugins.js' ;
3+ import { babelPlugin , replacePlugin } from './rollup.plugins.js' ;
54
65// Compile plugins should always be added at the end of the plugin list.
76const compilePlugins = [
@@ -24,17 +23,11 @@ const ESModules = [
2423 sourcemap : true ,
2524 } ,
2625 plugins : [
27- replace ( {
28- values : {
29- WORKER_DOM_DEBUG : false ,
30- } ,
31- preventAssignment : true ,
32- } ) ,
26+ replacePlugin ( { server : true } ) ,
3327 babelPlugin ( {
3428 transpileToES5 : false ,
3529 allowConsole : false ,
3630 } ) ,
37- ...compilePlugins ,
3831 ] ,
3932 } ,
4033 {
@@ -46,12 +39,7 @@ const ESModules = [
4639 sourcemap : true ,
4740 } ,
4841 plugins : [
49- replace ( {
50- values : {
51- WORKER_DOM_DEBUG : false ,
52- } ,
53- preventAssignment : true ,
54- } ) ,
42+ replacePlugin ( ) ,
5543 babelPlugin ( {
5644 transpileToES5 : false ,
5745 allowConsole : false ,
@@ -68,12 +56,7 @@ const ESModules = [
6856 sourcemap : true ,
6957 } ,
7058 plugins : [
71- replace ( {
72- values : {
73- WORKER_DOM_DEBUG : true ,
74- } ,
75- preventAssignment : true ,
76- } ) ,
59+ replacePlugin ( { debug : true } ) ,
7760 babelPlugin ( {
7861 transpileToES5 : false ,
7962 allowConsole : true ,
@@ -89,12 +72,7 @@ const ESModules = [
8972 sourcemap : true ,
9073 } ,
9174 plugins : [
92- replace ( {
93- values : {
94- WORKER_DOM_DEBUG : false ,
95- } ,
96- preventAssignment : true ,
97- } ) ,
75+ replacePlugin ( ) ,
9876 babelPlugin ( {
9977 transpileToES5 : false ,
10078 allowConsole : false ,
@@ -111,6 +89,7 @@ const ESModules = [
11189 sourcemap : true ,
11290 } ,
11391 plugins : [
92+ replacePlugin ( { debug : true } ) ,
11493 babelPlugin ( {
11594 transpileToES5 : false ,
11695 allowConsole : true ,
@@ -126,12 +105,7 @@ const ESModules = [
126105 sourcemap : true ,
127106 } ,
128107 plugins : [
129- replace ( {
130- values : {
131- WORKER_DOM_DEBUG : false ,
132- } ,
133- preventAssignment : true ,
134- } ) ,
108+ replacePlugin ( { } ) ,
135109 babelPlugin ( {
136110 transpileToES5 : true ,
137111 allowConsole : false ,
@@ -148,12 +122,7 @@ const ESModules = [
148122 sourcemap : true ,
149123 } ,
150124 plugins : [
151- replace ( {
152- values : {
153- WORKER_DOM_DEBUG : true ,
154- } ,
155- preventAssignment : true ,
156- } ) ,
125+ replacePlugin ( { debug : true } ) ,
157126 babelPlugin ( {
158127 transpileToES5 : true ,
159128 allowConsole : true ,
@@ -169,12 +138,7 @@ const ESModules = [
169138 sourcemap : true ,
170139 } ,
171140 plugins : [
172- replace ( {
173- values : {
174- WORKER_DOM_DEBUG : false ,
175- } ,
176- preventAssignment : true ,
177- } ) ,
141+ replacePlugin ( ) ,
178142 babelPlugin ( {
179143 transpileToES5 : false ,
180144 allowConsole : true ,
@@ -191,12 +155,7 @@ const ESModules = [
191155 sourcemap : true ,
192156 } ,
193157 plugins : [
194- replace ( {
195- values : {
196- WORKER_DOM_DEBUG : true ,
197- } ,
198- preventAssignment : true ,
199- } ) ,
158+ replacePlugin ( { debug : true } ) ,
200159 babelPlugin ( {
201160 transpileToES5 : false ,
202161 allowConsole : true ,
@@ -212,12 +171,7 @@ const ESModules = [
212171 sourcemap : true ,
213172 } ,
214173 plugins : [
215- replace ( {
216- values : {
217- WORKER_DOM_DEBUG : false ,
218- } ,
219- preventAssignment : true ,
220- } ) ,
174+ replacePlugin ( ) ,
221175 babelPlugin ( {
222176 transpileToES5 : true ,
223177 allowConsole : false ,
@@ -234,12 +188,7 @@ const ESModules = [
234188 sourcemap : true ,
235189 } ,
236190 plugins : [
237- replace ( {
238- values : {
239- WORKER_DOM_DEBUG : true ,
240- } ,
241- preventAssignment : true ,
242- } ) ,
191+ replacePlugin ( { debug : true } ) ,
243192 babelPlugin ( {
244193 transpileToES5 : true ,
245194 allowConsole : true ,
@@ -258,12 +207,7 @@ const IIFEModules = [
258207 sourcemap : true ,
259208 } ,
260209 plugins : [
261- replace ( {
262- values : {
263- WORKER_DOM_DEBUG : false ,
264- } ,
265- preventAssignment : true ,
266- } ) ,
210+ replacePlugin ( ) ,
267211 babelPlugin ( {
268212 transpileToES5 : true ,
269213 allowConsole : false ,
@@ -280,12 +224,7 @@ const IIFEModules = [
280224 sourcemap : true ,
281225 } ,
282226 plugins : [
283- replace ( {
284- values : {
285- WORKER_DOM_DEBUG : true ,
286- } ,
287- preventAssignment : true ,
288- } ) ,
227+ replacePlugin ( { debug : true } ) ,
289228 babelPlugin ( {
290229 transpileToES5 : true ,
291230 allowConsole : true ,
0 commit comments