gulp

Gulp - jQuery is not defined

扶醉桌前 提交于 2020-01-06 15:48:06
问题 My gulp application seems to work fine but the jQuery doesn't get executed for some reason. I am new to Gulp and I can't figure out this issue. This is my gulpfile.js var gulp = require('gulp'); var sass = require('gulp-sass'); var jshint = require('gulp-jshint'); var stylish = require('jshint-stylish'); var concat = require('gulp-concat'); var uglify = require('gulp-uglify'); var rename = require("gulp-rename"); var imagemin = require('gulp-imagemin'); var plumber = require('gulp-plumber');

Error using karma-browserify with browserify-shim

一世执手 提交于 2020-01-06 03:55:05
问题 I'm trying to use karma-browserify together with browserify-shim with no success. Here is a repo to reproduce the error: https://github.com/pelizza/karma-browserify-shim PhantomJS 2.1.1 (Mac OS X 0.0.0) ERROR TypeError: undefined is not an object (evaluating 'module.exports = ex') at /var/folders/_0/ql88mbyd6v34qsmysr5kf4780000gn/T/e0c5e5ebe3f49930de3d988c7196737f.browserify:40308 <- bower_components/jquery/dist/jquery.js:9837:0 Everything works fine when bundling with browserify, by it seems

AngularJS - cannot create property method on string

梦想的初衷 提交于 2020-01-06 03:22:10
问题 I am sending a normal get request as follows which was working normally: service.show = function (slug) { console.log(slug) return $http.get('api/packages/'+slug, slug).success(function(response){ service.package = response.package; }); }; Suddenly after I started combining all js files together using gulp I get this weird error: angular.js:10147 TypeError: Cannot create property 'method' on string 'package-38' Since the application is an api so I tried to run the request using postman to see

Using Gulp to create an SVG sprite without compression

可紊 提交于 2020-01-06 03:14:20
问题 I'm attempting to use this plugin on every SVG in a given project. I believe the default compression or reformatting of the svg's themselves is causing issues however. For example, I have a standard three bar menu icon: <?xml version="1.0" encoding="UTF-8" standalone="no"?> <svg width="200px" height="180px" viewBox="0 0 200 180" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule=

Visual Studio 2013/2015 - node package build error (gulp_util)

你。 提交于 2020-01-05 14:53:06
问题 A little background: My team has a web branding project in Visual Studio, just static HTML, CSS and a little javascript - no .NET classes or anything. We added node, npm, gulp and some gulp task packages to take care of some bundling and minification. The gulp tasks run fine via the Task Runner Explorer, no issues. However, some of our team are getting an error when attempting to build the project (in order to view the static pages in browsers through IIS): Error 13 The command ""C:\TFS

How can we run Autoprefixer after “compass watch” using Gulp?

微笑、不失礼 提交于 2020-01-05 12:33:41
问题 I want to take advantage of running autoprefixer after compass watches for changes to my scss files and update the css file with the autoprefixed code, but I'm stuck. I created a gulp.task in gulpfile.js for compass and autoprefixer. When I run "gulp server" using the gulpfile.js below everything works but no autoprefixing; the scss files are run through compass and output as a css file and browserSync live-reloads the page in the browser. Any help would be greatly appreciated. 'use strict';

npm install --g gulp - hangs

こ雲淡風輕ζ 提交于 2020-01-05 05:07:00
问题 Windows PowerShell Copyright (C) 2014 Microsoft Corporation. All rights reserved. PS C:\Windows\system32> npm install --g gulp npm ERR! Windows_NT 6.3.9600 npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Karol\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\np m-cli.js" "install" "--g" "gulp" npm ERR! node v5.4.1 npm ERR! npm v3.10.5 npm ERR! code ETIMEDOUT npm ERR! errno ETIMEDOUT npm ERR! syscall connect npm ERR! network connect ETIMEDOUT 151.101.12.162:443 npm ERR! network

npm install --g gulp - hangs

房东的猫 提交于 2020-01-05 05:06:40
问题 Windows PowerShell Copyright (C) 2014 Microsoft Corporation. All rights reserved. PS C:\Windows\system32> npm install --g gulp npm ERR! Windows_NT 6.3.9600 npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Karol\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\np m-cli.js" "install" "--g" "gulp" npm ERR! node v5.4.1 npm ERR! npm v3.10.5 npm ERR! code ETIMEDOUT npm ERR! errno ETIMEDOUT npm ERR! syscall connect npm ERR! network connect ETIMEDOUT 151.101.12.162:443 npm ERR! network

Using Gulp 4 with Promises to Clean/Copy Files

*爱你&永不变心* 提交于 2020-01-05 03:54:07
问题 I am very new to Promises, but would like to use them to sequentially fire off a clean (deleting files) and then a make (copying files from source to build). gulp.task('make-app', function makeApp(done) { function make() { return gulp.src(getPatterns('src-app')) .pipe(gulp.dest('./build/app/')); } return (args.noclean && !args.deploy) ? make() : del(getPatterns('dest-app') .then(make); // .then(done); }); Some things to note: getPatterns() is a function which simply returns a glob pattern

Move browserify workflow into gulp task [vueify, browserify, babelify]

强颜欢笑 提交于 2020-01-05 02:28:11
问题 I'm trying to migrate the following browserify workflow into a single gulp task: package.json: "scripts": { "build": "browserify src/main.js > dist/build.js" }, ... "browserify": { "transform": [ "vueify", "babelify" ] } .babelrc file: { "presets": ["es2015"] } Since gulp-browserify is now longer maintained, I used this recipe to get the whole workflow into a single gulp task: gulp.task('build', function () { var b = browserify({ entries: './src/main.js', debug: true, transform: [vueify,