Created
March 4, 2018 12:23
-
-
Save wlkns/91a318c1096e1ea7b9075a19362c8867 to your computer and use it in GitHub Desktop.
Gulp + Babel + import
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gulp.task('scripts:search', () => { | |
return gulp.src('./search-module/index.js', { read: false }) | |
.pipe(tap((file) => { | |
file.contents = browserify(file.path, { | |
debug: true | |
}).transform(babel, { | |
presets: ["es2015"], | |
plugins: ["angularjs-annotate"] | |
}).bundle(); | |
})) | |
.pipe(buffer()) | |
.pipe(gulpif(build, uglify({mangle: build, compress: build}))) | |
.pipe(concat('search.js')) | |
.pipe(gulp.dest('wordpress-theme/assets/search-module/')); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment