gulp-concat

What is wrong with this code that combines multiple js files to one?

Deadly 提交于 2019-12-02 01:43:22
I have this node.js code that tries to minify and combine multiple js files to a single js file. var concat = require('gulp-concat'); var gulp = require('gulp'); gulp.task('scripts', function() { //gulp.src(['./lib/file3.js', './lib/file1.js', './lib/file2.js']) gulp.src(['./js/*.js']) .pipe(concat('all.js')) .pipe(uglify()) .pipe(gulp.dest('./dist/')) }); All my js files are located in js folder. My node.js file is above the js folder. I am expecting the single minified file to appear in dist folder. I see nothing and get no error message when I run the code. What could have gone wrong?

How to tell Gulp to skip or ignore some files in gulp.src([…])?

馋奶兔 提交于 2019-12-01 02:41:10
How can I tell Gulp to skip or ignore some files in gulp.src([...]) ? For instance, I don't want to compress and concat this file in my css/ folder - 'css/ignnore.css' ? var autoprefix = require('gulp-autoprefixer'), concat = require('gulp-concat'), minifyCss = require('gulp-minify-css'); gulp.task('styles', function() { gulp.src([ 'css/ignnore.css', // ignore this file 'css/*.css' ]) .pipe(concat('styles.css')) .pipe(autoprefix('last 2 versions')) .pipe(minifyCss()) .pipe(gulp.dest('local/view/style/base/css/dist/')); }); Add a ! : gulp.task('styles', function() { gulp.src([ '!css/ignnore.css

How to tell Gulp to skip or ignore some files in gulp.src([…])?

前提是你 提交于 2019-11-30 21:27:34
问题 How can I tell Gulp to skip or ignore some files in gulp.src([...]) ? For instance, I don't want to compress and concat this file in my css/ folder - 'css/ignnore.css' ? var autoprefix = require('gulp-autoprefixer'), concat = require('gulp-concat'), minifyCss = require('gulp-minify-css'); gulp.task('styles', function() { gulp.src([ 'css/ignnore.css', // ignore this file 'css/*.css' ]) .pipe(concat('styles.css')) .pipe(autoprefix('last 2 versions')) .pipe(minifyCss()) .pipe(gulp.dest('local

How can I use gulp to replace a string in a file?

本秂侑毒 提交于 2019-11-30 11:15:49
I am using gulp to uglify and make ready my javascript files for production. What I have is this code: var concat = require('gulp-concat'); var del = require('del'); var gulp = require('gulp'); var gzip = require('gulp-gzip'); var less = require('gulp-less'); var minifyCSS = require('gulp-minify-css'); var uglify = require('gulp-uglify'); var js = { src: [ // more files here 'temp/js/app/appConfig.js', 'temp/js/app/appConstant.js', // more files here ], gulp.task('scripts', ['clean-js'], function () { return gulp.src(js.src).pipe(uglify()) .pipe(concat('js.min.js')) .pipe(gulp.dest('content