How to use the enhanced-resolve/lib/getPaths.basename function in enhanced-resolve

To help you get started, we’ve selected a few enhanced-resolve 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 shaketbaby / directory-named-webpack-plugin / index.js View on Github external
.tapAsync("DirectoryNamedWebpackPlugin", (request, resolveContext, callback) => {
      if (options.ignoreFn && options.ignoreFn(request)) {
        return callback();
      }
  
      var dirPath = request.path;
      var dirName = basename(dirPath);
      var attempts = [];
  
      // return if path matches with excludes
      if (options.exclude && options.exclude.some(function(exclude) {
        return dirPath.search(exclude) >= 0 || stringIncludes(dirPath, exclude);
      })) {
        return callback();
      }
  
      // return if path doesn't match with includes
      if (options.include && !options.include.some(function(include) {
        return dirPath.search(include) >= 0 || stringIncludes(dirPath, include);
      })) {
        return callback();
      }
github DefinitelyTyped / DefinitelyTyped / enhanced-resolve / lib / lib-tests.ts View on Github external
DescriptionFileUtils.cdUp('./lib');
DescriptionFileUtils.getField({}, 'hi');
DescriptionFileUtils.loadDescriptionFile(resolve.ResolverFactory.createResolver({
    extensions: [''],
    fileSystem: {} as AbstractInputFileSystem
}), './lib', ['file'], function () { });

const dplugin1 = new DirectoryExistsPlugin('string', 'string');

const fplugin = new FileExistsPlugin('string', 's');

const fplugin2 = new FileKindPlugin('string', 's');

getPaths('./lib');

basename('./lib');

globToRegExp('lib/**');

const jplugin = new JoinRequestPlugin('string', 's');

const lplugin = new LogInfoPlugin('string');

const mplugin = new MainFieldPlugin('string', {
    name: 'hi',
    forceRelative: false
}, 's');

const mplugin2 = new ModuleAppendPlugin('string', 'ap', 's');

const mplugin3 = new ModuleKindPlugin('string', 's');
github sebastiandeutsch / react-redux-starter / DirectoryNamedWebpackPlugin.js View on Github external
resolver.plugin("directory", function(request, callback) {
    var fs = resolver.fileSystem;
    var topLevelCallback = callback;
    var filename = basename(request.path);

    var filePath = resolver.join(request.path, filename);

    var obj = assign({}, request, {
      path: filePath,
      relativePath: request.relativePath && resolver.join(request.relativePath, filename)
    });
    resolver.doResolve("raw-file", obj, "using path: " + filePath, callback);
  });
};