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)
|
6 | for the bundle and can be used multiple times to define multiple entry points.
|
7 |
|
8 | ## Setup
|
9 |
|
10 | ```bash
|
11 | npm install --save-dev @packmule/entry-pack
|
12 | ```
|
13 |
|
14 | ## API
|
15 |
|
16 | ```ts
|
17 | EntryPack(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 |
|
28 | Set single entry point and generate an `app` bundle.
|
29 |
|
30 | ```ts
|
31 | import Packmule from '@packmule/core';
|
32 | import EntryPack from '@packmule/entry-pack';
|
33 |
|
34 | const packmule = new Packmule();
|
35 | packmule.register(new EntryPack('assets/entry.ts', 'app'));
|
36 | return packmule.generate();
|
37 | ```
|
38 |
|
39 | **Example**
|
40 |
|
41 | Set multiple entrypoints and generate a `one` and a `two` bundle.
|
42 |
|
43 | ```ts
|
44 | import Packmule from '@packmule/core';
|
45 | import EntryPack from '@packmule/entry-pack';
|
46 |
|
47 | const packmule = new Packmule();
|
48 | packmule.register(new EntryPack('assets/one.ts'));
|
49 | packmule.register(new EntryPack('assets/two.ts'));
|
50 | return 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/)
|