webpack-plugin-downgrade

0.4.0 • Public • Published

Weex Downgrade Plugin

Usage

// webpack.config.js
var DowngradePlugin = require('webpack-plugin-downgrade')
 
var options = { /* downgrade options */ }
 
module.exports = {
  entry: '...',
  output: '...',
  plugins: [
    new DowngradePlugin(options)
  ]
}

Options

  • force: Force downgrade.
  • condition: Downgrade if the env satisfies the specific condition.

force

new DowngradePlugin({ force: true })

If the force is set to true, it will ignore the condition params.

condition

The format of the condition option is same as the argument of Downgrade.condition().

new DowngradePlugin({
  condition: {
 
    // Any condition is matched will be downgraded.
    ios: {
      osVersion: '>1.0',
      appVersion: '>1.0.0',
      weexVersion: '>1',
      deviceModel: ['iPhone5,1']
    },
 
    android: {
      osVersion: '>1.0',
 
      // Check condition with multiple app.
      // The `MY_APP_A` and `MY_APP_B` is WXEnvironment's appName param.
      appVersion: {
        MY_APP_A: '>1.0.0',
        MY_APP_B: '>3.0.0'
      },
 
      weexVersion: '>1',
      deviceModel: ['G-2PW2100']
    }
  }
})

Dependents (0)

Package Sidebar

Install

npm i webpack-plugin-downgrade

Weekly Downloads

0

Version

0.4.0

License

MIT

Unpacked Size

8.74 kB

Total Files

4

Last publish

Collaborators

  • hanks