gulp

How to make a refresh in browser with gulp

笑着哭i 提交于 2019-12-04 16:21:13
问题 I have an app is in iis, it is an app made in angularjs and webapi C # 2.0, I would like to create a task that updates the browser as soon as I save any js file. Version of gulp: 3.9.1 gulp.task('livereload', function () { gulp.watch(config.files.js); }); 回答1: gulp-livereload A lightweight gulp plugin for livereload to be used with the livereload chrome extension or a livereload middleware. Simple to setup: var gulp = require('gulp'), less = require('gulp-less'), livereload = require('gulp

Gulp error: events.js:72

☆樱花仙子☆ 提交于 2019-12-04 16:05:20
问题 I've been trying out (or trying to get working) a jekyll style guide from: https://github.com/davidhund/jekyll-styleguide#user-content-requirements My gulpfile is: var gulp = require('gulp'); var sass = require('gulp-ruby-sass'); var autoprefixer = require('gulp-autoprefixer'); var browserSync = require('browser-sync'); var rename = require('gulp-rename'); var concat = require('gulp-concat'); var minifycss = require('gulp-minify-css'); var uglify = require('gulp-uglify'); var clean = require(

gulp how to sync folders using gulp while ignoring some patterns

房东的猫 提交于 2019-12-04 15:49:24
问题 I want to sync two folders using gulp. I have managed to achieve this with the a package called gulp-directory-sync (see included task below), but now I need to exclude some files from the sync based on if the file or directory name starts with "__" (two underscores). I have tried to find a sync plugin with an ignore or exclude feature, but without success, so I am now wondering if anyone might know a workaround for this. var gulp = require('gulp'); var dirSync = require('gulp-directory-sync'

How to tell gulp-connect to open index.html regardless of the URL?

谁说胖子不能爱 提交于 2019-12-04 15:48:35
问题 I have the following gulp task: gulp.task('connect', function() { connect.server({ root: __dirname, livereload: true }); }); and the following Angular routes: angular.module("MyApp", ["ngRoute"]).config(function($routeProvider, $locationProvider) { $locationProvider.html5Mode(true); $routeProvider .when("/", { controller: "DashboardCtrl", templateUrl: "templates/dashboard.html" }) .when("/advertiser", { controller: "AdvertiserCtrl", templateUrl: "templates/advertiser.html" }) .otherwise({

How can I debug gulpfile.js when running it with Visual Studio Task Runner Explorer?

时间秒杀一切 提交于 2019-12-04 15:37:19
问题 How can I debug gulpfile.js when running it with Visual Studio Task Runner Explorer? Or is there another way gulp may be launched with visual studio such that gulpfile.js may be debugged? I am aware of node-inspector but want to see if there is something native to Visual Studio. 回答1: I know that you may expect a better way of doing this but he way I currently do it is by using plain console.log() statements inside the gulpfile.js That way I can inspect the variables and try and spot any logic

Browserify with Zurb Foundation Framework

Deadly 提交于 2019-12-04 14:08:07
POST-SOLUTION EDIT Here's a Yeoman generator to scaffold out a project with Foundation and Browserify: https://github.com/dougmacklin/generator-foundation-browserify I'm trying to figure out how to properly bundle the foundation framework js with browserify . In my project folder, I install it along with jQuery (which it depends on): npm install jquery foundation-sites --save Then in my main.js I have the following: var $ = jQuery = require('jquery'); var foundation = require('foundation-sites'); $(document).foundation(); I include the $ = jQuery = ... because if I don't I get a jQuery is not

browser-sync is blocked by chrome csp

守給你的承諾、 提交于 2019-12-04 13:55:27
I have a gulp task that runs browsersync. var options = { proxy : 'localhost:9000/html' , port : 3000 , files : [ config.root + config.srcPaths.htmlBundle , config.htmlRoot + 'main.css' , '!' + config.htmlRoot + '**/*.scss' ] , injectChanges : false , logFileChanges : true , logPrefix : 'broserSync ->' , notify : true , reloadDelay : 1000 }; browserSync( options ); browsersync detects changes and tries to inject them but chrome blocks it with this error: Refused to connect to 'ws://localhost:3000/browser-sync/socket.io/?EIO=3&transport=websocket&sid=gOQQPSAc3RBJD2onAAAA' because it violates

Gulp - Handling multiple themes and folders

╄→гoц情女王★ 提交于 2019-12-04 13:23:15
问题 I am trying to create an ultimate gulpfile that we can use on one of our big sites (one with multiple themes depending on the section of the site you are in). I'm trying to get it to only run the process it needs to run and not recompile everything. Let me layout exactly what i'm trying to achieve: Folder Structure src/ master-theme/ css/ style.scss partials/ _a.scss _b.scss img/ a.jpg b.jpg sub-theme/ css/ style.scss partials/ _c.scss _d.scss img/ c.png d.jpg I want these files to be

gulp与webpack-stream集成配置

帅比萌擦擦* 提交于 2019-12-04 12:47:06
webpack非常强大,但是也有不足的地方,批量式处理依然是gulp更胜一筹.我们是否可以将两者的优点结合起来呢? 这篇文章就是讲述如何集成gulp和webpack 1.安装webpack-stream 很重要的插件,当然也可以直接使用官方的webpack,集成方式可以看webpack官网. 但webpack-stream更符合gulp的流语法. sudo npm install --save webpack-stream vinyl-named windows用户去掉sudo, vinyl-named用来保持输入和输出的文件名相同, 否则会自动生成一个hash. 2.配置文件的编写: gulpfile.js var gulp = require('gulp'); var webpack = require('webpack-stream'); var named = require('vinyl-named'); var webpackConfig = require("./webpack.config.js"); gulp.task('webpack', function() { return gulp.src('./www/src/main.jsx') .pipe(named()) .pipe(webpack(webpackConfig)) .pipe(gulp.dest('

Using SASS with Aurelia's Skeleton Navigation project

谁都会走 提交于 2019-12-04 12:36:52
问题 var gulp = require('gulp'); var sass = require('gulp-sass'); var runSequence = require('run-sequence'); var changed = require('gulp-changed'); var plumber = require('gulp-plumber'); var to5 = require('gulp-babel'); var sourcemaps = require('gulp-sourcemaps'); var paths = require('../paths'); var compilerOptions = require('../babel-options'); var assign = Object.assign || require('object.assign'); // transpiles changed es6 files to SystemJS format // the plumber() call prevents 'pipe breaking'