ivang
1 year ago
1286
2
Mix

mix options to not uglify some functions

Posted 1 year ago by ivang

Hi guys, I'm trying to switch off via mix.options the renaming of some specific functions, but when I run a 'npm run prod' the final js is always minified (ok, I need this) and all the original functions name are lost (not good, I have to call some of them)

someone can help me out?

this dosn't work (in the webpack.mix.js)

let mix = require('laravel-mix');


  mix.options({
    uglify: {
      uglifyOptions: {
        mangle: {
          keep_fnames: true,
        }
      }
    }
  });


mix.js('public/js/main.js', 'public/dist/js');


and also this dosn't work


  mix.options({
    uglify: {
      uglifyOptions: {
        keep_fnames: true,
        mangle: {
          reserved : ['name_of_function_iwannakeep']
        }
      }
    }
  });

but event the simpler version with ' uglify : false '

any ideas out there? thank you!

Please sign in or create an account to participate in this conversation.