gulp

Node App works on Heroku Local but crashes on Heroku server. using simple Foundation template project

一世执手 提交于 2019-12-13 04:26:47
问题 I am trying to deploy a Foundation web app based on Yarn, Gulp and Node.js on Heroku. It works with heroku local web but crashes on the Heroku server. I have set the port correctly. I am trying to remove Browsersync and use gulp-connect instead. In my gulpfile.js I have set the connectHeroku task which is run after build. I have set the yarn start command in the environment for Heroku. Here is my gulp.babel.js : 'use strict'; import plugins from 'gulp-load-plugins'; import yargs from 'yargs';

Deploy gulp project to azurewebsites

六眼飞鱼酱① 提交于 2019-12-13 04:10:33
问题 My project looks something like this: ├── bower.json ├── src │ ├── bower_components │ ├── images │ ├── index.html │ ├── scripts.min.js │ └── styles.min.css ├── gulpfile.js ├── index.html ├── node_modules │ ├── gulp-module-1 │ └── gulp-module-2 ├── package.json └── README And I build it on localhost by 'gulp serve'. How can I host in on ftp server (azurewebsites)? What to upload? 回答1: Please look at the comment first! Below answer is just for the case that your gulp serve is used for compiling

Jquery library not working after gulp bundle

这一生的挚爱 提交于 2019-12-13 03:45:32
问题 I am quite a newbie for gulp but i am trying to implement it in my this project. But looks like somewhere i mashup. I order the js files and was trying to get the bundle. But looks like jquery lib or something is not working. Here is my gulpfile.js code: 'use strict'; // include all necessary plugins in gulp file var gulp = require('gulp'); var order = require('gulp-order'); var concat = require('gulp-concat'); var sass = require('gulp-sass'); var sourcemaps = require('gulp-sourcemaps'); var

BrowserSync Gulp doesn't open in Chrome

ぐ巨炮叔叔 提交于 2019-12-13 02:46:01
问题 I try to open my website on localhost using BrowserSync and Gulp in Chrome, but it doesn't work. Default, it open in Firefox and everything works well. But, when I change params in gulpfile.js to open website in Chrome - I have this information: [Browsersync] Couldn't open browser (if you are using BrowserSync in a headless environment, you might want to set the open option to false) My config in gulpfile.js: // browser-sync options // see: https://www.browsersync.io/docs/options/ var

gulp常用插件之gulp-load-plugins使用

风流意气都作罢 提交于 2019-12-13 02:37:45
更多gulp常用插件使用请访问: gulp常用插件汇总 gulp-load-plugins 这是一款批量引入package.json文件中的依赖项工具。 更多使用文档请点击访问gulp-load-plugins工具官网 。 安装 npm install --save-dev gulp-load-plugins 使用 给定一个 package.json 文件,该文件具有以下依赖关系: { “依赖”:{ “ gulp-jshint ”:“ * ”, “ gulp -concat ”:“ * ” } } 将此添加到您的Gulpfile.js: const gulp = require('gulp'); const gulpLoadPlugins = require('gulp-load-plugins'); const plugins = gulpLoadPlugins(); 或者,甚至更短: const gulp = require('gulp'); const plugins = require('gulp-load-plugins')(); 将导致以下情况的发生(大致来说,插件是延迟加载的,但实际上您不会注意到任何区别): plugins.jshint = require('gulp-jshint'); plugins.concat = require('gulp-concat')

gulp常用插件之yargs使用

二次信任 提交于 2019-12-13 02:09:12
更多gulp常用插件使用请访问: gulp常用插件汇总 yargs 这是一款通过解析参数并生成优雅的用户界面来帮助您构建交互式命令行工具。处理命令行参数的通用解决方案,只要一句代码 var args = require('yargs').argv;就可以让命令行的参数都放在变量args上,可以根据参数判断是测试环境还是正式环境。 更多使用文档请点击访问yargs工具官网 。 安装 npm install --save yargs 使用 单字符的简单参数,如传入-m=5或-m 5,则可得到args.m = 5 多字符参数(必须使用双连字符),如传入--test=5或--test 5,则可得到args.test = 5。 不带值的参数,如传入--production,则会被认为是布尔类型的参数,可得到args.production = true。 简单的例子: #!/usr/bin/env node const argv = require('yargs').argv if (argv.ships > 3 && argv.distance < 53.5) { console.log('Plunder more riffiwobbles!') } else { console.log('Retreat from the xupptumblers!') } 输出结果: $ .

gulp常用插件之del使用

吃可爱长大的小学妹 提交于 2019-12-13 01:55:36
更多gulp常用插件使用请访问: gulp常用插件汇总 del 这是一款删除文件的工具。 更多使用文档请点击访问del工具官网 。 安装 npm install del API del(patterns, options) 返回Promise<string[]>带有删除路径的路径。 del.sync(patterns, options) 返回string[]带有删除路径的路径。 参数解析 patterns 类型: string | string[] options 类型: object 您可以指定任何的 globby选项 ,除了以下选项。与此相反的 globby 默认值, expandDirectories , onlyFiles ,和 followSymbolicLinks 是 false 默认。 force 类型: boolean 默认值: false 允许删除当前工作目录和外部目录。 dryRun 类型: boolean 默认值: false 查看将被删除的内容。 const del = require('del'); (async () => { const deletedPaths = await del(['temp/*.js'], {dryRun: true}); console.log('Files and directories that would be

Gulp + Bower support in VS2015 for an upgraded project

陌路散爱 提交于 2019-12-13 01:28:29
问题 I'm basically trying to figure out what I need to do, to make an MVC project (created in Visual Studio 2013) to behave like a fresh MVC project created directly in Visual Studio 2015. What I've noticed is that I see more interesting things in Visual Studio 2015 with a newly created project, and I'm sure some of these would be useful, but I can't figure out the magic to get them enabled. I've tried doing some googling but unfortunately keep finding tutorials for VS2013 support which isn't what

Return value missed within the closure after browserified

风格不统一 提交于 2019-12-13 01:24:37
问题 My original script looks like this: (function() { // result = doSomeWorks() return result; })(); Which I can get a return value from APIs like chrome.tabs.executeScript or execute_script of selenium/webdriver. But after the script being browserified (http://pastebin.com/7dBJuGzL), the return value seems just missed. I always get a null value from the above APIs. Is there any solution/workaround for this? Or maybe trying to get the return value from a browserified script it just not idiomatic

gulp.watch() not running subsequent task

我们两清 提交于 2019-12-13 01:19:32
问题 Running into a bizarre bug when trying to make modular gulp tasks by splitting them into separate files. The following should execute the task css , but does not: File: watch.js var gulp = require('gulp'); var plugins = require('gulp-load-plugins')(); gulp.task('watch', function () { plugins.watch('assets/styl/**/*.styl', ['css']); // PROBLEM }); Declaring ['css'] in plugins.watch() should technically run the following task next: File: css.js var gulp = require('gulp'); var plugins = require(