weex-rax-framework
How to custom builtin modules?
1. Build module use factory mode
const webpack = ;const RaxPlugin = ; moduleexports = target: 'node' entry: // Entry name should ends with `.factory` 'your-module.factory' : './src/index.js' output: path: './dist/' filename: '[name].js' plugins: // Your could config builtinModules here externalBuiltinModules: false builtinModules: RaxPluginBuiltinModules ; module: loaders: test: /\.jsx?$/ exclude: // loader: 'babel' // 'babel-loader' is also a legal name to reference query: presets: 'es2015' 'rax'
Then publish module with factory build file to npm registry:
npm publish
Or link
module in local:
npm link
builtin.js
in framework source
2. Config Install builtin module from npm:
npm install your-module --save
Or link from local:
npm link your-module
Config builtin.js
and add your custom builtin module:
let ModuleFactories = 'rax': // Add your builtin module 'your-module': ;
3. Build framework use framework mode
const webpack = ;const RaxPlugin = ; moduleexports = target: 'node' entry: // Entry name should ends with `.framework` 'rax.framework': './packages/weex-rax-framework/src/index.js' output: path: './packages/weex-rax-framework/dist/' filename: '[name].js' plugins: ; module: loaders: test: /\.jsx?$/ exclude: // loader: 'babel' // 'babel-loader' is also a legal name to reference query: presets: 'es2015'
jsfm
including weex-rax-framework
?
How to build weex 1. Clone the weex repository and install prerequisites
git clone git@github.com:alibaba/weex.gitcd weexnpm install
weex-rax-framework
2. Install or link npm install weex-rax-framework
Or
npm link weex-rax-framework
weex-rax-framework
3. Config Update html5/frameworks/index.js
file with below content:
Rax Weex
jsfm
for native renderer to dist/native.js
4. Build npm run build:native
dist/native.js
to weex-sdk
5. Copy cp -vf ./dist/native.js ./android/sdk/assets/main.jscp -vf ./dist/native.js ./ios/sdk/WeexSDK/Resources/main.js