Introducing The Sweep: OX’s New Live Security Research Series
Register Now
Breaking: The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Read the Report
Are you exposed? Connect your apps in minutes.
Scan your apps free

rolldown-require

Latest version: v2.1.8-dev.20261129.1

Overview

Last scanned
29 Nov 2026
Published
29 Nov 2026
npm package Publisher: icebreaker
529 Stars
33 Forks
45 Versions
29.4K Downloads
TypeScript Repo language

Scan summary

rolldown-require was last scanned on 29 Nov 2026 at version 2.1.8-dev.20261129.1. Risk score 0 of 100. No malicious behavior was detected.

  • Releases: 45 versions; the latest 5 were published within 6 days (24–29 Nov 2026).
  • Findings: No rules fired in version 2.1.8-dev.20261129.1.
  • Downloads: 29,441 downloads.

Versions

45 versions published
Versions and the rules that fired in each
VersionPublishedStatus
2.1.8-dev.20261129.1 LATEST 29 Nov 2026 No rules fired
2.1.8-dev.20261128.1 28 Nov 2026 No rules fired
2.1.8-dev.20261127.1 27 Nov 2026 No rules fired
2.1.7 25 Nov 2026 Not shown
2.1.7-dev.20261124.1 24 Nov 2026 Not shown

No rules fired in 2.1.8-dev.20261129.1

Findings

Findings for v2.1.8-dev.20261129.1. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.

The score describes 2.1.8-dev.20261129.1; other versions have their own rules, not their own score.

README

The publisher’s own README, as collected from the registry.

rolldown-require

English | 中文

jsDocs.io

HomePage

Use Case

Recently, the rolldown-vite project needed to load user-provided configuration files. However, simply using require() was not sufficient, because the configuration files might not be CommonJS modules—they could be in .mjs format or even written in TypeScript. That’s where the rolldown-require package comes in, enabling you to load configuration files of any format.

Previously, vite introduced the bundle-require solution based on esbuild. Meanwhile, rolldown-require is an implementation based on rolldown, providing a similar API but with a significantly different implementation.

How it works

  • Bundles your file using rolldown, excluding node_modules (since bundling those can cause problems)

    • __filename, __dirname, and import.meta.url are replaced with the source file’s value rather than the temporary output file’s value.
  • Outputs the file in esm format if possible (for .ts and .js inputs).

  • Loads the output file using import() when possible.

  • Returns the loaded module and its dependencies (imported files).

Install

npm i rolldown-require rolldown

Note: rolldown is a peer dependency.

Usage

import { bundleRequire } from 'rolldown-require'

const { mod } = await bundleRequire({
  filepath: './project/vite.config.ts',
})

Options

import type { ExternalOption, InputOptions, OutputOptions } from 'rolldown'

export type RequireFunction = (
  outfile: string,
  ctx: { format: 'cjs' | 'esm' },
) => any

export type GetOutputFile = (filepath: string, format: 'esm' | 'cjs') => string

export interface Options {
  cwd?: string
  /**
   * The filepath to bundle and require
   */
  filepath: string
  /**
   * The `require` function that is used to load the output file
   * Default to the global `require` function
   * This function can be asynchronous, i.e. returns a Promise
   */
  require?: RequireFunction
  /**
   * esbuild options
   *
   */
  rolldownOptions?: {
    input?: InputOptions
    output?: OutputOptions
  }

  /**
   * Get the path to the output file
   * By default we simply replace the extension with `.bundled_{randomId}.js`
   */
  getOutputFile?: GetOutputFile

  /** External packages */
  external?: ExternalOption

  /**
   * A custom tsconfig path to read `paths` option
   *
   * Set to `false` to disable tsconfig
   */
  tsconfig?: string | false

  /**
   * Preserve compiled temporary file for debugging
   * Default to `process.env.BUNDLE_REQUIRE_PRESERVE`
   */
  preserveTemporaryFile?: boolean

  /**
   * Provide bundle format explicitly
   * to skip the default format inference
   */
  format?: 'cjs' | 'esm'

}

API

https://www.jsdocs.io/package/rolldown-require

Inspirations

  • Thanks to rolldown for providing an excellent bundling experience.
  • Thanks to rolldown-vite for offering a direct file loading solution.
  • Thanks to bundle-require for providing inspiration for the API design and configuration options.

Contributing

This library is published as part of weapp-vite.

The library is under active development. If you encounter any issues or have suggestions, please feel free to open an issue on GitHub Issues.

Benchmarks

pnpm --filter rolldown-require-bench benchmark (10 cold iterations, local M3, Node 22.21.1):

Scenario: tiny-static (25 modules)
rolldown-require  | avg 60.52ms | median 58.36ms | deps 26 | rssΔ median 1.02 MB
unrun             | avg 61.16ms | median 61.32ms | deps 26 | rssΔ median 0.64 MB

Scenario: medium-mixed (100 modules, dynamic import every 10)
rolldown-require  | avg 49.85ms | median 46.38ms | deps 102 | rssΔ median 2.29 MB
unrun             | avg 52.30ms | median 30.49ms | deps 101 | rssΔ median 1.44 MB

Scenario: large-static (200 modules)
rolldown-require  | avg 55.47ms | median 45.89ms | deps 201 | rssΔ median 2.86 MB
unrun             | avg 64.54ms | median 50.02ms | deps 201 | rssΔ median 1.33 MB

Notes:

  • Fixtures are synthetic TS module graphs (static and mixed dynamic imports) generated in benchmarks/rolldown-require-bench/benchmark/index.mjs.
  • Each unrun iteration clears .unrun caches to force cold runs. Use BENCH_ITERATIONS to change repetitions.
Takeaways
  • With 10 cold iterations on synthetic graphs, rolldown-require remains generally faster (avg/median) across scenarios; unrun shows lower RSS deltas.
  • Dependency counts align (same or near-same), indicating comparable graph coverage.
  • Numbers come from benchmarks/rolldown-require-bench/benchmark/index.mjs on M3/Node 22.21.1; rerun on your workloads for final decisions.
Cache
  • cache: true or { enabled: true, dir?, reset?, onEvent? } enables persistent bundled output (default dir: nearest node_modules/.rolldown-require-cache or OS tmp). Validates mtime/size of entry + deps before reuse; falls back to rebuild when stale.

License

MIT © sonofmagic

OX Radar and Response Center

Find threats in your stack.

OX Radar can check high-priority threats, like critical package CVEs, against your context.

Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.

Where it’s listed

The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).

  • npm rolldown-require

References

The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.

Powered by Read the latest findings

Scan your whole stack

Group 1261154050 1
Group 1261154050
 

From OX Research Newsroom

Ethersphere Hijacked With Crypto Stealing Malware (1)
npm

Ethersphere Hijacked With Crypto Stealing Malware Via Github & npm

Copy of Template Design OX Blog (1)
Research

Thousands Of GitHub Accounts Hijacked With wfx-loot CI Secret Stealing Malware Via GitHub Actions & npm

Copy of Template Design OX Blog (2)
Research

NGINX2Root: Five Critical NGINX Flaws Expose Web Servers to Remote Code Execution

Frame 2085668439 (1)
Group 1261154229