Skip to content

easy-team/easywebpack-weex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

author
sky
Mar 29, 2019
f4df9b2 · Mar 29, 2019

History

35 Commits
Sep 13, 2017
Jun 15, 2017
Mar 29, 2019
Nov 27, 2018
Dec 16, 2017
Jun 15, 2017
Nov 27, 2018
Jun 15, 2017
Jun 15, 2017
Jun 15, 2017
Dec 21, 2017
Jun 15, 2017
Dec 11, 2018
Nov 27, 2018
Mar 29, 2019
Sep 12, 2017

Repository files navigation

easywebpack-weex

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

基于 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 Weex构建项目骨架

webpack-weex-compile

webpack-weex-debug

License

MIT