Linux unitednationsplay.com 3.10.0-1160.45.1.el7.x86_64 #1 SMP Wed Oct 13 17:20:51 UTC 2021 x86_64
nginx/1.20.1
Server IP : 188.130.139.92 & Your IP : 3.16.214.124
Domains :
Cant Read [ /etc/named.conf ]
User : web
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
home /
www /
wb /
node_modules /
gulp-babel /
Delete
Unzip
Name
Size
Permission
Date
Action
node_modules
[ DIR ]
drwxrwxr-x
2022-08-30 11:49
CHANGELOG.md
1.05
KB
-rw-rw-r--
2022-08-30 11:49
LICENSE.md
1.1
KB
-rw-rw-r--
2022-08-30 11:49
README.md
2.97
KB
-rw-rw-r--
2022-08-30 11:49
index.js
2.27
KB
-rw-rw-r--
2022-08-30 11:49
package.json
1.31
KB
-rw-rw-r--
2022-08-30 11:49
Save
Rename
> This readme is for gulp-babel v8 + Babel v7 > Check the [7.x branch](https://github.com/babel/gulp-babel/tree/v7-maintenance) for docs with Babel v6 usage # gulp-babel [](https://www.npmjs.com/package/gulp-babel) [](https://travis-ci.org/babel/gulp-babel) > Use next generation JavaScript, today, with [Babel](https://babeljs.io) *Issues with the output should be reported on the Babel [issue tracker](https://phabricator.babeljs.io/).* ## Install Install `gulp-babel` if you want to get the pre-release of the next version of `gulp-babel`. ``` # Babel 7 $ npm install --save-dev gulp-babel @babel/core @babel/preset-env # Babel 6 $ npm install --save-dev gulp-babel@7 babel-core babel-preset-env ``` ## Usage ```js const gulp = require('gulp'); const babel = require('gulp-babel'); gulp.task('default', () => gulp.src('src/app.js') .pipe(babel({ presets: ['@babel/env'] })) .pipe(gulp.dest('dist')) ); ``` ## API ### babel([options]) #### options See the Babel [options](https://babeljs.io/docs/usage/options/), except for `sourceMap` and `filename` which is handled for you. ## Source Maps Use [gulp-sourcemaps](https://github.com/floridoo/gulp-sourcemaps) like this: ```js const gulp = require('gulp'); const sourcemaps = require('gulp-sourcemaps'); const babel = require('gulp-babel'); const concat = require('gulp-concat'); gulp.task('default', () => gulp.src('src/**/*.js') .pipe(sourcemaps.init()) .pipe(babel({ presets: ['@babel/env'] })) .pipe(concat('all.js')) .pipe(sourcemaps.write('.')) .pipe(gulp.dest('dist')) ); ``` ## Babel Metadata Files in the stream are annotated with a `babel` property, which contains the metadata from [`babel.transform()`](https://babeljs.io/docs/usage/api/). #### Example ```js const gulp = require('gulp'); const babel = require('gulp-babel'); const through = require('through2'); function logBabelMetadata() { return through.obj((file, enc, cb) => { console.log(file.babel.test); // 'metadata' cb(null, file); }); } gulp.task('default', () => gulp.src('src/**/*.js') .pipe(babel({ // plugin that sets some metadata plugins: [{ post(file) { file.metadata.test = 'metadata'; } }] })) .pipe(logBabelMetadata()) ) ``` ## Runtime If you're attempting to use features such as generators, you'll need to add `transform-runtime` as a plugin, to include the Babel runtime. Otherwise, you'll receive the error: `regeneratorRuntime is not defined`. Install the runtime: ``` $ npm install --save-dev @babel/plugin-transform-runtime $ npm install --save @babel/runtime ``` Use it as plugin: ```js const gulp = require('gulp'); const babel = require('gulp-babel'); gulp.task('default', () => gulp.src('src/app.js') .pipe(babel({ plugins: ['@babel/transform-runtime'] })) .pipe(gulp.dest('dist')) ); ``` ## License MIT © [Sindre Sorhus](http://sindresorhus.com)