easywebpack-weex 基于 easywebpack 的 Weex Native 和 Weex Web 打包构建解决方案.

安装

$ npm i easywebpack-weex --save-dev

使用

const weex = require('easywebpack-weex');
// 获取 webpack weex 配置
const webpackConfig = weex.getWeexWebpackConfig({
  env: process.env.BUILD_ENV, // 支持 dev,test,local 模式
  entry: {
    index: 'src/app.js'
  }
});

// 获取 webpack web 配置
const webpackConfig = weex.getWebWebpackConfig({
  entry: {
    index: 'src/app.js'
  }
});

//  获取 webpack weex 和 web 配置
const webpackConfig = weex.getWebpackConfig({
  entry: {
    index: 'src/app.js'
  }
});

开发构建

  • 使用 webpack-cli 开发构建服务
webpack --config webpack.config.js
  • 使用 easywebpack 内置开发构建服务
const weex = require('easywebpack-weex');
if (process.env.NODE_ENV === 'development') {
  // development mode: webpack building and start webpack hot server
  weex.server(webpackConfig);
} else {
  // build file to disk
  weex.build(webpackConfig);
}

工程骨架

easywebpack-weex-boilerplate 项目骨架

License

MIT


Author: sky
Reprint policy: All articles in this blog are used except for special statements CC BY 4.0 reprint polocy. If reproduced, please indicate source sky !
 Previous
AntD 配置 AntD 配置
项目示例: https://github.com/easy-team/egg-react-webpack-boilerplate/tree/antd-theme按需加载依赖配置
2020-05-31 sky
Next 
常见问题 常见问题
常见问题汇总AntD 按需加载与主题定制 以及 issue如果实现 Egg + React + Webpack  热更新?服务端渲染如何使用 react-loadabel 实现异步加载React 文件热更新入口配置模板import React from 'react'; import Reac...
2020-05-31 sky