# generator-bizxes6

> ES6 configuration generator

Latest version **1.0.2** (published 2017-04-20) · 0 weekly downloads

## Install

```sh
npm install generator-bizxes6
pnpm add generator-bizxes6
yarn add generator-bizxes6
bun add generator-bizxes6
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2017-04-20 |
| First published | 2017-04-19 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | xqiqi |
| Keywords | yeoman-generator |

## Links

- npm: https://www.npmjs.com/package/generator-bizxes6
- Repository: https://github.wdf.sap.corp/I331148/generator-es6
- npm.io page: https://npm.io/package/generator-bizxes6

## Dependencies (1)

- [yeoman-generator](https://npm.io/package/yeoman-generator.md) ^1.1.1

## Recent versions

- 1.0.2 (latest) — 2017-04-20
- 1.0.1 — 2017-04-20
- 1.0.0 — 2017-04-19

## README

# BizxES6 generator
BizxES6 generator enables you to write `.es6` files in your bizx projects.


## Get started
Before you get started, please ensure your local environment has already installed [npm](https://www.npmjs.com).

Install [Yeoman](http://yeoman.io):
```
npm install -g yo
```

`cd` into your code folder, install generator-bizxes6:
```
npm install --save-dev generator-bizxes6
```

Just run:
```
yo bizxes6
```

Now everything has been established by BizxES6 automatically, feel free to write your `.es6` files. 
The default source path is `./src`. You can change it in the `./gulpfile.js`.

*You may get warnings if you already have your own `gulpfile.js` and `build.gradle` in your project. 
For this case, you need add gulp tasks and build tasks on your own.*

## Usages
### Compile
To compile your `.es6` files, just run:
```
gulp es6
```

You can also run a gulp watcher to compile `.es6` files automatically once file changes:
```
gulp watch
```

### <span id="config">Configuration</span>
If you already have your own `./gulpfile.js` or `./build.gradle`, you need do configuration by yourself.
You can also change some configurations to meet your own requirements.

#### gulp tasks
In `./gulpfile.js`, add es6 gulp task to compile the `.es6` files:
```javascript
const gulp = require('gulp');
const sourcemaps = require("gulp-sourcemaps");
const babel = require("gulp-babel");
/* you can change the srcDir to suit your case */
const srcDir = 'src';

gulp.task('es6', function () {
  return gulp.src(srcDir + '/**/*.es6')
    .pipe(sourcemaps.init())
    .pipe(babel())
    .pipe(sourcemaps.write('.'))
    .pipe(gulp.dest(srcDir));
});
```

Add watch gulp task to make compilation automatic:
```javascript
gulp.task('watch', function () {
  gulp.watch(srcDir + '/**/*.es6', ['es6']);
});
```
Template reference: [gulpfile.js](https://github.wdf.sap.corp/I331148/generator-bizxes6/blob/master/generators/app/templates/gulpfile.js)

#### build tasks
In `.build.gradle`, add compileES6 build task to compile the `.es6` files when build starts.
Notice that this task requires an node executing environment.
So make sure you have applied the gradle plugin [com.moowork.node](https://plugins.gradle.org/plugin/com.moowork.node).
```
apply plugin: 'com.moowork.node'

task compileES6(type: NodeTask) {
  script = file('node_modules/gulp/bin/gulp.js')
  args = ['es6']
}
compileES6.dependsOn 'npm_install'
check.dependsOn 'compileES6'
```

We also provide an internal Node.js source, you can just use our default settings:
```
node {
  version = '4.5.0'
  distBaseUrl = 'http://uicommons.mo.sap.corp:8082/dist'
  download = true
}
```

*Ensure that the compileES6 task runs before testing tasks because out-of-date `.js` files may cause testing fail.*

Template reference: [build.gradle](https://github.wdf.sap.corp/I331148/generator-bizxes6/blob/master/generators/app/templates/build.gradle)

---
_Source: https://npm.io/package/generator-bizxes6 · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
