rax-webpack-plugin
Webpack plugin for Rax framework.
Last updated 13 days ago by yacheng .
BSD-3-Clause · Repository · Bugs · Original npm · Tarball
$ cnpm install rax-webpack-plugin 
SYNC missed versions from official npm registry.

rax-webpack-plugin npm Dependency Status Known Vulnerabilities

Webpack plugin for Rax framework.

Install

$ npm install --save-dev rax-webpack-plugin

Usage

var RaxPlugin = require('rax-webpack-plugin');

module.exports = {
  plugins: [
    new RaxPlugin({
      // Target format: `bundle`, `cmd`, `umd` or `factory`(build for builtin module format), default is umd
      target: 'umd',
      // Only for `bundle` target, default is '// {"framework" : "Rax"}'
      frameworkComment: '// {"framework" : "Rax"}',
      // component mode build config
      moduleName: 'rax',
      globalName: 'Rax',
      // Enable external builtin modules, default is false
      externalBuiltinModules: false,
      // Config which builtin modules should external, default config is define in `RaxPlugin.BuiltinModules`
      builtinModules: RaxPlugin.BuiltinModules,
      // Enable include polyfill files
      includePolyfills: false,
      // Config which polyfill should include, defaut is empty
      polyfillModules: [],
      // Check duplicate dependencies, default is ['rax']
      duplicateCheck: ['rax'],
    })
  ]
}

MultiplePlatform(config:Object[, options: Object])

Output multiple platform

options

  • platforms Array of ['web', 'node', 'weex', 'reactnative']
  • exclude Multiple platform loader exclude, default is /(node_modules|bower_components)/
  • name Default is ['universal-env'], you can reassign to other module name when needed

example

const config = require('webpack.config.js');

const multipleConfig = RaxPlugin.MultiplePlatform(config, {
  platforms: ['web', 'weex']
});

const compiler = webpack(configs);

// ....
Downloads
Today 0
This Week 0
This Month 2,861
Last Day 6
Last Week 2,704
Last Month 902
Dependencies (10)
Dev Dependencies (2)

Copyright 2014 - 2016 © taobao.org |