A webpack resolver plugin to specify directory index file.
npm i -D index-file-webpack-plugin
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'
])
])
]
}
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'
])
]
}
}