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

enhanced-magic-string

Rust based magic-string implementation with sourcemap chains support

16 releases

new 0.0.15 Jul 15, 2024
0.0.14 Apr 21, 2024
0.0.12 Nov 30, 2023
0.0.0 Oct 31, 2023

#335 in Web programming

Download history 685/week @ 2024-03-25 355/week @ 2024-04-01 888/week @ 2024-04-08 634/week @ 2024-04-15 621/week @ 2024-04-22 612/week @ 2024-04-29 436/week @ 2024-05-06 257/week @ 2024-05-13 580/week @ 2024-05-20 194/week @ 2024-05-27 218/week @ 2024-06-03 364/week @ 2024-06-10 414/week @ 2024-06-17 761/week @ 2024-06-24 800/week @ 2024-07-01 1019/week @ 2024-07-08

3,016 downloads per month
Used in 21 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
~297K SLoC