UNPKG

1.28 kBMarkdownView Raw
1# @pika/plugin-bundle-web
2
3> A [@pika/pack](https://github.com/pikapkg/pack) build plugin.
4> Adds a bundled Web distribution to your package, built & optimized to run in most web browsers (and bundlers). Useful for hosting on a CDN like UNPKG and/or when package dependencies aren't written to run natively on the web.
5
6
7## Install
8
9```sh
10# npm:
11npm install @pika/plugin-bundle-web --save-dev
12# yarn:
13yarn add @pika/plugin-bundle-web --dev
14```
15
16
17## Usage
18
19```json
20{
21 "name": "example-package-json",
22 "version": "1.0.0",
23 "@pika/pack": {
24 "pipeline": [
25 ["@pika/plugin-standard-pkg"],
26 ["@pika/plugin-build-web"],
27 ["@pika/plugin-bundle-web"]
28 ]
29 }
30}
31```
32
33For more information about @pika/pack & help getting started, [check out the main project repo](https://github.com/pikapkg/pack).
34
35
36## Result
37
381. Adds a web bundled distribution to your built package: `dist-web/index.bundled.js`
39 1. ES Module (ESM) Syntax
40 1. Transpiled to run on all browsers where ES Module syntax is supported.
41 1. All dependencies inlined into this file.
42
43Note that this does not add or modify the "module" entrypoint to your package.json. Bundles should continue to use the "module" entrypoint, while this build can be loaded directly in the browser (from a CDN like UNPKG).
\No newline at end of file