1.0.0 • Published 4 years ago
vite-plugin-encoding v1.0.0
Add charset encoding to Vite packaged product files
English | 简体中文
Solve the problem that when the server is Content-Type: text/html; charset=GB2312, Chinese garbled characters in the js file introduced by the page cause page rendering failure.
Installation
Install the plugin with npm:
npm install vite-plugin-encoding --save-devor yarn
yarn add vite-plugin-encoding -DReactUse demo
// vite.config.js
import encodingPlugin from 'vite-plugin-encoding'
export default {
plugins: [
encodingPlugin(),
],
}VueUse demo
// vite.config.js
import vue from '@vitejs/plugin-vue'
import encodingPlugin from 'vite-plugin-encoding'
export default {
plugins: [
vue(),
encodingPlugin(),
],
}Options
| Name | Description | Type | Default |
|---|---|---|---|
| charset | charset encoding type | string | utf-8 |