UNPKG

1.31 kBMarkdownView Raw
1# Entry Pack
2
3> Define an [entry point](https://webpack.js.org/configuration/entry-context/#entry) for webpack.
4
5`Entry Pack` configures the actual [entry point](https://webpack.js.org/concepts/#entry)
6for the bundle and can be used multiple times to define multiple entry points.
7
8## Setup
9
10```bash
11npm install --save-dev @packmule/entry-pack
12```
13
14## API
15
16```ts
17EntryPack(path: string, name?: string)
18```
19
20## Options
21
22- **root** - _Used to build an absolute path of the configured entry file path._
23
24## Usage
25
26**Example**
27
28Set single entry point and generate an `app` bundle.
29
30```ts
31import Packmule from '@packmule/core';
32import EntryPack from '@packmule/entry-pack';
33
34const packmule = new Packmule();
35packmule.register(new EntryPack('assets/entry.ts', 'app'));
36return packmule.generate();
37```
38
39**Example**
40
41Set multiple entrypoints and generate a `one` and a `two` bundle.
42
43```ts
44import Packmule from '@packmule/core';
45import EntryPack from '@packmule/entry-pack';
46
47const packmule = new Packmule();
48packmule.register(new EntryPack('assets/one.ts'));
49packmule.register(new EntryPack('assets/two.ts'));
50return packmule.generate();
51```
52
53## License
54
55[MIT](https://choosealicense.com/licenses/mit/)
56
57---
58
59[<img src="https://www.pixelart.at/fileadmin/images/logo-new/logo.svg" width="150">](https://www.pixelart.at/)