1- const SentryWebpackPlugin = require ( '@sentry/webpack-plugin' ) ;
1+ /* eslint-disable global-require */
2+
3+ // const SentryWebpackPlugin = require('@sentry/webpack-plugin');
24const merge = require ( 'webpack-merge' ) ;
35const webpack = require ( 'webpack' ) ;
6+ const ImageminPlugin = require ( 'imagemin-webpack-plugin' ) . default ;
47const SWPrecacheWebpackPlugin = require ( 'sw-precache-webpack-plugin' ) ;
58const TerserJSPlugin = require ( 'terser-webpack-plugin' ) ;
69const BundleAnalyzerPlugin = require ( 'webpack-bundle-analyzer' )
@@ -10,15 +13,15 @@ const normalizeName = require('webpack/lib/optimize/SplitChunksPlugin')
1013const ManifestPlugin = require ( 'webpack-manifest-plugin' ) ;
1114const CopyWebpackPlugin = require ( 'copy-webpack-plugin' ) ;
1215const VERSION = require ( '@codesandbox/common/lib/version' ) . default ;
13- const childProcess = require ( 'child_process' ) ;
16+ // const childProcess = require('child_process');
1417const commonConfig = require ( './webpack.common' ) ;
1518
1619const publicPath = '/' ;
17- const isMaster =
18- childProcess
19- . execSync ( `git branch | grep \\* | cut -d ' ' -f2` )
20- . toString ( )
21- . trim ( ) === 'master' ;
20+ // const isMaster =
21+ // childProcess
22+ // .execSync(`git branch | grep \\* | cut -d ' ' -f2`)
23+ // .toString()
24+ // .trim() === 'master';
2225
2326const normalize = normalizeName ( { name : true , automaticNameDelimiter : '~' } ) ;
2427
@@ -128,6 +131,7 @@ module.exports = merge(commonConfig, {
128131 // https://github.com/facebookincubator/create-react-app/issues/2612
129132 return ;
130133 }
134+ // eslint-disable-next-line no-console
131135 console . log ( message ) ;
132136 } ,
133137 minify : true ,
@@ -219,6 +223,7 @@ module.exports = merge(commonConfig, {
219223 // https://github.com/facebookincubator/create-react-app/issues/2612
220224 return ;
221225 }
226+ // eslint-disable-next-line no-console
222227 console . log ( message ) ;
223228 } ,
224229 minify : true ,
@@ -349,6 +354,11 @@ module.exports = merge(commonConfig, {
349354 to : 'public/sse-hooks' ,
350355 } ,
351356 ] ) ,
357+ new ImageminPlugin ( {
358+ pngquant : {
359+ quality : '95-100' ,
360+ } ,
361+ } ) ,
352362 // isMaster &&
353363 // new SentryWebpackPlugin({
354364 // include: 'src',
0 commit comments