0.1.7 • Published 8 years ago

weex-vue-bundle-util v0.1.7

Weekly downloads
4
License
MIT
Repository
github
Last release
8 years ago

weex-vue-bundle-util

This tool is for weex-vue-render to bundle the components and modules which you have used in your projects. You can just use the export function to analyse the used built-in components and modules, which returns a promise with a object includes components and modules fields. You just packing up them with the render-core (weex-vue-render/dist/index.core.js) in your project's entry file. By doing this you can pack up your render in the minimum size without all the irrelative codes of components and mdoules you haven't used in your project.

how to use

just use the module as a function, pass in the webpack config and webpack it self, and run it before your compiling process. The function returns a promise:

const webpack = require('webpack')
const config = require('your-projects-webpack-config.js')
const scan = require('weex-vue-bundle-util')
scan(webpack, config)
  .then(function (res) {
    const { components, modules } = res
    packYourProjectWith(components, modules)
    // if you are using @ali/weex-vue-render, please pass a options with 'ali' set like the codes below.
    // scan(webpack, config, { ali: true })
  })

OPTIONS

  • ali: Boolean. Optional. False by Default. If you use @ali/weex-vue-render, please add this and set to true.
  • output: String. Optional. If you want to generate a import entry file for the plugins, just set a output path for this file. You should use a absolute path. The generated file is like this:

    import a from 'weex-vue-a'
    import animation from 'weex-vue-animation'
    export default [
      a,
      animation
    ]
  • allowInstallPlugins: Boolean. Optional. False by default. If true, the dependend plugins will be auto installled, and only this be true the peerDependencies of the plugins could be analyzed and output to the result object.

  • allowInstallPluginDependencies: Boolean. Optional. False by default. If true, the peerDependencies of the plugins (e.g: '@ali/lib-windvane' for 'windvane' API module) will be auto installed and be imported in the plugin entry file.

NOTES

This tool can only get the components used in the template which should be able to be processed in vue-loader. The components you use in render function will be ignored.

components and modules

Here is a list about components and modules you can pack into your project. The aliweex only built packages list should be found in gitlab repo of @ali/weex-vue-render.

components

npm module namecomponent name
weex-vue-aa
weex-vue-inputinput
weex-vue-sliderslider / slider-neighbor
weex-vue-switchswitch
weex-vue-textareatextarea
weex-vue-videovideo
weex-vue-webweb

modules

npm module nameAPI module name
weex-vue-animationanimation
weex-vue-clipboardclipboard
weex-vue-domdom
weex-vue-eventevent
weex-vue-geolocationgeolocation
weex-vue-global-eventglobalEvent
weex-vue-modalmodal
weex-vue-navnavigator
weex-vue-storagestorage
weex-vue-streamstream
weex-vue-websocketwebsocket
weex-vue-webviewwebview

Enjoy happy building!

0.1.7

8 years ago

0.1.6

8 years ago

0.1.5

8 years ago

0.1.4

8 years ago

0.1.3

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago