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

enhanced-magic-string

Rust based magic-string implementation with sourcemap chains support

17 releases

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

#349 in Web programming

Download history 800/week @ 2024-07-01 1019/week @ 2024-07-08 1243/week @ 2024-07-15 822/week @ 2024-07-22 684/week @ 2024-07-29 474/week @ 2024-08-05 217/week @ 2024-08-12 448/week @ 2024-08-19 436/week @ 2024-08-26 348/week @ 2024-09-02 540/week @ 2024-09-09 396/week @ 2024-09-16 489/week @ 2024-09-23 180/week @ 2024-09-30 480/week @ 2024-10-07 698/week @ 2024-10-14

1,905 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

~10–18MB
~279K SLoC