@pika/plugin-bundle-web
A @pika/pack plugin: Adds a bundled Web distribution to your package, built & optimized to run in most web browsers (and bundlers).
Last updated a month ago by fredkschott .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @pika/plugin-bundle-web 
SYNC missed versions from official npm registry.

@pika/plugin-bundle-web

A @pika/pack build plugin. 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.

Install

# npm:
npm install @pika/plugin-bundle-web --save-dev
# yarn:
yarn add @pika/plugin-bundle-web --dev

Usage

{
  "name": "example-package-json",
  "version": "1.0.0",
  "@pika/pack": {
    "pipeline": [
      ["@pika/plugin-standard-pkg"],
      ["@pika/plugin-build-web"], // Required to precede in pipeline
      ["@pika/plugin-bundle-web", { /* options (optional) */ }]
    ]
  }
}

For more information about @pika/pack & help getting started, check out the main project repo.

Options

  • "sourcemap" (Default: "true"): Adds a source map for this build.
  • "browser" (Default: false): If true, this plugin will respect the "browser" field in bundled dependencies over the usual "main" Node-specific entrypoint. This may be required for some dependencies, but may cause problems with others. YMMV.
  • "namedExports" (Default: undefined): Ecplicitly specify unresolvable named exports (See rollup-plugin-commonjs for more information).
  • "minify" (Default: true): Specify if bundle should be minifed using terser or not. Can also be terser options object to further tweak minification.
  • "targets" (Default: {"esmodules": true}): The browsers supported/targeted by the build. Defaults to support all browsers that support ES Module (ESM) syntax.
  • "entrypoint": Add a package.json entrypoint for the bundled build. perfect for pointing UNPKG and other CDNs to this build.
    • {"entrypoint: "unpkg"} will create an "unpkg" entrypoint that points to "dist-web/index.bundled.js".
    • {"entrypoint: ["unpkg", "jsdeliver"]} will create both "unpkg" & "jsdeliver" "dist-web/index.bundled.js" entrypoints.

Result

  1. Adds a web bundled distribution to your built package: dist-web/index.bundled.js
  2. ES Module (ESM) syntax
  3. Transpiled to run on all browsers where ES Module syntax is supported.
  4. All dependencies inlined into this file.
  5. Minified using terser (Can optionally be skipped)
  6. (if specified) Adds the file to your specified "entrypoint".

Note 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).

Current Tags

  • 0.6.1                                ...           latest (a month ago)

19 Versions

  • 0.6.1                                ...           a month ago
  • 0.6.0                                ...           3 months ago
  • 0.5.1                                ...           3 months ago
  • 0.5.0                                ...           3 months ago
  • 0.4.0                                ...           5 months ago
  • 0.3.16                                ...           6 months ago
  • 0.3.15                                ...           6 months ago
  • 0.3.14                                ...           8 months ago
  • 0.3.13                                ...           8 months ago
  • 0.3.12                                ...           8 months ago
  • 0.3.11                                ...           8 months ago
  • 0.3.10                                ...           8 months ago
  • 0.3.9                                ...           9 months ago
  • 0.3.8                                ...           9 months ago
  • 0.3.7                                ...           9 months ago
  • 0.3.5                                ...           9 months ago
  • 0.3.4                                ...           9 months ago
  • 0.3.3                                ...           9 months ago
  • 0.3.2                                ...           9 months ago
Maintainers (1)
Downloads
Today 0
This Week 1
This Month 4
Last Day 1
Last Week 2
Last Month 112
Dev Dependencies (6)
Dependents (1)

Copyright 2014 - 2016 © taobao.org |