vite-plugin-encoding
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

Add charset encoding to Vite packaged product files

English | 简体中文

GitHub tag License

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

Package Sidebar

Install

npm i vite-plugin-encoding

Weekly Downloads

24

Version

1.0.0

License

MIT

Unpacked Size

5.88 kB

Total Files

7

Last publish

Collaborators

  • dktluo