Weex Native and Web building boilerplate for Webpack
npm install easywebpack-cli -g
npm install
npm start
npm start
// 直接运行(编译文件全部在内存里面,本地开发使用)
npm start
// 编译文件到磁盘打包使用(发布测试环境)
npm run build-dev 或者 easywebpack build dev
// 编译文件到磁盘打包使用(发布正式环境)
npm run build 或者 easywebpack build prod
//build/index.js
const WeexEasyWebpack = require('easywebpack-weex');
const weexNativeConfig = require('./weex/native');
const weexWebConfig = require('./weex/web');
const NODE_SERVER = process.env.NODE_SERVER;
const webpackConfig = [weexNativeConfig, weexWebConfig];
if (NODE_SERVER) {
WeexEasyWebpack.server(webpackConfig);
} else {
WeexEasyWebpack.build(webpackConfig);
}
start webpack debug server: http://127.0.0.1:9000/debug