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

@oribuild/api

Package Overview
Dependencies
Maintainers
1
Versions
466
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@oribuild/api

Provides a Node API surface for the Ori bundler.

  • 0.0.0-pre-alpha.2
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

@oribuild/api

Provides a Node API surface for the Ori bundler.

Usage

import { build } from '@oribuild/api';

async function buildProject() {
  const result = await build({
    absWorkingDir: '/Users/david/git/project',
    outdir: './lib',
    outbase: './src',
    minify: false,
    externals: [],
    entryPoints: {
      index: './src/index.tsx',
    },
  });
}

Incremental build usage

For incremental builds, you can provide an incremental option, and use the rebuild method from the response to trigger a rebuild. Note for incremental builds, you must call dispose on the returned result once you are done with it.

Example:

import { build } from '@oribuild/api';

let result = await build({ ..., incremental: true });

// Kick off an incremental build.
result = result.rebuild();

// Close the session.
result.close();

API

build(options: BuildOptions): Promise<BuildResult>

Builds a project given the provided options, and returns a promise that resolves to the build result.

build options

  • absWorkingDir: The absolute working directory of the project. (The root package folder.)
  • entryPoints: A map of entry points to the absolute path of the source file.
  • outdir: The output directory.
  • outbase: The output base directory relative to the working directory. (E.g. "./src")
  • minify: Whether to minify the output.
  • externals: An array of external modules to exclude from the bundle.
  • incremental: Whether to use incremental build

build output

  • outputFilePaths: The bundle.
  • errors: An array of error definitions.
  • warnings: An array of warning definitions.
  • metafile: string: The bundle stats, if the metafile flag is specified in options.

Note that for incremental builds, the rebuild and dispose methods are available on the returned result.

  • rebuild: () => Promise<BuildResult>: A method to rebuild the bundle quickly after files have changed.
  • dispose: () => void: A method to call in incremental build scenarios when you are done with the result.

FAQs

Package last updated on 07 Sep 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