We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
charset
I am using this plugin to compile one of my locale file which contains utf-8 charset instead of simple ascii word.
utf-8
Say we have this file:
locale.zh_CN.ts
export default { picker: { confirm: "确定", clear: "清除", }, // ... }
If I run the compiler with options:
build.js
const path = require('path') const { nodeResolve } = require('@rollup/plugin-node-resolve') const rollup = require('rollup') // const typescript = require('rollup-plugin-typescript2') const esbuild = require('rollup-plugin-esbuild') const root = path.resolve(__dirname, '..'); const file = process.argv[2]; const defaultOpts = { input: path.resolve(root, file), plugins: [ nodeResolve(), esbuild() ], external() { return true }, } const run = async (name) => { const esm = { format: 'es', file: `es/${name}`, }; const cjs = { format: 'cjs', file: `lib/${name}`, exports: 'named', } const bundle = await rollup.rollup(defaultOpts); await Promise.all([bundle.write(esm), bundle.write(cjs)]); console.log(name, 'build finished'); } run(`locale.zh_CN.ts`)
Which produces:
export default { colorpicker: { confirm: "\u786E\u5B9A", clear: "\u6E05\u7A7A" } }
Per Charset for esbuild, esbuild allows user to pass an option called charset. Should we add an option for users to pass charset to esbuild ?
esbuild
The text was updated successfully, but these errors were encountered:
I've created a PR, because I also need this feature.
My use case is that my code includes a HTML entities parser, and escaping all those Unicode characters adds several KBs to my bundle.
Sorry, something went wrong.
feat: add charset option (#267) (#330)
d39fed7
Resolved in #330
No branches or pull requests
Background:
I am using this plugin to compile one of my locale file which contains
utf-8
charset instead of simple ascii word.Example
Say we have this file:
locale.zh_CN.ts
If I run the compiler with options:
build.js
Which produces:
Suggestion
Per Charset for esbuild,
esbuild
allows user to pass an option calledcharset
.Should we add an option for users to pass
charset
toesbuild
?The text was updated successfully, but these errors were encountered: