weexteam / vue-precompiler-for-apache-weex

vue-precompiler-for-apache-weex is a third party plugin, and is not developed nor maintained by Apache Weex.
MIT License
4 stars 7 forks source link

weex-vue-precompiler

build pkg down Package Quality

weex-vue-precompiler is a node transformer plugin for vue-loader. The main purpose is to precompile nodes for weex-vue-render to reduce performance consumption in render's runtime.

Use this precompiler can save you a lot of render time for weex running on web using weex-vue-render.

How To Use

In you vue-loader config, you can use it like this:

// require and init.
const precompile = require('weex-vue-precompiler')(/*optional config*/)

// in vue config:
{
  optimizeSSR: false,
  postcss: [
    require('postcss-plugin-weex')(),
    require('autoprefixer')({
      browsers: ['> 0.1%', 'ios >= 8', 'not ie < 12']
    }),
    require('postcss-plugin-px2rem')({ rootValue: 75 })
  ],
  compilerModules: [
    {
      postTransformNode: el => precompile(el)
    }
  ],
}

config

feature

NOTE: This plugin should only work with weex-vue-render-next in pair, which is > 0.12.xx. The version before 0.13 is not compatible.