Registry / devops / bili
library0.0.1b1jsnpmunverified

Bili is a JavaScript library bundler designed for zero-configuration setup, leveraging Rollup under the hood. It automatically handles transformations for JavaScript using Buble, Babel, or TypeScript, and includes built-in support for various CSS preprocessors like Sass, Stylus, Less, and CSS modules. The current stable version is 5.0.5, which was last published in June 2020. This project differentiates itself by aiming for a streamlined, opinionated bundling experience that minimizes boilerplate configuration, providing a user-friendly interface for building libraries with multiple output formats (CJS, ESM, UMD). Despite its initial goal of simplicity and comprehensive features, its development has ceased, leaving it without recent updates or maintenance.

npm install bili
INSTALL
IMPORT
SIG · BILI
B
bili
devopsjavascriptv0.0.1b1
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

build
import { build } from 'bili'
const build = require('bili')
The primary programmatic API for initiating a build. Bili primarily expects ESM for its programmatic API in modern Node.js environments.
defineConfig
import { defineConfig } from 'bili'
import defineConfig from 'bili'
Utility for defining Bili configuration in `bili.config.ts` or `bili.config.js` for type safety and IntelliSense. This is a named export.
Config
import type { Config } from 'bili'
Importing types for configuration objects for use with TypeScript.

Demonstrates both CLI conceptual usage and a runnable programmatic build example for a TypeScript library using `bili.config.ts`.

import { build, defineConfig } from 'bili'; import path from 'path'; import fs from 'fs'; // CLI usage example: bili src/index.ts --format cjs,esm // To run this programmatically: const projectRoot = path.resolve('./temp-bili-project'); const sourceFile = path.join(projectRoot, 'src', 'index.ts'); const configFile = path.join(projectRoot, 'bili.config.ts'); fs.mkdirSync(path.join(projectRoot, 'src'), { recursive: true }); fs.writeFileSync(sourceFile, 'export const greet = (name: string) => `Hello, ${name}!`;'); fs.writeFileSync(configFile, ` import { defineConfig } from 'bili'; export default defineConfig({ input: 'src/index.ts', output: { format: ['cjs', 'esm'], dir: 'dist', fileName: '[name].[format].js', }, plugins: { typescript2: true, // Use rollup-plugin-typescript2 }, }); `); console.log('Building library with Bili...'); const runBuild = async () => { try { // In a real scenario, you'd call build directly with your config object or let it find bili.config.ts // For this example, we'll simulate the execution context assuming bili is run from projectRoot await build({ rootDir: projectRoot, configFile: configFile, logLevel: 2 // 0: silent, 1: error, 2: warn, 3: info, 4: debug }); console.log('Build complete! Check the dist folder in', projectRoot); console.log(fs.readFileSync(path.join(projectRoot, 'dist', 'index.cjs.js'), 'utf-8')); console.log(fs.readFileSync(path.join(projectRoot, 'dist', 'index.esm.js'), 'utf-8')); } catch (error) { console.error('Bili build failed:', error); process.exit(1); } finally { // Clean up temporary files/folders for demonstration purposes fs.rmSync(projectRoot, { recursive: true, force: true }); } }; runBuild();
bili --version
Debug
Known issues
breakingVersion 5.0.0 introduced breaking changes by upgrading to the latest versions of Rollup and its plugins. This may require updating existing Bili configurations or Rollup plugin options to be compatible with the newer ecosystem.
fix
Review the changelog for specific Rollup and plugin updates in v5.0.0 and adjust your `bili.config.js`/`.ts` or command-line arguments accordingly. Refer to the respective Rollup plugin documentation for new options or deprecated APIs.
affects: >=5.0.0
breakingThe Bili project is currently abandoned, with its last release in June 2020. This means there will be no further updates, security patches, or compatibility fixes for newer Node.js versions, Rollup versions, or other ecosystem tools. Using it in new projects or maintaining it in existing ones carries significant risk of encountering unpatched bugs or breaking incompatibilities.
fix
Consider migrating to actively maintained bundlers like Rollup directly, esbuild, or Vite, which offer similar capabilities and are regularly updated.
affects: >=5.0.5
gotchaBili internally relies on `rollup-plugin-typescript2` for TypeScript bundling and type checking. Issues or warnings from this plugin, such as `objectHashIgnoreUnknownHack` warnings, can arise and may require specific configuration adjustments within your `tsconfig.json` or Bili's plugin options to suppress or resolve.
fix
Consult the `rollup-plugin-typescript2` documentation for specific configurations related to warnings or compatibility issues. Ensure your `tsconfig.json` is correctly configured for your project's needs.
affects: >=4.9.3
Errors
Common errors & fixes
rollup-plugin-typescript2: objectHashIgnoreUnknownHack warning
This warning indicates an internal heuristic used by `rollup-plugin-typescript2` might be less efficient or have unexpected behavior, often related to caching or dependency resolution with TypeScript types.
fix
Ensure `tsconfig.json` is correctly set up. You might be able to configure `rollup-plugin-typescript2` specifically in your `bili.config.js` to adjust its behavior or ignore certain warnings, if such options are exposed by Bili.
Error: Duplicated banner after minified
Bili was observed to inject a bundle banner multiple times, particularly after minification processes, leading to redundant or malformed output files.
fix
This was a bug fixed in Bili v5.0.3. Ensure you are using Bili version `5.0.3` or newer. If the issue persists, manually configure your minifier or Rollup banner options to prevent double-injection, if Bili exposes such granular control.
Incorrect filename for ES module format output
In some cases, Bili generated incorrect or unexpected filenames for ES module (ESM) formatted bundles, which could lead to import resolution issues.
fix
This was a bug fixed in Bili v5.0.5. Update Bili to version `5.0.5` or later. If custom output filenames are desired, carefully configure the `output.fileName` option in `bili.config.js` to specify the desired naming convention, e.g., `[name].[format].js`.
Upgrade
Version history
0.0.1b1latest on npm
Audit
Dependencies
rolluprequiredCore bundling engine.
cacrequiredUsed for command-line argument parsing.
joyconrequiredUsed for loading configuration files.
typescriptoptionalRequired if bundling TypeScript source files.
rollup-plugin-typescript2optionalRecommended TypeScript plugin for type-checking during compilation, used by Bili for .ts files.
Agent activity
5 hits · last 30 days
node
4
Resources
bili — npm install bili · libregistry