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

enhanced-magic-string

Rust based magic-string implementation with sourcemap chains support

15 releases

new 0.0.14 Apr 21, 2024
0.0.13 Apr 11, 2024
0.0.12 Nov 30, 2023
0.0.0 Oct 31, 2023

#584 in Web programming

Download history 138/week @ 2024-01-01 230/week @ 2024-01-08 313/week @ 2024-01-15 314/week @ 2024-01-22 315/week @ 2024-01-29 254/week @ 2024-02-05 142/week @ 2024-02-12 252/week @ 2024-02-19 115/week @ 2024-02-26 224/week @ 2024-03-04 392/week @ 2024-03-11 597/week @ 2024-03-18 685/week @ 2024-03-25 355/week @ 2024-04-01 888/week @ 2024-04-08 367/week @ 2024-04-15

2,443 downloads per month
Used in 20 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

~10–20MB
~306K SLoC