# webpack-default-entry

> According to a series of default rules, return the list of available entry files

Latest version **1.0.0-beta.1** (published 2020-08-27) · ISC license · 0 weekly downloads

## Install

```sh
npm install webpack-default-entry
pnpm add webpack-default-entry
yarn add webpack-default-entry
bun add webpack-default-entry
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0-beta.1 |
| Published | 2020-08-27 |
| First published | 2020-08-27 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 18 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | kjyzly@163.com |
| Maintainers | kangjy |
| Keywords | webpack, entry |

## Links

- npm: https://www.npmjs.com/package/webpack-default-entry
- npm.io page: https://npm.io/package/webpack-default-entry

## Recent versions

- 1.0.0-beta.1 (latest) — 2020-08-27
- 1.0.0-beta.3 (beta) — 2020-11-06
- 1.0.0-beta.2 — 2020-08-28

## README

# webpack-default-entry

According to a series of default rules, return the list of available entry files

## Installation

Use the package manager [npm](https://github.com/npm/cli) to install webpack-default-entry.

```bash
npm install webpack-default-entry
```

## Usage

```js
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;[具体可参考](https://cli.vuejs.org/config/#pages)|

## 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
[MIT](https://choosealicense.com/licenses/mit/)

---
_Source: https://npm.io/package/webpack-default-entry · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
