Repository navigation
[@rollup/plugin-replace]do not support replace chinese language #1523
Replies: 2 comments
|
when call plugin transform hook,the chinese in args code is unicode,and the '左边' look like not match chinese unicode |
|
There are two separate matching issues here. With replace({
preventAssignment: true,
delimiters: ['', ''],
values: { '左边': 'xxxx' }
})Empty delimiters also replace substrings ( Your follow-up about escaped Unicode is a second issue: if an earlier transform has already emitted the literal source text values: { [String.raw`\u5DE6\u8FB9`]: 'xxxx' }The spelling/case of that escape must match the generated source; this is more brittle than replacing before escaping. I checked the transform hook directly on Node 24.22.1 with plugin versions 5.0.2 and 6.0.3. Version 6.0.3 replaces the raw |
Uh oh!
There was an error while loading. Please reload this page.
plugins: [ replace({ values: { 左边: "xxxx", }, }), ],App.tsx
<div>左边</div>Expected Behavior
“左边” will be replace to "xxxx"
Actual Behavior
can not replace
Additional Information
All reactions