webpack-default-entry
v1.0.0-beta.1
Published
According to a series of default rules, return the list of available entry files
Readme
webpack-default-entry
According to a series of default rules, return the list of available entry files
Installation
Use the package manager npm to install webpack-default-entry.
npm install webpack-default-entryUsage
import getDefaultEntryFile webpack-default-entry
const entryFiles=getDefaultEntryFile()Options
You can pass a hash of configuration options to getEntryFile.
Allowed values are as follows
|Name|Type|Default|Description|
|:--:|:--:|:-----:|:----------|
|cwd|{String}|process.cwd()|The current working directory in which to search|
|pages|{{Array.<{entry:string, template?:string,template?:string, title?:string, chunks?:string}>}}|[{entry:'src/index.js',template:'public/index.html'}]|An object that specifies its entry, template, filename, title and chunks (all optional except entry). Any other properties added beside those will also be passed directly to html-webpack-plugin, allowing user to customize said plugin;具体可参考|
Default Query rules
Query file suffix is [js,ts,jsx,tsx,vue]
- Get the pages field configured in
package.jsonin the directory, Not found, go to the next step - Treat as single page mode by default, find
src/index${suffix},go to the next step - Treat as multi-page mode,Find all sub-directory information under the pages directory, such as
src/pages/home/(home|index).${suffix}
Remarks Query file default suffix is [js,ts,jsx,tsx,vue]
