# bgtm-engine-es6

> This is an engine which can be used in conjunction with [BGTM](https://www.npmjs.com/package/bgtm) for the purposes of processing a "application" built in es6 into a bundled single file.

Latest version **2.0.6** (published 2021-09-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install bgtm-engine-es6
pnpm add bgtm-engine-es6
yarn add bgtm-engine-es6
bun add bgtm-engine-es6
```

## 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 | 2.0.6 |
| Published | 2021-09-08 |
| First published | 2017-08-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 10 |
| Unpacked size | 136 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Ben Blanks |
| Maintainers | blanksy, oldben |

## Links

- npm: https://www.npmjs.com/package/bgtm-engine-es6
- Repository: https://bitbucket.org/bgtm/bgtm-engine-es6
- Homepage: https://bitbucket.org/bgtm/bgtm-engine-es6#readme
- npm.io page: https://npm.io/package/bgtm-engine-es6

## Dependencies (10)

- [babelify](https://npm.io/package/babelify.md) ^10.0.0
- [exorcist](https://npm.io/package/exorcist.md) ^2.0.0
- [gulp-bro](https://npm.io/package/gulp-bro.md) ^2.0.0
- [uglifyify](https://npm.io/package/uglifyify.md) ^5.0.2
- [@babel/core](https://npm.io/package/@babel/core.md) ^7.15.5
- [deep-extend](https://npm.io/package/deep-extend.md) ^0.6.0
- [gulp-rename](https://npm.io/package/gulp-rename.md) ^2.0.0
- [gulp-plumber](https://npm.io/package/gulp-plumber.md) ^1.2.1
- [vinyl-transform](https://npm.io/package/vinyl-transform.md) ^1.0.0
- [@babel/preset-env](https://npm.io/package/@babel/preset-env.md) ^7.15.4

## Recent versions

- 2.0.6 (latest) — 2021-09-08
- 2.0.5 — 2019-05-14
- 2.0.4 — 2019-03-04
- 2.0.3 — 2019-02-28
- 2.0.2 — 2019-02-27
- 2.0.1 — 2019-02-27
- 2.0.0 — 2019-02-13
- 1.0.0 — 2019-02-12
- 0.0.1 — 2017-08-03

## README

# BGTM - Engine for compiling a ES6 code into JS.

This is an engine which can be used in conjunction with
[BGTM](https://www.npmjs.com/package/bgtm) for
the purposes of processing a "application" built in es6 into a bundled
single file.

# How to use

Read the how to section for [BGTM](https://www.npmjs.com/package/bgtm).

Run:

    npm install --save-dev bgtm-engine-es6

In your gulpfile add the following dependency:

    var js = require('bgtm-engine-es6');

Then add the following task.

    tm.add('app-name', {
        runOnBuild: true,
        watch: true,
        watchSource: [
            'src/js/app/**/*.es6'
        ],
        liveReload: true,
        engine: es6,
        engineOptions: {
            'src': 'src/js/app/main.es6',
            'dest': 'dest/js/',
            'fileName': 'main.min.js'
        }
    });

# What it does

* Gets the source files specified in the `src` property.
* Compiles the ES6 "application" into a single file using
  [gulp-bro](https://www.npmjs.com/package/gulp-bro).
* Gulp Bro also minifies the file using uglify
* Extracts the sourcemaps from the compiled js files and exports them
  into their own files.
* Outputs the result to the destination specified in the `dest` property.

# Engine Options

## Defaults

    {
        src: '',
        dest: '',
        fileName: 'app.js',
        babelifyOptions: {},
        presetEnvOptions: {}
    }

| Option           | Mandatory | Description |
|------------------|-----------|-------------|
| src              | yes       | The source path to look for changes, This could be a string or an array of paths which can be patterns as well as paths. |
| dest             | yes       | The destination file for the output to be placed into. |
| fileName         | yes       | The name of the file to be output to the destination folder. |
| bablifyOptions   | no        | Allows for overriding the babelify options for the engine, e.g. if you want to turn the global on or off or ignore certain paths from transpiling etc. 
| presetEnvOptions | no        | Allows for overriding the @babel/preset-env options. |

# License

Copyright 2017-2019 Ben Blanks

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

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