#source-map #build #build-tool #web #farm #chain #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

#381 in Web programming

Download history 371/week @ 2024-09-19 395/week @ 2024-09-26 204/week @ 2024-10-03 522/week @ 2024-10-10 1008/week @ 2024-10-17 478/week @ 2024-10-24 930/week @ 2024-10-31 596/week @ 2024-11-07 868/week @ 2024-11-14 995/week @ 2024-11-21 361/week @ 2024-11-28 486/week @ 2024-12-05 630/week @ 2024-12-12 809/week @ 2024-12-19 354/week @ 2024-12-26 527/week @ 2025-01-02

2,356 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–19MB
~275K SLoC