# webpack-directory-name-as-main **Repository Path**: mirrors_elastic/webpack-directory-name-as-main ## Basic Information - **Project Name**: webpack-directory-name-as-main - **Description**: Teach webpack to use the name of the directory as the main file for a module - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-08-08 - **Last Updated**: 2025-09-27 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # @elastic/webpack-directory-name-as-main Teach webpack to use a file with the same name as the directory if that directory is required and it doesn't have an index.js file. This allows you to write: `require('lib/ReallyImportantModule')` inorder to require: `lib/ReallyImportantModule/ReallyImportantModule.js` This module is designed to be used as strategy for a `webpack.ResolverPlugin` like so: ```js var DirectoryNameAsMain = require('@elastic/webpack-directory-name-as-main'); var webpackConfig = { entry: ..., plugins: [ new webpack.ResolverPlugin([ new DirectoryNameAsMain() ]), ... ] }; ```