How to use the mobile-detect/mobile-detect.min.js function in mobile-detect

To help you get started, we’ve selected a few mobile-detect examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Rebelizer / pellet / src / manifest.js View on Github external
}

        if(fs.existsSync(path.resolve(options.projectRootPath, 'node_modules', 'pellet', 'node_modules', 'messageformat'))) {
          externalDependencies.messageformat = path.join('pellet', 'node_modules', 'messageformat');
        } else {
          externalDependencies.messageformat = path.resolve(__dirname, '..', 'node_modules', 'messageformat');
        }

        if(fs.existsSync(path.resolve(options.projectRootPath, 'node_modules', 'pellet', 'node_modules', 'superagent'))) {
          externalDependencies.superagent = path.join('pellet', 'node_modules', 'superagent');
        } else {
          externalDependencies.superagent = path.resolve(__dirname, '..', 'node_modules', 'superagent');
        }

        if (fs.existsSync(path.resolve(options.projectRootPath, 'node_modules', 'pellet', 'node_modules', 'mobile-detect', 'mobile-detect.min.js'))) {
          externalDependencies['mobile-detect/mobile-detect.min.js'] = path.join('pellet', 'node_modules', 'mobile-detect', 'mobile-detect.min.js');
        } else {
          externalDependencies['mobile-detect/mobile-detect.min.js'] = path.resolve(__dirname, '..', 'node_modules', 'mobile-detect', 'mobile-detect.min.js');
        }
      } else {
        externalDependencies = {
          React: 'react/addons',
          react: 'react/addons',
          intl: 'intl',
          superagent:'superagent',
          messageformat: 'messageformat',
          ejs: 'ejs'
        };

        //if (!fs.existsSync(path.resolve(__dirname, '..', 'node_modules', 'mobile-detect', 'mobile-detect.min.js'))) {
        //  externalDependencies['mobile-detect/mobile-detect.min.js'] = path.resolve(__dirname, '..', 'node_modules', 'mobile-detect', 'mobile-detect.min.js');
        //}

mobile-detect

Device detection (phone, tablet, desktop, mobile grade, os, versions)

MIT
Latest version published 4 years ago

Package Health Score

58 / 100
Full package analysis