@@ -97,6 +97,7 @@ module.exports = (env, argv) => {
9797 '**/pdf_viewer.html' ,
9898 ]
9999 } ;
100+ const pluginsForLastModule = [ ] ;
100101 if ( browser === "chrome" ) {
101102 pagesCopyOptions . ignore = [ ] ;
102103 entry [ 'pages/neovim' ] = './src/pages/neovim.js' ;
@@ -105,6 +106,22 @@ module.exports = (env, argv) => {
105106 }
106107 if ( browser !== "safari" ) {
107108 entry [ 'pages/markdown' ] = './src/content_scripts/markdown.js' ;
109+ if ( mode === "production" ) {
110+ pluginsForLastModule . push (
111+ new FileManagerPlugin ( {
112+ events : {
113+ onEnd : {
114+ archive : [
115+ {
116+ source : buildPath ,
117+ destination : `${ buildPath } /sk.zip`
118+ } ,
119+ ] ,
120+ } ,
121+ } ,
122+ } )
123+ ) ;
124+ }
108125 } else {
109126 pagesCopyOptions . ignore . push ( '**/markdown.html' ) ;
110127 pagesCopyOptions . ignore . push ( '**/donation.png' ) ;
@@ -177,24 +194,7 @@ module.exports = (env, argv) => {
177194 ]
178195 } )
179196 ]
180- } ] ;
181- if ( browser !== "safari" && mode === "production" ) {
182- modules [ 0 ] . plugins . push (
183- new FileManagerPlugin ( {
184- events : {
185- onEnd : {
186- archive : [
187- {
188- source : buildPath ,
189- destination : `${ buildPath } /sk.zip`
190- } ,
191- ] ,
192- } ,
193- } ,
194- } )
195- ) ;
196- }
197- modules . push ( {
197+ } , {
198198 devtool : false ,
199199 output : {
200200 path : buildPath ,
@@ -227,9 +227,10 @@ module.exports = (env, argv) => {
227227 extractComments : false ,
228228 } ) ] ,
229229 } ,
230+ plugins : pluginsForLastModule ,
230231 experiments : {
231232 outputModule : true ,
232233 }
233- } ) ;
234+ } ] ;
234235 return modules ;
235236} ;
0 commit comments