#source-map #build #build-tool #web #farm #chains #magic-string

enhanced-magic-string

Rust based magic-string implementation with sourcemap chains support

18 releases

0.1.0 Oct 19, 2024
0.0.16 Nov 14, 2024
0.0.15 Jul 15, 2024
0.0.14 Apr 21, 2024
0.0.0 Oct 31, 2023

#535 in Web programming

Download history 519/week @ 2024-10-27 1112/week @ 2024-11-03 666/week @ 2024-11-10 889/week @ 2024-11-17 643/week @ 2024-11-24 369/week @ 2024-12-01 527/week @ 2024-12-08 680/week @ 2024-12-15 742/week @ 2024-12-22 320/week @ 2024-12-29 774/week @ 2025-01-05 311/week @ 2025-01-12 244/week @ 2025-01-19 143/week @ 2025-01-26 290/week @ 2025-02-02 441/week @ 2025-02-09

1,119 downloads per month
Used in 22 crates (via farmfe_core)

MIT license

38KB
1K SLoC

enhanced-magic-string

Rust implementation of https://www.npmjs.com/package/magic-string with original sourcemap chain support. license.

This project is built for the Farm project, which is a extremely fast vite-compatible web build tool written in Rust.

RoadMap

Implement all APIs of magic-string. Bundle will be implemented first.

Bundle

  • addSource
  • generateMap
  • append
  • generateDecodedMap
  • getIndentString
  • indent
  • prepend
  • toString
  • isEmpty
  • length
  • trimLines
  • trim
  • trimStart
  • trimEnd

MagicString

  • addSourcemapLocation
  • append
  • appendLeft
  • appendRight
  • clone
  • generateDecodedMap
  • generateMap
  • getIndentString
  • indent
  • move
  • overwrite
  • update
  • prepend
  • prependLeft
  • prependRight
  • remove
  • lastChar
  • lastLine
  • slice
  • toString
  • isEmpty
  • length
  • trimLines
  • trim
  • trimEndAborted
  • trimEnd
  • trimStartAborted
  • trimStart
  • hasChanged
  • replace
  • replaceAll

Dependencies

~11–20MB
~275K SLoC