rollup / plugins

🍣 The one-stop shop for official Rollup plugins
MIT License
3.57k stars 567 forks source link

fix(dsv): strip bom from csv/tsv files if necessary #1745

Open CrazyOrr opened 2 days ago

CrazyOrr commented 2 days ago

Rollup Plugin Name: dsv

This PR contains:

Are tests included?

Breaking Changes?

If yes, then include "BREAKING CHANGES:" in the first commit message body, followed by a description of what is breaking.

List any relevant issue numbers:

Description

Excel saves UTF-8 CSV files with a BOM. When such files are parsed, the key corresponding to the first column has 0xFEFF as its first character, which leads to keyName became "keyName" (double-quoted).

As this reply suggest, we should use strip-bom to remove the BOM if necessary.