Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@ms-cloudpack/bundler-plugin-rollup

Package Overview
Dependencies
Maintainers
2
Versions
238
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ms-cloudpack/bundler-plugin-rollup

A cloudpack plugin for abstracting rollup.

  • 0.0.6
  • npm
  • Socket score

Version published
Maintainers
2
Created
Source

@ms-cloudpack/bundler-plugin-rollup

Provides a Cloudpack bundler abstraction around the Rollup bundler.

Usage

async function bundlePackage(options)

import { bundlePackage } from '@ms-cloudpack/bundler';

async function start() {
  const result = await bundlePackage({
    packagePath: process.cwd(),
    outputPath: path.join(process.cwd(), 'dist'),
    outputType: 'library',
  });

  console.log(result);
}

start();

bundlePackage options

NameTypeDescription
packagePathstringPath to the package root where package.json lives.
forcebooleanBypasses the cache to create bundles.
hashFrom"package-version" | "git"Determines how the cache key is computed for bundle results.
output"library" | "app"

Return object

NameTypeDescription
stats
outputMap

Details

The Cloudpack bundler abstraction is simple and constrained on purpose:

  1. Consume a standard package (app or library) with a minimum set of requirements.
  2. Emits standard ESM bundle.
  3. Leverages package.json and convention as much as possible:

This library has only 2 output modes:

  • library mode - produces a bundle of source which externalizes dependencies and is consumable by the target (browser or node) which can resolve the dependencies through an import maps in the browser or through module resolution in node. The source is unminified.
  • production mode - produces a bundle of source which includes dependencies and is also similarly consum

Package requirements

Discovering entry points

Entry points are discovered by analyzing the package.json. This ensures only explicit entries are bundled.

ESM output

Considerations

Leverage existing task runners

Under the hood, if we want to separate the process into multiple steps, we may consider using task helpers like just-scripts or heft to execute things in the right order. This might help

Splitting the "bundle" abstraction into pre/bundle/post steps

FAQs

Package last updated on 02 Aug 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc