Skip to content

Instantly share code, notes, and snippets.

@wlkns
Created March 4, 2018 12:23
Show Gist options
  • Save wlkns/91a318c1096e1ea7b9075a19362c8867 to your computer and use it in GitHub Desktop.
Save wlkns/91a318c1096e1ea7b9075a19362c8867 to your computer and use it in GitHub Desktop.
Gulp + Babel + import
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