1.0.1 • Published 4 years ago

javascript-obfuscator-metro-plugin v1.0.1

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

Javascript Obfuscator Metro Plugin

This metro plugin protects your React Native bundle using javascriptobfuscator.com.

Usage

Include the plugin in your metro.config.js:

const jsoMetroPlugin = require('javascript-obfuscator-metro-plugin')(
  {
    APIKey: undefined, /* required */ 
    APIPwd: undefined, /* required */ 
    Name: 'My Project', /* optional */ 
    KeepComment: false, /* optional */
    EncodeStrings: false, /* optional */
    MoveStrings: true, /* optional */
    ReplaceNames: true, /* optional */
    RenameGlobals: true, /* optional */
    DeepObfuscate: true, /* optional */
    ReorderCode: true, /* optional */
    MoveMembers: true, /* optional */
    RenameMembers: true, /* optional */
    OptimizationMode: 'Auto', /* optional */
  },
  {
    runInDev: false, /* optional */
  }
);

module.exports = {
  transformer: {
    getTransformOptions: async () => ({
      transform: {
        experimentalImportSupport: false,
        inlineRequires: false,
      },
    }),
  },
  ...jsoMetroPlugin
};

For configuration docs see: https://service.javascriptobfuscator.com/httpapi.asmx?op=JSOExecute and https://javascriptobfuscator.com/docs/