index-file-webpack-plugin

A webpack resolver plugin to specify directory index file.


Keywords
index, main, webpack
License
MIT
Install
npm install index-file-webpack-plugin@0.2.1

Documentation

index-file-webpack-plugin

Build Status Version License

A webpack resolver plugin to specify directory index file.

Install

npm i -D index-file-webpack-plugin

webpack config

var IndexFilePlugin = require('index-file-webpack-plugin')
var webpack = require('webpack')
{
  plugins: [
    new webpack.ResolverPlugin([
      new IndexFilePlugin([
        '[name].js',  // '[name]' is directory name.
        'main.js',
        'index.js'
      ])
    ])
  ]
}

webpack2 config

var IndexFilePlugin = require('index-file-webpack-plugin')
var webpack = require('webpack')
{
  resolve: {
    plugins: [
      new IndexFilePlugin([
        '[name].js',  // '[name]' is directory name.
        'main.js',
        'index.js'
      ])
    ]
  }
}