1.0.0 • Published 5 years ago
webpack-entry-util v1.0.0
webpack-entry-util
According to a series of default rules, return the list of available entry files
Installation
Use the package manager npm to install webpack-entry-util.
npm install webpack-entry-util
Usage
import entryUtil webpack-entry-util
const entryFiles=entryUtil.getEntryFile(options)
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]
1. Get the pages field configured in package.json
in the directory,
Not found, go to the next step
2. Treat as single page mode by default, find src/index${suffix}
,go to the next step
3. 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
License
1.0.1-beta.0
5 years ago
1.0.0
5 years ago