gulp

Using Gulp-babel and getting “Argument name clash in strict mode”

我是研究僧i 提交于 2019-12-10 18:40:00
问题 I'm trying to use gulp-babel so I can start writing some ES6 / ES2015 code inside of my ES5 app. var gulp = require('gulp'), gutil = require('gulp-util'), gulpif = require('gulp-if'), uglify = require('gulp-uglify'), concat = require('gulp-concat'), sass = require('gulp-ruby-sass'), streamqueue = require('streamqueue'), sourcemaps = require('gulp-sourcemaps'), templateCache = require('gulp-angular-templatecache'), htmlReplace = require('gulp-html-replace'), runSequence = require('run-sequence

gulp - Exclude file not working

烈酒焚心 提交于 2019-12-10 18:08:19
问题 In my gulpfile I have a task which builds and writes everything to a dist folder. Now I'm trying to write another task that cleans out everything in dist except for my vendor bundle. This is what I have so far: gulp.task('clean', function () { return gulp.src(['./dist', '!./dist/scripts/vendor.js']) .pipe($.clean()); }); When I run this it deletes dist altogether. What's the right way to exclude just one file? Note: I've also tried using gulp-ignore and gulp-filter with the same results. 回答1:

Order when concat streams with event-stream in Gulp

拥有回忆 提交于 2019-12-10 18:07:51
问题 In this Gulp task, the vendorFiles code is placed after the appFiles code in the dest style.css file. Is that because the appFiles stream runs faster? How to have the vendorFiles code come before as expected? gulp.task('styles', function () { var vendorFiles = gulp.src(mainBowerFiles()) // don't read .pipe(gulpFilter('*.css')); var appFiles = gulp.src('app/sass/*.scss') .pipe(sass()) .pipe(prefix('> 5%')); return es.concat(vendorFiles, appFiles) .pipe(minifyCSS()) .pipe(concat('style.css'))

gulp.series() doesn't run tasks

泪湿孤枕 提交于 2019-12-10 18:06:03
问题 I can't figure out why gulp.series() is not firing in my callback function. I'm trying to grab a string from a user input with gulp-prompt and invoke a build and deployment function with gulp.series() . My tasks within gulp.series() don't fire at all. gulp.task('test', function(){ const prompt = require('gulp-prompt'); return gulp.src('test.js') .pipe(prompt.prompt({ type: 'checkbox', name: 'env', message: 'which environment do you want to deploy to?', choices: ['qa','prod'] },function(res){

gulp : “TypeError: print is not a function”

前提是你 提交于 2019-12-10 18:04:22
问题 I am trying to build Semantic-UI with gulp in a directory, but I get having these errors : root@ks4000003:/var/www/mg.guylabbe.ca/web/inc/semantic# gulp build [10:36:53] Using gulpfile /var/www/clients/client1/web179/web/inc/semantic/gulpfile.js [10:36:53] Starting 'build'... Building Semantic [10:36:53] Starting 'build-javascript'... Building Javascript [10:36:54] 'build-javascript' errored after 19 ms [10:36:54] TypeError: print is not a function at Gulp.module.exports (/var/www/clients

Reactify transform not running when declared in package.json

我怕爱的太早我们不能终老 提交于 2019-12-10 17:48:23
问题 I'm trying to use the reactify transform with browserify and gulp. This gulp task works: return browserify({ paths: ['./node_modules','./app/scripts/'], entries: ['./app/scripts/index.js'], transform: ['reactify'], debug: true }) .bundle() .pipe(source('bundle.js')) .pipe(gulp.dest('.tmp/scripts/')); If i remove the transform key from gulp and move it to package.json: "browserify": { "transform": [ ["reactify", {"es6": true}] ] } The transform no longer runs (also tried without es6). I'm

How to test my jQuery plugin with Gulp, Jasmine and NodeJS?

半城伤御伤魂 提交于 2019-12-10 17:16:34
问题 I created a simple jQuery plugin, which modifies the HTML according to some simple rules, using jQuery. Now I need to test that it works. I use Gulp for build automation. I decided to use Jasmine for unit testing. My question is how do I run my plugin from the test.js and validate the result? I have node.js installed at the build server. 回答1: Solution Use jsdom to emulate a browser within your Jasmine unit tests. Details jsdom is "a pure-JavaScript implementation of many web standards...for

How to add Gulp to my project?

旧城冷巷雨未停 提交于 2019-12-10 17:09:37
问题 I'm using Windows 7, Visual Studio 2013. I'm trying to set up Gulp in my Client's project. I've added those Nugets to the project: Node.js version 0.12.0 Npm.js version 1.3.15.10. For some reason I don't know, when running npm init inside the nuget package manager when the default project is the client, it is not creating a package.json file, no question are asked regarding the file, and the command never exits. Is this related somehow to the fact that I only worked through the Visual Studio

Skipping Tasks Listed as Dependencies in Gulp

a 夏天 提交于 2019-12-10 16:33:56
问题 I have looked all over the documentation and NPM to try to find a solution to this, but I have had no luck. I would like to have the option to skip the tasks that I list as dependencies when running a specific task. For example, if I have the following: gulp.task('prerun', function(){ // do cleaning, installation, etc. }); gulp.task('run', ['prerun'], function(){ // do stuff }); gulp.task('watch', function(){ gulp.watch('glob/glob/**', ['run']); }); I would like to be able to have my gulp

Gulp - Cannot find module 'gulp-rename'

纵然是瞬间 提交于 2019-12-10 16:05:16
问题 I trying to set up Gulp to compile a SCSS file and also rename the SCSS file in the process - so for example: I want SCSS/original.scss to be saved as CSS/new.css This is on a Windows 10 VM I have installed Gulp, installed gulp-sass which all worked just fine var gulp = require('gulp'); var sass = require('gulp-sass'); gulp.task('compile-new-main', function(){ return gulp.src('scss/new-main.scss') .pipe(sass()) // Using gulp-sass .pipe(gulp.dest('css')) }); Running the above gulp task works