@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()
        ]),
        ...
      ]
    };

    Install

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

    DownloadsWeekly Downloads

    290

    Version

    2.0.3

    License

    Apache-2.0

    Last publish

    Collaborators

    • elasticthomaskim
    • geekbydefault
    • phoey1
    • verogo
    • brianvans
    • breehall
    • trevorpierce
    • glitteringkatie
    • chandlerprall
    • snide
    • chrisronline
    • cchaos
    • jen-huang
    • spalger
    • delvedor
    • courtewing
    • lukasolson
    • ccowan
    • cjcenizal
    • jbudz
    • tylersmalley
    • thomasneirynck
    • weltenwort
    • pugnascotia
    • zinckiwi
    • brandon.kobel
    • nreese
    • elasticdog
    • mgreau
    • fatmcgav
    • mindbat
    • itsmed
    • tylerjl
    • chris.koehnke.at.elastic
    • jonahbull
    • jarpy
    • leathekd
    • drewr
    • nyurik
    • crazybus
    • lukeelmers
    • ddillinger
    • joshdover
    • jasonstoltz
    • bamieh
    • markov00
    • thompsongl
    • ryan.haywood
    • olksdr
    • fxdgear
    • joshmock
    • vignesh.shanmugam
    • watson
    • rhodesjason
    • nik9000
    • jmlrt
    • eliperelman
    • mattkime
    • constancecchen
    • yakhinvadim
    • afoucret
    • nickpeihl
    • axw
    • mistic
    • elasticmachine
    • gtback
    • johannes.reuter.elastic
    • pickypg
    • gmmorris
    • richard.kuzsma
    • alanstorm
    • trentm
    • andrewvc-elastic
    • jorge.sanz
    • stratoula
    • nkammah
    • streamich
    • nickofthyme
    • chloeruka