1.0.6 • Published 3 years ago

rem-webpack-plugin v1.0.6

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

NPM NPM

  npm i --save-dev rem-webpack-plugin
  yarn add --dev rem-webpack-plugin

该插件依赖html-webpack-plugin。如未安装,请按照如下方式安装:

  npm i --save-dev html-webpack-plugin
  yarn add --dev html-webpack-plugin

webpack.config.js

const RemWebpackPlugin = require('rem-webpack-plugin')

module.exports = {
  entry: 'index.js',
  output: {
    path: __dirname + '/dist',
    filename: 'main.js'
  },
  plugins: [
    new RemWebpackPlugin()
  ]
}

// width options
module.exports = {
  entry: 'index.js',
  output: {
    path: __dirname + '/dist',
    filename: 'main.js'
  },
  plugins: [
    new RemWebpackPlugin({
        root: 50,
        rootWidth: 375,
        maxWidth: 600
    })
  ]
}
NameTypeDefaultDescription
rootNumber100如果使用了px2rem等类似的插件,请保持root配置一致
rootWidthNumber750页面基础宽度
maxWidthNumber750最大宽度,超过最大宽度时根节点的fontsize值不变
1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago