gulp

gulp autoprefixer doesn't add moz prefix

丶灬走出姿态 提交于 2019-12-05 07:49:00
I am using gulp with autoprefixer in my project, and I have to use backgrounds gradient like this: background: linear-gradient(#e98a00, #f5aa2f); but output is: background:-webkit-linear-gradient(#e98a00,#f5aa2f); background:linear-gradient(#e98a00,#f5aa2f); What wrong with me? Part of Gulpfile.js gulp.task('styles', function() { return gulp.src(['css/less/mainPage.less']) .pipe(plumber()) // .pipe(concat('base.scss')) .pipe(less()) .pipe(prefix([{ browsers: ['IE 8', 'IE 9', 'last 5 versions', 'Firefox 14', 'Opera 11.1'] }])) .pipe(minifyCSS({keepBreaks: true})) .pipe(gulp.dest('css')) .pipe

Gulp with browserify: Cannot find module src/js/main.js

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-05 07:43:52
I'm trying to get a basic build set up using Gulp and browserify, but keep seeing this error when trying to run the default task: Error: Cannot find module 'src/js/main.js' from '/Users/ben/dev/git/myapp/' gulpfile.js var gulp = require('gulp'); var browserify = require('browserify'); var del = require('del'); var source = require('vinyl-source-stream'); var paths = { main_js: ['src/js/main.js'], js: ['src/js/*.js'] }; gulp.task('clean', function(done) { del(['build'], done); }); gulp.task('js', ['clean'], function() { browserify(paths.main_js) .bundle() .pipe(source('bundle.js')) .pipe(gulp

Avoiding NPM global install using .bash_profile and “postinstall” script

╄→尐↘猪︶ㄣ 提交于 2019-12-05 07:34:40
问题 NPM philosophy, for better or worse, is to have all necessary dependencies for a project to be locally installed, in ./node_modules , and for package.json to reflect all necessary deps. I have a library, that would typically benefit from both global installation and local installation, similar to Gulp, Mocha, etc. One of the most insiduous problems with the above, is that the global and local versions might differ, causing compatibility issues for a given project. It occurred to me that we

gulp-ruby-sass not a recognized command in Windows

空扰寡人 提交于 2019-12-05 07:33:34
I'm trying out gulp for the first time on a Windows Server 2012 VM. I'm normally a Mac user, so I'm a bit new to Windows & Powershell for dev tools like this. I installed Node.js & npm (and nothing else). I created the following basic Gulpfile to compile my Sass: Gulpfile.js var gulp = require('gulp'), sass = require('gulp-ruby-sass'); gulp.task('styles', function() { return gulp.src('Content/sass_new/application.scss') .pipe(sass({ style: 'expanded', })) .pipe(gulp.dest('Content/css')) }); gulp.task('watch', function() { gulp.watch('Content/sass_new/*', ['styles']); }) gulp.task('default', [

gulp command to take parameters

淺唱寂寞╮ 提交于 2019-12-05 07:01:45
问题 my package.json has scripts like this { "scripts": { "pretest": "npm run tsc", "test": "gulp e2e", } } we use typescript and webdriverIO for automation. I want to use gulp so that i can pass parameters to my test framework. Example: npm test --suite HomePageTests then the specs related to Home page must run. I have the gulp file like this // gulpfile.js const gulp = require('gulp'); const Launcher = require('webdriverio/build/lib/launcher'); const wdio = new Launcher(path.join(__dirname, 'src

Custom Deployment to Azure Websites

只谈情不闲聊 提交于 2019-12-05 06:04:19
I recently started using Gulp.js to package all my CSS and JavaScript into single files, which I then include in my web app. My web app is written in Python (using Flask ). I obviously don't want to track the Gulp output CSS and JS files using git (since they're build output files). I deploy my website to Azure Websites using push to deploy. That is, I simply run git push azure master and Azure automatically figures out that I'm using Python, sets up virtualenv , installs pip dependencies and so on. This article describes how to set this up . This process works great, but now that I've started

Why does Gulp fail to automatically re-process my JS upon changes?

a 夏天 提交于 2019-12-05 05:22:31
In my gulpfile.js , JS changes automatically trigger both BrowserSync reload and my JS processing task. But for some reason, although the reload does work, my JS task fails to correctly process JS changes and create new JS file in dist/ folder. I have to restart Gulp for that. Why? Gulpfile.js: var gulp = require('gulp'); var sass = require('gulp-sass'); var browserSync = require('browser-sync').create(); var concat = require('gulp-concat'); var jshint = require('gulp-jshint'); var uglify = require('gulp-uglify'); gulp.task('sass', function() { return gulp.src('../assets/styles/**/*.scss')

gulp常用命令

筅森魡賤 提交于 2019-12-05 05:09:57
gulp常用命令: 下载gulp: npm i gulp nrm(npm registry manager )是npm的镜像源管理工具,有时候国外资源太慢,使用这个就可以快速地在 npm 源间切换 创建任务: gulp.task(); 获取需要执行人物的文件路径: gulp.src() ; 需要执行的操作都都需要放入 pipe() 方法中 将处理好的文件放入目标路径下: .gulp.pipe(gulp.dest()) 使用方式: // 目标: 复制 src/default.html 到 dist 目录下 //1. 加载 gulp 模块 //加载第三方模块,也只需要将模块名填入即可 const gulp = require('gulp'); //加载 gulp-htmlmin 模块,用来对html代码进行压缩 const htmlmin = require('gulp-htmlmin'); //加载 gulp-file-include 模块,用来引入html文件的公共区域 const includeFile = require('gulp-file-include'); //2. 编写任务 --- task 方法 //参数1: 任务名称 --- 自定义 //参数2: 回调函数 --- 因为gulp的版本原因,目前最新版需要加 async 进行修饰 gulp.task('first',

Compiling SASS and SUSY with GULP

自闭症网瘾萝莉.ら 提交于 2019-12-05 05:02:38
问题 I am trying to get gulp to compile my sass and use the susy grid/framework. I'm having troubles finding any information about this online. I have included: "gulp-ruby-sass": "^0.7.1", into my package.json and installed everything. My gulp sass gulp task likes like so: gulp.task('sass', ['images'], function () { return gulp.src('src/sass/*.{sass, scss}') .pipe(sass({ bundleExec: true, sourcemap: true, sourcemapPath: '../sass' })) .on('error', handleErrors) .pipe(gulp.dest('build')); }); So I

运行gulp提示:Task function must be specified

我的梦境 提交于 2019-12-05 04:57:45
运行gulp提示:Task function must be specified 问题出在gulp版本上,以下是gulp3 VS gulp4的区别: gulp4最大的变化是不能像以前那样传递一个依赖的任务列表。 gulp3中,如果有一个任务A、B和C的列表,你想在一个序列中运行(确保A在B开始之前完成,而B在C开始之前完成),代码如下: 1 2 3 4 5 6 7 8 9 10 11 gulp.task( 'a' ,() => { // Do something }); gulp.task( 'b' ,[ 'a' ],() => { // Do something }); gulp.task( 'c' ,[ 'b' ],() => { // Do something });  在gulp4中,不能再这样做了。会得到以下错误: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 $ gulp c assert.js:350 throw err; ^ AssertionError [ERR_ASSERTION]: Task function must be specified at Gulp.set [as _setTask] (C:\Users\zxq\Desktop\gulpCourse\node_modules\_undertaker@1.2.0