File tree Expand file tree Collapse file tree
packages/repack/src/commands/common/config Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -26,7 +26,8 @@ function repackTerserMinify(
2626 minimizerOptions : TerserMinifyArgs [ 2 ] ,
2727 extractComments : TerserMinifyArgs [ 3 ]
2828) {
29- return require ( 'terser-webpack-plugin' ) . terserMinify (
29+ const plugin : typeof TerserPlugin = require ( 'terser-webpack-plugin' ) ;
30+ return plugin . terserMinify (
3031 input ,
3132 sourceMap ,
3233 minimizerOptions ,
@@ -35,8 +36,10 @@ function repackTerserMinify(
3536}
3637
3738// read on the main thread only, to keep terser's version in the chunk hash
38- repackTerserMinify . getMinimizerVersion = ( ) =>
39- require ( 'terser-webpack-plugin' ) . terserMinify . getMinimizerVersion ?.( ) ;
39+ repackTerserMinify . getMinimizerVersion = ( ) => {
40+ const plugin : typeof TerserPlugin = require ( 'terser-webpack-plugin' ) ;
41+ return plugin . terserMinify . getMinimizerVersion ?.( ) ;
42+ } ;
4043
4144async function getTerserConfig ( rootDir : string ) {
4245 const TerserPlugin = await getTerserPlugin ( rootDir ) ;
You can’t perform that action at this time.
0 commit comments