JSPM

rolldown-string

0.1.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 29755
  • Score
    100M100P100Q148835F
  • License MIT

undefined

Package Exports

  • rolldown-string
  • rolldown-string/package.json

Readme

rolldown-string

npm version npm downloads Unit Test

A compatibility layer for magic-string to work with Rolldown and other bundlers.

  • In Rolldown, native magic-string is used to optimize performance.
  • If native support is unavailable, it gracefully falls back to the JavaScript implementation of magic-string.

Recommended for use with unplugin.

Install

npm i rolldown-string

Usage

import { generateTransform, rolldownString } from 'rolldown-string'

const yourPlugin = {
  transform(code, id, meta) {
    const s = rolldownString(code, id, meta)

    // ... your transformations

    return generateTransform(s, id)
  },
}

Sponsors

License

MIT License © 2025-PRESENT Kevin Deng