How to use the interpret.jsVariants function in interpret

To help you get started, we’ve selected a few interpret 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 trivago / parallel-webpack / src / loadConfigurationFile.js View on Github external
var jsVars = require('interpret').jsVariants,
    endsWith = require('lodash.endswith'),
    availableExts = Object.keys(jsVars),
    chalk = require('chalk');

// sort extensions to ensure that .babel.js and
// similar ones are always matched before .js
availableExts.sort(function(a, b) {
    var res = -(a.split(/\./).length - b.split(/\./).length);
    // all things being equal, we need to
    // prioritize .js as it is most likely
    if(res === 0) {
        if(a === '.js') {
            return -1;
        }
        if(b === '.js') {
            return 1;
        }
        return 0;
github shipitjs / shipit / packages / shipit-cli / src / cli.js View on Github external
shipit.start(runTasks)
  }
}

function invoke(env) {
  asyncInvoke(env).catch(error => {
    setTimeout(() => {
      throw error
    })
  })
}

const cli = new Liftoff({
  name: 'shipit',
  extensions: interpret.jsVariants,
  v8flags,
})
cli.launch(
  {
    configPath: program.shipitfile,
    require: program.require,
  },
  invoke,
)

interpret

A dictionary of file extensions and associated module loaders.

MIT
Latest version published 2 years ago

Package Health Score

74 / 100
Full package analysis

Popular interpret functions