Skip to content

Commit

Permalink
deps: upgrade easywebpack 3.5.x
Browse files Browse the repository at this point in the history
  • Loading branch information
hubcarl committed Dec 16, 2017
1 parent 3d841dc commit 13c4b0f
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 32 deletions.
14 changes: 7 additions & 7 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"presets": ["es2015", "stage-2"],
"presets": [
"env"
],
"plugins": [
'add-module-exports',
["transform-runtime", {
"polyfill": true,
"regenerator": true
}]
"transform-object-rest-spread",
"syntax-dynamic-import",
"transform-object-assign"
],
"comments": false
}
}
34 changes: 15 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,18 @@
[download-image]: https://img.shields.io/npm/dm/easywebpack-weex.svg?style=flat-square
[download-url]: https://npmjs.org/package/easywebpack-weex

Webpack3 (3.x.x) and Webpack2 (1.x.x) building solution for `Weex` + `Vue`, support `Native`` and `Web` build.
基于 easywebpack 的 Weex Native 和 Weex Web 打包构建解决方案.


## Install
## 安装

```bash
$ npm i easywebpack-weex --save
```

## Usage
## 使用

### webpack common config `base.js`
### 公共配置 `base.js`

```js
'use strict';
Expand All @@ -56,7 +56,7 @@ const WebpackBaseBuilder = WebpackBuilder => class extends WebpackBuilder {
module.exports = WebpackBaseBuilder;
```

### webpack weex config `weex.js`
### Weex Native 构建配置 `weex.js`

```js
'use strict';
Expand All @@ -68,7 +68,7 @@ class WeexBuilder extends WebpackBaseBuilder(WebpackWeexBuilder) {
module.exports = new WeexBuilder().create();
```

### webpack weex web config `web.js`
### Weex Web 构建配置 `web.js`

```js
'use strict';
Expand All @@ -80,7 +80,7 @@ class WeexWebBuilder extends WebpackBaseBuilder(WebpackWebBuilder) {
module.exports = new WeexWebBuilder().create();
```

### command run entry file `build.js`
### 构建入口 `build.js`

```js
const WeexWebpack = require('easywebpack-weex');
Expand All @@ -97,9 +97,12 @@ if (process.env.NODE_SERVER) {
}
```

### commmand run
### 命令行运行

- package.json 添加脚本配置

```js
// ${app_root}/package.json
{
"scripts": {
"build": "cross-env NODE_ENV=production node test/build",
Expand All @@ -113,28 +116,21 @@ if (process.env.NODE_SERVER) {
}
```

```bash
- 命令行运行

```bash
npm start

```


## Example
## 工程骨架

- [easywebpack-weex-boilerplate](https://github.com/hubcarl/easywebpack-weex-boilerplate) Weex构建项目骨架
[easywebpack-weex-boilerplate](https://github.com/hubcarl/easywebpack-weex-boilerplate) Weex构建项目骨架

![webpack-weex-compile](https://github.com/hubcarl/easywebpack-weex/blob/master/doc/images/webpack-weex-compile.png)

![webpack-weex-debug](https://github.com/hubcarl/easywebpack-weex/blob/master/doc/images/webpack-weex-debug.png)

see [weex example](test/web) and [weex webpack build config](test/build) for more detail.



## Questions & Suggestions

Please open an issue [here](https://github.com/hubcarl/easywebpack-weex).

## License

Expand Down
26 changes: 22 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"name": "easywebpack-weex",
"version": "3.0.1",
"description": "Weex webpack building solution for easywebpack",
"version": "3.5.0-rc.1",
"description": "基于 easywebpack 的 Weex Native 和 Weex Web 打包构建解决方案",
"keywords": [
"webpack",
"easywebpack",
"vue",
"weex"
],
"dependencies": {
"easywebpack": "^3.1.1",
"easywebpack": "^3.5.0-rc.7",
"vue": "^2.4.2",
"vue-html-loader": "^1.2.4",
"vue-loader": "^13.0.4",
Expand All @@ -22,11 +22,29 @@
"weex-vue-render": "^0.12.8"
},
"devDependencies": {
"babel-core": "^6.26.0",
"babel-plugin-syntax-dynamic-import": "^6.18.0",
"babel-plugin-transform-object-assign": "^6.22.0",
"babel-plugin-transform-object-rest-spread": "^6.26.0",
"babel-preset-env": "^1.6.1",
"chai": "^4.0.0",
"cross-env": "^5.0.1",
"directory-named-webpack-plugin": "^2.3.0",
"eslint": "^4.6.1",
"eslint-config-eslint": "^4.0.0",
"mocha": "^3.4.2"
"eslint-loader": "^1.9.0",
"html-webpack-plugin": "^2.30.1",
"imagemin-webpack-plugin": "^1.5.2",
"less": "^2.7.3",
"less-loader": "^4.0.5",
"mocha": "^3.4.2",
"node-sass": "^4.7.2",
"npm-install-webpack-plugin": "^4.0.5",
"postcss-loader": "^2.0.9",
"progress-bar-webpack-plugin": "^1.10.0",
"sass-loader": "^6.0.6",
"stylus": "^0.54.5",
"stylus-loader": "^3.0.1"
},
"engines": {
"node": ">=6.0.0"
Expand Down
2 changes: 1 addition & 1 deletion test/build/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use strict';
const config = require('../../webpack.config');
const config = require('../webpack.config');
const WeexWebpack = require('../../');
const webpackConfig = WeexWebpack.getWebpackConfig(config);
if (process.env.NODE_ENV === 'development') {
Expand Down
8 changes: 7 additions & 1 deletion webpack.config.js → test/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,13 @@ module.exports = {
framework: 'test/web/framework',
store: 'test/web/store'
},
install: {
check: true
},
plugins: {
npm: true
},
onWeb() {
this.addEntry('vendor', [path.join(this.config.baseDir, 'test/web/framework/weex/web.js')]);
this.addEntry('common', [path.join(this.config.baseDir, 'test/web/framework/weex/web.js')]);
}
};

0 comments on commit 13c4b0f

Please sign in to comment.