gulp

Visual Studio 2015 ASP.NET 5, Gulp task not copying files from node_modules

本秂侑毒 提交于 2019-12-18 12:16:49
问题 I am attempting to alter a task runner script that I borrowed from here, however; after the task runner successfully executes in Visual Studio 2015's Task Runner Explorer -- the files are not actually copied. Here is the altered script: /// <binding BeforeBuild='copy-assets' /> "use strict"; var _ = require('lodash'), gulp = require('gulp'); gulp.task('copy-assets', function() { var assets = { js: [ './node_modules/bootstrap/dist/js/bootstrap.js', './node_modules/systemjs/dist/system.src.js',

What exactly does .pipe() mean in gulp?

℡╲_俬逩灬. 提交于 2019-12-18 12:12:30
问题 I am relatively new to gulp, and I was wondering what exactly does the .pipe() do in a gulp task? I've gathered that it usually runs after a return and after .src , but there must be more to it than that. I've been unable to find anything on the web or in gulp's documentation and I really want to understand what I'm using. EDIT I found this, but it does a poor job of explaining it 回答1: From the Node docs: https://nodejs.org/api/stream.html#stream_readable_pipe_destination_options The readable

How to use Sass inside a Polymer component

假装没事ソ 提交于 2019-12-18 11:53:47
问题 I'm currently using Polymer as my front end development framework. I love SASS. Now I understand I can create a Sass file and import it like I normally would. However, I've really gotten into the habit of using style tags within my web components. Basically the workflow I am looking for is to be able to simply define a script tag within my Web Component maybe add type='sass; to it. Then have grunt go through and compile all of my SASS within those tags before outputting the files to my .tmp

Issue running karma task from gulp

允我心安 提交于 2019-12-18 10:58:34
问题 I am trying to run karma tests from gulp task and I am getting this error: Error: 1 at formatError (C:\Users\Tim\AppData\Roaming\npm\node_modules\gulp\bin\gulp.js:161:10) at Gulp.<anonymous> (C:\Users\Tim\AppData\Roaming\npm\node_modules\gulp\bin\gulp.js:187:15) at Gulp.emit (events.js:95:17) at Gulp.Orchestrator._emitTaskDone (C:\path\to\project\node_modules\gulp\node_modules\orchestrator\index.js:264:8) at C:\path\to\project\node_modules\gulp\node_modules\orchestrator\index.js:275:23 at

events.js: 141 throw er; // Unhandled 'error' event

五迷三道 提交于 2019-12-18 10:48:23
问题 I'm trying to run node 4.2.2 on a Mac OS and i'm not understanding why every time i get this error message: events.js:141 throw er; // Unhandled 'error' event ^ Error: spawn /Users/user/Documents/Projects/project-x/node_modules/gifsicle/vendor/gifsicle ENOENT at exports._errnoException (util.js:874:11) at Process.ChildProcess._handle.onexit (internal/child_process.js:178:32) at onErrorNT (internal/child_process.js:344:16) at doNTCallback2 (node.js:441:9) at process._tickCallback (node.js:355

How can I set an environment variable as gulp task?

那年仲夏 提交于 2019-12-18 10:31:22
问题 I don't want type the extra arguments NODE_ENV='production' gulp every time I run gulp to set an environment variable. I would rather set the environment variable from within gulp via a task . What would be a good way to achieve this? 回答1: gulp.task('set-dev-node-env', function() { return process.env.NODE_ENV = 'development'; }); gulp.task('set-prod-node-env', function() { return process.env.NODE_ENV = 'production'; }); Use it like: gulp.task('build_for_prod', ['set-prod-node-env'], function(

Error: Cannot find module 'gulp-sass'

独自空忆成欢 提交于 2019-12-18 10:17:56
问题 When I compile with gulp , I got an error like below. How can I fix it? module.js:339 throw err; ^ Error: Cannot find module 'gulp-sass' at Function.Module._resolveFilename (module.js:337:15) at Function.Module._load (module.js:287:25) at Module.require (module.js:366:17) at require (module.js:385:17) at Object.<anonymous> (/Applications/XAMPP/xamppfiles/htdocs/flyscoot.com/gulpfile.js:2:12) at Module._compile (module.js:435:26) at Object.Module._extensions..js (module.js:442:10) at Module

How to run bash commands in gulp?

你离开我真会死。 提交于 2019-12-18 10:15:11
问题 I want to add some bash commands at the end of gulp.watch function to accelerate my development speed. So, I am wondering if it is possible. Thanks! 回答1: Use https://www.npmjs.org/package/gulp-shell. A handy command line interface for gulp 回答2: I would go with: var spawn = require('child_process').spawn; var fancyLog = require('fancy-log'); var beeper = require('beeper'); gulp.task('default', function(){ gulp.watch('*.js', function(e) { // Do run some gulp tasks here // ... // Finally execute

How can Gulp be restarted upon each Gulpfile change?

醉酒当歌 提交于 2019-12-18 10:02:14
问题 I am developing a Gulpfile . Can it be made to restart as soon as it changes? I am developing it in CoffeeScript. Can Gulp watch Gulpfile.coffee in order to restart when changes are saved? 回答1: You can create a task that will gulp.watch for gulpfile.js and simply spawn another gulp child_process. var gulp = require('gulp'), argv = require('yargs').argv, // for args parsing spawn = require('child_process').spawn; gulp.task('log', function() { console.log('CSSs has been changed'); }); gulp.task

Gulp Changed doesn't work

非 Y 不嫁゛ 提交于 2019-12-18 09:04:17
问题 I have previously used gulp changed with my JS without a problem. However now I am trying to use gulp-changed and gulp-newer on my scss files without it detecting which file has changed. var changed = require('gulp-changed'); var newer = require('gulp-newer'); var SRC = './stylesheets/**/*.scss'; var DEST = './stylesheets'; gulp.task('sass', function () { return gulp.src(SRC) .pipe(changed(DEST)) //tried newer here as well .pipe(sass()) .pipe(gulp.dest(DEST)) }); When changing a scss file it