How to use the resolve-from.bind function in resolve-from

To help you get started, we’ve selected a few resolve-from 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 storybookjs / storybook / lib / theming / paths.js View on Github external
const { dirname } = require('path');
const resolveFrom = require('resolve-from');

const resolve = resolveFrom.bind(null, __dirname);

// These paths need to be aliased in the manager webpack config to ensure that all
// code running inside the manager uses the *same* versions of each package.
module.exports = {
  '@emotion/core': dirname(resolve('@emotion/core/package.json')),
  '@emotion/styled': dirname(resolve('@emotion/styled/package.json')),
  'emotion-theming': dirname(resolve('emotion-theming/package.json')),
};

resolve-from

Resolve the path of a module like `require.resolve()` but from a given path

MIT
Latest version published 6 years ago

Package Health Score

70 / 100
Full package analysis