@elastic/webpack-directory-name-as-main

2.0.3 • Public • Published

@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:

var DirectoryNameAsMain = require('@elastic/webpack-directory-name-as-main');
var webpackConfig = {
  entry: ...,

  plugins: [
    new webpack.ResolverPlugin([
      new DirectoryNameAsMain()
    ]),
    ...
  ]
};

Dependencies (0)

    Dev Dependencies (5)

    Package Sidebar

    Install

    npm i @elastic/webpack-directory-name-as-main

    Weekly Downloads

    157

    Version

    2.0.3

    License

    Apache-2.0

    Last publish

    Collaborators

    • lenegadewoll
    • cbishopewc
    • cindy_c
    • asnyder-elastic
    • lgestc
    • patryk.kopycinski
    • banerjeesoham004
    • legrego
    • bradtimmerman
    • devcorpio
    • yan.savitski
    • jeramysoucy
    • tkajtoch
    • johnwcambra
    • colleen.mcginnis
    • scottybollinger
    • kyrspl
    • phoey1
    • verogo
    • breehall
    • trevorpierce
    • glitteringkatie
    • jen-huang
    • delvedor
    • lukasolson
    • ccowan
    • jbudz
    • thomasneirynck
    • weltenwort
    • pugnascotia
    • zinckiwi
    • brandon.kobel
    • nreese
    • mgreau
    • jonahbull
    • jarpy
    • leathekd
    • lukeelmers
    • ddillinger
    • joshdover
    • jasonstoltz
    • bamieh
    • markov00
    • joshmock
    • vignesh.shanmugam
    • watson
    • rhodesjason
    • jmlrt
    • mattkime
    • constancecchen
    • afoucret
    • nickpeihl
    • axw
    • mistic
    • elasticmachine
    • gtback
    • pickypg
    • trentm
    • andrewvc-elastic
    • jorge.sanz
    • stratoula
    • nkammah
    • streamich
    • nickofthyme
    • chloeruka