gulp

How do I output gulp results to console?

£可爱£侵袭症+ 提交于 2019-11-30 08:15:12
I want to put my spellcheck results out to the console instead of to a file and I think this should work since as I understand it gulp returns a stream. Instead I get an error: TypeError: Object #<Stream> has no method 'read' Here is my code gulp.task('spellcheck', function() { var patterns = [{ // Strip tags from HTML pattern: /(<([^>]+)>)/ig, replacement: '' }]; var spellSuggestions = [{ pattern: / [^ ]+? \(suggestions:[A-z, ']+\)/g, replacement: function(match) { return '<<<' + match + '>>>'; } }]; var nonSuggestions = [{ pattern: /<<<.+>>>|([^\s]+[^<]+)/g, replacement: function(match) { if

Running gulp task from one gulpfile.js from another gulpfile.js

泄露秘密 提交于 2019-11-30 07:21:48
问题 Perhaps it's something wrong with my approach but I have a following situation: I have a component-a that has a gulpfile. One of its tasks (eg. build) builds the component and creates a combined js file in dist folder I have a component-b that has a gulpfile. One of its tasks (eg. build) builds the component and creates a combined js file in dist folder I have a project that uses both components. This project has a gulpfile as well and in it I would like to write a task that: executes build

How do I force gulp calls to run synchronously?

萝らか妹 提交于 2019-11-30 06:56:58
问题 I want the gulp calls below to run synchronously, one after the other. But they do not follow an order. The run-sequence node module doesn't help here, as I'm not trying to run gulp tasks in series (i.e. it has syntax similar to gulp.task("mytask", ["foo", "bar", "baz"] etc.), but rather gulp "calls" in series, as you see below. gulp.task("dostuff", function (callback) { gulp .src("...") .pipe(gulp.dest("..."); gulp .src("...") .pipe(gulp.dest("..."); gulp .src("...") .pipe(gulp.dest("...");

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

别来无恙 提交于 2019-11-30 06:44:33
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', './node_modules/angular2/bundles/angular2.dev.js', './node_modules/angular2/bundles/router.dev.js', '

Run code after gulp task done with all files

故事扮演 提交于 2019-11-30 06:24:42
问题 So I have been trying out Gulp to see how it compares to Grunt as far as speed and I am pretty impressed with the results but I have one thing I don't know how to do in Gulp. So I have this gulp task to minify HTML: gulp.task('html-minify', function() { var files = [ relativePaths.webPath + '/*.html', relativePaths.webPath + '/components/**/*.html', relativePaths.webPath + '/' + relativePaths.appPath + '/components/**/*.html' ]; var changedFiles = buildMetaData.getChangedFiles(files); //TODO:

How to disable cross-device action mirroring functionality of BrowserSync? (GhostMode)

让人想犯罪 __ 提交于 2019-11-30 05:50:53
Our team used the gulp-angular generator with yeoman to scaffold out our web app. It uses browsersync to handle live reloads, which we want. However, we just deployed to our development server, and now when two developers are using the gulp serve command at the same time, they both are shown the same window (i.e. one developer types on one window, it shows up in the other developer's window as well). I believe this is due to BrowserSync's cross-device testing capabilities, however I am at a loss for how to disable this feature. If anyone knows how to do this (preferably without disabling our

How to use npm with ASP.NET Core

纵然是瞬间 提交于 2019-11-30 05:49:25
问题 I'm using npm to manage the jQuery, Bootstrap, Font Awesome and similar client libraries I need for my ASP.NET Core application. The approach that worked for me started by adding a package.json file to the project, that looks like this: { "version": "1.0.0", "name": "myapp", "private": true, "devDependencies": { }, "dependencies": { "bootstrap": "^3.3.6", "font-awesome": "^4.6.1", "jquery": "^2.2.3" } } npm restores these packages into the node_modules folder which is on the same level as

What exactly does .pipe() mean in gulp?

女生的网名这么多〃 提交于 2019-11-30 05:39:07
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 From the Node docs: https://nodejs.org/api/stream.html#stream_readable_pipe_destination_options The readable.pipe() method attaches a Writable stream to the readable, causing it to switch automatically into flowing

UglifyJS throws unexpected token: keyword (const) with node_modules

喜你入骨 提交于 2019-11-30 05:35:21
A small project I started make use a node module (installed via npm ) that declares const variables. Running and testing this project is well, but browserify fails when UglifyJS is executed. Unexpected token: keyword (const) Here is a generic Gulp file that I have successfully been using for a few other past projects without this issue (i.e. without that particular node module). gulpfile.js 'use strict'; const browserify = require('browserify'); const gulp = require('gulp'); const source = require('vinyl-source-stream'); const derequire = require('gulp-derequire'); const buffer = require(

How to use Sass inside a Polymer component

橙三吉。 提交于 2019-11-30 05:07:17
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 directory. Is something like this achievable with something like Grunt or Gulp? If so what are the best