1.0.0 • Published 3 years ago
vite-plugin-encodings v1.0.0
Import modules from CDN with vite plugin
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-dev
or yarn
yarn add vite-plugin-encoding -D
ReactUse 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 |
1.0.0
3 years ago