1 | # Entry Pack [![npm-latest]][npm]
|
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 | ## Overview
|
9 |
|
10 | - [Setup](#setup)
|
11 | - [API](#api)
|
12 | - [Usage](#usage)
|
13 | - [License](#license)
|
14 |
|
15 | ## Setup
|
16 |
|
17 | `Entry Pack` is included in the [`complete`][edition-complete] and [`default`][edition-default] editions.
|
18 |
|
19 | **Current Release**
|
20 |
|
21 | ```bash
|
22 | npm install --save-dev @packmule/entry-pack
|
23 | ```
|
24 |
|
25 | **Nightly Build**
|
26 |
|
27 | ```bash
|
28 | npm install --save-dev @packmule/entry-pack@nightly
|
29 | ```
|
30 |
|
31 | ## API
|
32 |
|
33 | ```typescript
|
34 | EntryPack(path: string, name?: string)
|
35 | ```
|
36 |
|
37 | ## Options
|
38 |
|
39 | - **root** - _Used to build an absolute path of the configured entry file path._
|
40 |
|
41 | ## Usage
|
42 |
|
43 | **Example**
|
44 |
|
45 | Set single entry point and generate an `app` bundle.
|
46 |
|
47 | ```typescript
|
48 | import Packmule from '@packmule/core';
|
49 | import EntryPack from '@packmule/entry-pack';
|
50 |
|
51 | const packmule = new Packmule();
|
52 | packmule.add(new EntryPack('assets/entry.ts', 'app'));
|
53 | return packmule.generate();
|
54 | ```
|
55 |
|
56 | **Example**
|
57 |
|
58 | Set multiple entrypoints and generate a `one` and a `two` bundle.
|
59 |
|
60 | ```typescript
|
61 | import Packmule from '@packmule/core';
|
62 | import EntryPack from '@packmule/entry-pack';
|
63 |
|
64 | const packmule = new Packmule();
|
65 | packmule.add(new EntryPack('assets/one.ts'));
|
66 | packmule.add(new EntryPack('assets/two.ts'));
|
67 | return packmule.generate();
|
68 | ```
|
69 |
|
70 | ## License
|
71 |
|
72 | [MIT](https://choosealicense.com/licenses/mit/)
|
73 |
|
74 | ---
|
75 |
|
76 | [<img src="https://avatars.githubusercontent.com/u/4364197?s=64">](https://www.pixelart.at/)
|
77 |
|
78 | [packmule-hints]: https://www.npmjs.com/package/@packmule/core#hints
|
79 | [packmule-api]: https://www.npmjs.com/package/@packmule/core#api
|
80 | [npm]: https://www.npmjs.com/package/@packmule/entry-pack
|
81 | [npm-latest]: https://img.shields.io/npm/v/@packmule/entry-pack/latest?color=%230AC2FF&label=release&style=for-the-badge
|
82 | [edition-default]: https://www.npmjs.com/package/@packmule/default
|
83 | [edition-complete]: https://www.npmjs.com/package/@packmule/complete
|