Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
87e684aa7b | |||
9c31773f31 | |||
c0bb143128 | |||
d3069ebf5f | |||
d0e6bbd162 | |||
9b27ed9e7f |
1
.gitignore
vendored
1
.gitignore
vendored
@ -2,6 +2,5 @@ node_modules/
|
|||||||
npm-debug.log
|
npm-debug.log
|
||||||
test/result/
|
test/result/
|
||||||
coverage/
|
coverage/
|
||||||
docs/
|
|
||||||
pages/
|
pages/
|
||||||
public
|
public
|
||||||
|
@ -1,21 +1,31 @@
|
|||||||
image: hosttoday/ht-docker-node:npmts
|
# gitzone standard
|
||||||
|
image: hosttoday/ht-docker-node:npmci
|
||||||
|
|
||||||
|
cache:
|
||||||
|
paths:
|
||||||
|
- .yarn/
|
||||||
|
key: "$CI_BUILD_STAGE"
|
||||||
|
|
||||||
stages:
|
stages:
|
||||||
- test
|
- test
|
||||||
- release
|
- release
|
||||||
- page
|
- trigger
|
||||||
|
- pages
|
||||||
|
|
||||||
testLEGACY:
|
testLEGACY:
|
||||||
stage: test
|
stage: test
|
||||||
script:
|
script:
|
||||||
- npmci test legacy
|
- npmci test legacy
|
||||||
|
coverage: /\d+.?\d+?\%\s*coverage/
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- docker
|
||||||
|
allow_failure: true
|
||||||
|
|
||||||
testLTS:
|
testLTS:
|
||||||
stage: test
|
stage: test
|
||||||
script:
|
script:
|
||||||
- npmci test lts
|
- npmci test lts
|
||||||
|
coverage: /\d+.?\d+?\%\s*coverage/
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- docker
|
||||||
|
|
||||||
@ -23,15 +33,40 @@ testSTABLE:
|
|||||||
stage: test
|
stage: test
|
||||||
script:
|
script:
|
||||||
- npmci test stable
|
- npmci test stable
|
||||||
|
coverage: /\d+.?\d+?\%\s*coverage/
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- docker
|
||||||
|
|
||||||
release:
|
release:
|
||||||
stage: release
|
stage: release
|
||||||
script:
|
script:
|
||||||
- npmci publish npm
|
- npmci publish
|
||||||
|
only:
|
||||||
|
- tags
|
||||||
|
tags:
|
||||||
|
- docker
|
||||||
|
|
||||||
|
trigger:
|
||||||
|
stage: trigger
|
||||||
|
script:
|
||||||
- npmci trigger
|
- npmci trigger
|
||||||
only:
|
only:
|
||||||
- tags
|
- tags
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- docker
|
||||||
|
|
||||||
|
pages:
|
||||||
|
image: hosttoday/ht-docker-node:npmci
|
||||||
|
stage: pages
|
||||||
|
script:
|
||||||
|
- npmci command yarn global add npmpage
|
||||||
|
- npmci command npmpage
|
||||||
|
tags:
|
||||||
|
- docker
|
||||||
|
only:
|
||||||
|
- tags
|
||||||
|
artifacts:
|
||||||
|
expire_in: 1 week
|
||||||
|
paths:
|
||||||
|
- public
|
||||||
|
allow_failure: true
|
||||||
|
37
README.md
37
README.md
@ -1,19 +1,29 @@
|
|||||||
# gulp-browser
|
# gulp-browser
|
||||||
browserify and other goodies for gulp
|
browserify and other goodies for gulp
|
||||||
|
|
||||||
### Status
|
## Availabililty
|
||||||
[](https://gitlab.com/pushrocks/gulp-browser/commits/master)
|
[](https://www.npmjs.com/package/gulp-browser)
|
||||||
|
[](https://GitLab.com/pushrocks/gulp-browser)
|
||||||
|
[](https://github.com/pushrocks/gulp-browser)
|
||||||
|
[](https://pushrocks.gitlab.io/gulp-browser/)
|
||||||
|
|
||||||
|
## Status for master
|
||||||
|
[](https://GitLab.com/pushrocks/gulp-browser/commits/master)
|
||||||
|
[](https://GitLab.com/pushrocks/gulp-browser/commits/master)
|
||||||
|
[](https://www.npmjs.com/package/gulp-browser)
|
||||||
[](https://david-dm.org/pushrocks/gulp-browser)
|
[](https://david-dm.org/pushrocks/gulp-browser)
|
||||||
[](https://www.bithound.io/github/pushrocks/gulp-browser/master/dependencies/npm)
|
[](https://www.bithound.io/github/pushrocks/gulp-browser/master/dependencies/npm)
|
||||||
[](https://www.bithound.io/github/pushrocks/gulp-browser)
|
[](https://www.bithound.io/github/pushrocks/gulp-browser)
|
||||||
[](https://codecov.io/github/pushrocks/gulp-browser?branch=master)
|
[](https://nodejs.org/dist/latest-v6.x/docs/api/)
|
||||||
[](https://nodejs.org/dist/latest-v6.x/docs/api/)
|
[](https://nodejs.org/dist/latest-v6.x/docs/api/)
|
||||||
|
[](http://standardjs.com/)
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
Use TypeScript for best in class instellisense.
|
||||||
|
|
||||||
### Usage
|
|
||||||
gulp-browser is meant to be easy:
|
|
||||||
|
|
||||||
#### Browserify:
|
#### Browserify:
|
||||||
```typescript
|
```javascript
|
||||||
let gulp = require("gulp");
|
let gulp = require("gulp");
|
||||||
let gulpBrowser = require("gulp-browser");
|
let gulpBrowser = require("gulp-browser");
|
||||||
|
|
||||||
@ -34,18 +44,13 @@ gulp-browser is meant to be easy:
|
|||||||
|
|
||||||
> **Note:** Be aware of how gulp.src creates values of file.base and file.path since that is important to the require statements.
|
> **Note:** Be aware of how gulp.src creates values of file.base and file.path since that is important to the require statements.
|
||||||
|
|
||||||
### Dev Information:
|
|
||||||
[](https://david-dm.org/pushrocks/gulp-browser#info=devDependencies)
|
|
||||||
[](https://www.bithound.io/github/pushrocks/gulp-browser/master/dependencies/npm)
|
|
||||||
|
|
||||||
### Extending this module
|
|
||||||
If you have ideas for other great browser related gulp pipe stops, feel free to raise an issue on GitHub.
|
|
||||||
|
|
||||||
### Contributors
|
### Contributors
|
||||||
* [Phil Kunz](https://github.com/philkunz)
|
* [Phil Kunz](https://github.com/philkunz)
|
||||||
* [Steffan Donal](https://github.com/SteffanDonal)
|
* [Steffan Donal](https://github.com/SteffanDonal)
|
||||||
|
|
||||||
### About the maintainer:
|
For further information read the linked docs at the top of this README.
|
||||||
[](https://lossless.com/)
|
|
||||||
|
|
||||||
[](https://paypal.me/lossless)
|
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
|
||||||
|
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy.html)
|
||||||
|
|
||||||
|
[](https://push.rocks)
|
||||||
|
3
dist/gulpbrowser.plugins.js
vendored
3
dist/gulpbrowser.plugins.js
vendored
@ -1,6 +1,7 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
require("typings-global");
|
require("typings-global");
|
||||||
exports.through2 = require("through2");
|
exports.through2 = require("through2");
|
||||||
exports.path = require("path");
|
exports.path = require("path");
|
||||||
exports.browserify = require("browserify");
|
exports.browserify = require("browserify");
|
||||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ3VscGJyb3dzZXIucGx1Z2lucy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL2d1bHBicm93c2VyLnBsdWdpbnMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLDBCQUF1QjtBQUN2Qix1Q0FBNEM7QUFDNUMsK0JBQW9DO0FBQ3BDLDJDQUFnRCJ9
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ3VscGJyb3dzZXIucGx1Z2lucy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL2d1bHBicm93c2VyLnBsdWdpbnMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQSwwQkFBdUI7QUFDdkIsdUNBQTRDO0FBQzVDLCtCQUFvQztBQUNwQywyQ0FBZ0QifQ==
|
3
dist/index.js
vendored
3
dist/index.js
vendored
@ -1,3 +1,4 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
exports.browserify = require("./gulpbrowser.browserify");
|
exports.browserify = require("./gulpbrowser.browserify");
|
||||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEseURBQStEIn0=
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUFBLHlEQUE4RCJ9
|
56
docs/index.md
Normal file
56
docs/index.md
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
# gulp-browser
|
||||||
|
browserify and other goodies for gulp
|
||||||
|
|
||||||
|
## Availabililty
|
||||||
|
[](https://www.npmjs.com/package/gulp-browser)
|
||||||
|
[](https://GitLab.com/pushrocks/gulp-browser)
|
||||||
|
[](https://github.com/pushrocks/gulp-browser)
|
||||||
|
[](https://pushrocks.gitlab.io/gulp-browser/)
|
||||||
|
|
||||||
|
## Status for master
|
||||||
|
[](https://GitLab.com/pushrocks/gulp-browser/commits/master)
|
||||||
|
[](https://GitLab.com/pushrocks/gulp-browser/commits/master)
|
||||||
|
[](https://www.npmjs.com/package/gulp-browser)
|
||||||
|
[](https://david-dm.org/pushrocks/gulp-browser)
|
||||||
|
[](https://www.bithound.io/github/pushrocks/gulp-browser/master/dependencies/npm)
|
||||||
|
[](https://www.bithound.io/github/pushrocks/gulp-browser)
|
||||||
|
[](https://nodejs.org/dist/latest-v6.x/docs/api/)
|
||||||
|
[](https://nodejs.org/dist/latest-v6.x/docs/api/)
|
||||||
|
[](http://standardjs.com/)
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
Use TypeScript for best in class instellisense.
|
||||||
|
|
||||||
|
|
||||||
|
#### Browserify:
|
||||||
|
```javascript
|
||||||
|
let gulp = require("gulp");
|
||||||
|
let gulpBrowser = require("gulp-browser");
|
||||||
|
|
||||||
|
let transforms = [
|
||||||
|
{
|
||||||
|
transform: "babelify",
|
||||||
|
options: {presets: ["es2015"]}
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
gulp.task('gulpBrowserTest',function() {
|
||||||
|
var stream = gulp.src('./test/*.js')
|
||||||
|
.pipe(gulpBrowser.browserify(transforms)) // gulp.browserify() accepts an optional array of tansforms
|
||||||
|
.pipe(gulp.dest("./test/browserifiedJS/"));
|
||||||
|
return stream;
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
> **Note:** Be aware of how gulp.src creates values of file.base and file.path since that is important to the require statements.
|
||||||
|
|
||||||
|
### Contributors
|
||||||
|
* [Phil Kunz](https://github.com/philkunz)
|
||||||
|
* [Steffan Donal](https://github.com/SteffanDonal)
|
||||||
|
|
||||||
|
For further information read the linked docs at the top of this README.
|
||||||
|
|
||||||
|
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
|
||||||
|
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy.html)
|
||||||
|
|
||||||
|
[](https://push.rocks)
|
7
npmextra.json
Normal file
7
npmextra.json
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"npmci": {
|
||||||
|
"globalNpmTools": [
|
||||||
|
"npmts"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
@ -1,4 +0,0 @@
|
|||||||
{
|
|
||||||
"mode":"default",
|
|
||||||
"coveralls":true
|
|
||||||
}
|
|
33
package.json
33
package.json
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "gulp-browser",
|
"name": "gulp-browser",
|
||||||
"version": "3.0.3",
|
"version": "3.0.6",
|
||||||
"description": "browserify and other goodies for gulp",
|
"description": "browserify and other goodies for gulp",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"typings": "dist/index.d.ts",
|
"typings": "dist/index.d.ts",
|
||||||
@ -17,7 +17,10 @@
|
|||||||
},
|
},
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"gulpplugin",
|
"gulpplugin",
|
||||||
"browserify"
|
"browserify",
|
||||||
|
"browser",
|
||||||
|
"TypeScript",
|
||||||
|
"typed"
|
||||||
],
|
],
|
||||||
"author": "Smart Coordination GmbH <office@push.rocks> (https://push.rocks)",
|
"author": "Smart Coordination GmbH <office@push.rocks> (https://push.rocks)",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
@ -26,24 +29,22 @@
|
|||||||
},
|
},
|
||||||
"homepage": "https://gitlab.com/pushrocks/gulp-browser",
|
"homepage": "https://gitlab.com/pushrocks/gulp-browser",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@types/browserify": "^12.0.30",
|
"@types/browserify": "^12.0.32",
|
||||||
"@types/q": "0.0.32",
|
"@types/q": "1.0.2",
|
||||||
"@types/through2": "^2.0.32",
|
"@types/through2": "^2.0.33",
|
||||||
"browserify": "^13.1.1",
|
"browserify": "^14.4.0",
|
||||||
"q": "^1.4.1",
|
"q": "^1.5.0",
|
||||||
|
"smartq": "^1.1.6",
|
||||||
"through2": "^2.0.3",
|
"through2": "^2.0.3",
|
||||||
"typings-global": "^1.0.14"
|
"typings-global": "^1.0.19"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/gulp": "^3.8.32",
|
"@types/gulp": "^4.0.4",
|
||||||
"@types/should": "^8.1.30",
|
"babel-preset-es2015": "^6.24.1",
|
||||||
"babel-preset-es2015": "^6.18.0",
|
|
||||||
"babelify": "^7.3.0",
|
"babelify": "^7.3.0",
|
||||||
"beautylog": "^6.0.0",
|
"beautylog": "^6.1.10",
|
||||||
"gulp": "^3.9.1",
|
"gulp": "^3.9.1",
|
||||||
"gulp-function": "^2.2.3",
|
"gulp-function": "^2.2.9",
|
||||||
"npmts-g": "^5.2.10",
|
"tapbundle": "^1.1.0"
|
||||||
"should": "^11.1.2",
|
|
||||||
"typings-test": "^1.0.3"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
1
test/test.d.ts
vendored
1
test/test.d.ts
vendored
@ -1 +0,0 @@
|
|||||||
import 'typings-test';
|
|
56
test/test.js
56
test/test.js
@ -1,56 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
require("typings-test");
|
|
||||||
const gulp = require("gulp");
|
|
||||||
const gulpBrowser = require("../dist/index.js");
|
|
||||||
const gulpFunction = require("gulp-function");
|
|
||||||
const q = require("q");
|
|
||||||
describe('gulpBrowser', function () {
|
|
||||||
describe('.browserify', function () {
|
|
||||||
it('should run through smoothly', function (done) {
|
|
||||||
this.timeout(30000);
|
|
||||||
let stream = gulp.src('./test/testBrowserifyNormal.js')
|
|
||||||
.pipe(gulpBrowser.browserify())
|
|
||||||
.pipe(gulp.dest('./test/result/'))
|
|
||||||
.pipe(gulpFunction.atEnd(() => {
|
|
||||||
let done2 = q.defer();
|
|
||||||
done();
|
|
||||||
done2.resolve();
|
|
||||||
return done2.promise;
|
|
||||||
}));
|
|
||||||
});
|
|
||||||
it('should throw an error, when a module is not found', function (done) {
|
|
||||||
let d = require('domain').create();
|
|
||||||
let doneCalled = false;
|
|
||||||
d.on('error', function (error) {
|
|
||||||
if (!doneCalled) {
|
|
||||||
done();
|
|
||||||
doneCalled = true;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
d.run(function () {
|
|
||||||
let stream = gulp.src('./test/testBrowserifyError.js')
|
|
||||||
.pipe(gulpBrowser.browserify());
|
|
||||||
});
|
|
||||||
});
|
|
||||||
it('should run through with an empty file', function (done) {
|
|
||||||
let stream = gulp.src('./test/testBrowserifyEmpty.js')
|
|
||||||
.pipe(gulpBrowser.browserify())
|
|
||||||
.pipe(gulp.dest('./test/result/'))
|
|
||||||
.pipe(gulpFunction.atEnd(done));
|
|
||||||
});
|
|
||||||
it('should run through work with transforms', function (done) {
|
|
||||||
this.timeout(30000);
|
|
||||||
let transforms = [
|
|
||||||
{
|
|
||||||
transform: 'babelify',
|
|
||||||
options: { presets: ['es2015'] }
|
|
||||||
}
|
|
||||||
];
|
|
||||||
let stream = gulp.src('./test/testBrowserifyNormal.js')
|
|
||||||
.pipe(gulpBrowser.browserify(transforms))
|
|
||||||
.pipe(gulp.dest('./test/result/'))
|
|
||||||
.pipe(gulpFunction.atEnd(done));
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGVzdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbInRlc3QudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLHdCQUFxQjtBQUdyQiw2QkFBNEI7QUFDNUIsZ0RBQStDO0FBQy9DLDhDQUE2QztBQUc3Qyx1QkFBc0I7QUFHdEIsUUFBUSxDQUFDLGFBQWEsRUFBRTtJQUNwQixRQUFRLENBQUMsYUFBYSxFQUFFO1FBQ3BCLEVBQUUsQ0FBQyw2QkFBNkIsRUFBRSxVQUFVLElBQUk7WUFDNUMsSUFBSSxDQUFDLE9BQU8sQ0FBQyxLQUFLLENBQUMsQ0FBQTtZQUNuQixJQUFJLE1BQU0sR0FBRyxJQUFJLENBQUMsR0FBRyxDQUFDLGdDQUFnQyxDQUFDO2lCQUNsRCxJQUFJLENBQUMsV0FBVyxDQUFDLFVBQVUsRUFBRSxDQUFDO2lCQUM5QixJQUFJLENBQUMsSUFBSSxDQUFDLElBQUksQ0FBQyxnQkFBZ0IsQ0FBQyxDQUFDO2lCQUNqQyxJQUFJLENBQUMsWUFBWSxDQUFDLEtBQUssQ0FBQztnQkFDckIsSUFBSSxLQUFLLEdBQUcsQ0FBQyxDQUFDLEtBQUssRUFBRSxDQUFBO2dCQUNyQixJQUFJLEVBQUUsQ0FBQTtnQkFDTixLQUFLLENBQUMsT0FBTyxFQUFFLENBQUE7Z0JBQ2YsTUFBTSxDQUFDLEtBQUssQ0FBQyxPQUFPLENBQUE7WUFDeEIsQ0FBQyxDQUFDLENBQUMsQ0FBQTtRQUNYLENBQUMsQ0FBQyxDQUFBO1FBRUYsRUFBRSxDQUF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AAC;AACP,CAAC,CAAC,CAAC"}
|
|
62
test/test.ts
62
test/test.ts
@ -1,62 +1,66 @@
|
|||||||
import 'typings-test'
|
|
||||||
|
|
||||||
import * as beautylog from 'beautylog'
|
import * as beautylog from 'beautylog'
|
||||||
import * as gulp from 'gulp'
|
import * as gulp from 'gulp'
|
||||||
import * as gulpBrowser from '../dist/index.js'
|
|
||||||
import * as gulpFunction from 'gulp-function'
|
import * as gulpFunction from 'gulp-function'
|
||||||
|
import * as smartq from 'smartq'
|
||||||
|
|
||||||
import * as should from 'should'
|
import { expect, tap } from 'tapbundle'
|
||||||
import * as q from 'q'
|
|
||||||
|
|
||||||
|
import * as gulpBrowser from '../dist/index.js'
|
||||||
|
|
||||||
describe('gulpBrowser', function () {
|
tap.test('should run through smoothly', async () => {
|
||||||
describe('.browserify', function () {
|
let done = smartq.defer()
|
||||||
it('should run through smoothly', function (done) {
|
|
||||||
this.timeout(30000)
|
|
||||||
let stream = gulp.src('./test/testBrowserifyNormal.js')
|
let stream = gulp.src('./test/testBrowserifyNormal.js')
|
||||||
.pipe(gulpBrowser.browserify())
|
.pipe(gulpBrowser.browserify())
|
||||||
.pipe(gulp.dest('./test/result/'))
|
.pipe(gulp.dest('./test/result/'))
|
||||||
.pipe(gulpFunction.atEnd(() => {
|
.pipe(gulpFunction.atEnd(async () => {
|
||||||
let done2 = q.defer()
|
done.resolve()
|
||||||
done()
|
|
||||||
done2.resolve()
|
|
||||||
return done2.promise
|
|
||||||
}))
|
}))
|
||||||
})
|
await done.promise
|
||||||
|
})
|
||||||
|
|
||||||
it('should throw an error, when a module is not found', function (done) {
|
tap.test('should throw an error, when a module is not found', async () => {
|
||||||
|
let done = smartq.defer()
|
||||||
let d = require('domain').create()
|
let d = require('domain').create()
|
||||||
let doneCalled = false
|
let doneCalled = false
|
||||||
d.on('error',function(error){
|
d.on('error', function (error) {
|
||||||
if (!doneCalled) {
|
if (!doneCalled) {
|
||||||
done()
|
done.resolve()
|
||||||
doneCalled = true
|
doneCalled = true
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
d.run(function() {
|
d.run(function () {
|
||||||
let stream = gulp.src('./test/testBrowserifyError.js')
|
let stream = gulp.src('./test/testBrowserifyError.js')
|
||||||
.pipe(gulpBrowser.browserify())
|
.pipe(gulpBrowser.browserify())
|
||||||
})
|
})
|
||||||
})
|
await done.promise
|
||||||
|
})
|
||||||
|
|
||||||
it('should run through with an empty file', function (done) {
|
tap.test('should run through with an empty file', async () => {
|
||||||
|
let done = smartq.defer()
|
||||||
let stream = gulp.src('./test/testBrowserifyEmpty.js')
|
let stream = gulp.src('./test/testBrowserifyEmpty.js')
|
||||||
.pipe(gulpBrowser.browserify())
|
.pipe(gulpBrowser.browserify())
|
||||||
.pipe(gulp.dest('./test/result/'))
|
.pipe(gulp.dest('./test/result/'))
|
||||||
.pipe(gulpFunction.atEnd(done))
|
.pipe(gulpFunction.atEnd(async () => {
|
||||||
})
|
done.resolve()
|
||||||
it('should run through work with transforms', function (done) {
|
}))
|
||||||
this.timeout(30000)
|
await done.promise
|
||||||
|
})
|
||||||
|
|
||||||
|
tap.test('should run through work with transforms', async () => {
|
||||||
|
let done = smartq.defer()
|
||||||
let transforms = [
|
let transforms = [
|
||||||
{
|
{
|
||||||
transform: 'babelify',
|
transform: 'babelify',
|
||||||
options: {presets: ['es2015']}
|
options: { presets: [ 'es2015' ] }
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
let stream = gulp.src('./test/testBrowserifyNormal.js')
|
let stream = gulp.src('./test/testBrowserifyNormal.js')
|
||||||
.pipe(gulpBrowser.browserify(transforms))
|
.pipe(gulpBrowser.browserify(transforms))
|
||||||
.pipe(gulp.dest('./test/result/'))
|
.pipe(gulp.dest('./test/result/'))
|
||||||
.pipe(gulpFunction.atEnd(done))
|
.pipe(gulpFunction.atEnd(async () => {
|
||||||
})
|
done.resolve()
|
||||||
})
|
}))
|
||||||
|
await done.promise
|
||||||
})
|
})
|
||||||
|
|
||||||
|
tap.start()
|
||||||
|
@ -1 +1 @@
|
|||||||
export import browserify = require("./gulpbrowser.browserify");
|
export import browserify = require("./gulpbrowser.browserify")
|
||||||
|
Reference in New Issue
Block a user