vite-plugin-qing-flexible
v1.0.1
Published
Vite plugin that automatically injects flexible scripts and converts pixel units to rem units
Downloads
1
Readme
vite-plugin-qing-flexible
Vite plugin that automatically injects flexible scripts and converts pixel units to rem units
Install
$ npm i vite-plugin-qing-flexible -D
# or
$ yarn add vite-plugin-qing-flexible -D
Usage
Config plugin in vite.config.ts
import { defineConfig } from 'vite';
import flexible from 'vite-plugin-qing-flexible';
export default defineConfig({
plugins: [
flexible(),
]},
});
Flexible scripts are automatically injected into the head
<!DOCTYPE html>
<html>
<head>
<!-- Will be generated automatically -->
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no,viewport-fit=cover"
/>
<script>
// flexible script
</script>
</head>
<body></body>
</html>
Resource
- https://github.com/cuth/postcss-pxtorem
- https://github.com/posuihushui/flexible.js