项目作者: easy-team

项目描述 :
A Simple Weex + Vue + Webpack Build Solution
高级语言: JavaScript
项目地址: git://github.com/easy-team/easywebpack-weex.git
创建时间: 2017-06-15T13:15:05Z
项目社区:https://github.com/easy-team/easywebpack-weex

开源协议:MIT License

下载


easywebpack-weex

NPM version
build status
Test coverage
David deps
Known Vulnerabilities
npm download

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

安装

  1. $ npm i easywebpack-weex --save-dev

使用

  1. const weex = require('easywebpack-weex');
  2. // 获取 webpack weex 配置
  3. const webpackConfig = weex.getWeexWebpackConfig({
  4. env: process.env.BUILD_ENV, // 支持 dev,test,local 模式
  5. entry: {
  6. index: 'src/app.js'
  7. }
  8. });
  9. // 获取 webpack web 配置
  10. const webpackConfig = weex.getWebWebpackConfig({
  11. entry: {
  12. index: 'src/app.js'
  13. }
  14. });
  15. // 获取 webpack weex 和 web 配置
  16. const webpackConfig = weex.getWebpackConfig({
  17. entry: {
  18. index: 'src/app.js'
  19. }
  20. });

开发构建

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

工程骨架

easywebpack-weex-boilerplate Weex构建项目骨架

webpack-weex-compile

webpack-weex-debug

License

MIT