Skip to content

Latest commit

 

History

History
50 lines (38 loc) · 938 Bytes

README.md

File metadata and controls

50 lines (38 loc) · 938 Bytes

umi-plugin-flexible

umijs plugin that automatically injects flexible scripts and converts pixel units to rem units

Install

$ npm i umi-plugin-flexible -D
# or
$ yarn add umi-plugin-flexible -D

Usage

Config plugin in .umirc.ts

import { defineConfig } from 'umi';

export default defineConfig({
  postcss: {
    rootValue: 37.5,
    propList: ['*'],
  },
  plugins: [require.resolve('umi-plugin-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