gulp

Gulp

丶灬走出姿态 提交于 2019-12-06 07:56:51
date: 2016-05-16 16:08:19 特点: 易于使用:通过代码优于配置的策略,Gulp 让简单的任务简单,复杂的任务可管理。 构建快速:利用 Node.js 流的威力 插件高质:Gulp 严格的插件指南确保插件如你期望的那样简洁高质得工作。 易于学习:通过最少的 API,掌握 Gulp 毫不费力,构建工作尽在掌握:如同一系列流管道。 使用指南: 1.创建项目文件夹(如gulp): mkdir gulp 2.全局安装gulp: $ npm install -g gulp 3.项目的开发依赖(devDependencies)安装: $ npm install gulp --save-dev 4.在gulp文件夹下创建一个名 gulpfile.js(打包工具) 的文件 var gulp = require('gulp'); gulp.task('default', function() { // 将你的默认的任务代码放在这 }); 5. 运行 gulp: $ gulp/gulp default 默认的名为 default 的任务(task)将会被运行,在这里,这个任务并未做任何事情。想要单独执行特定的任务(task),请输入 gulp <task> <othertask>。 可以做些什么?可看下文练习展示 var concat = require('gulp-concat

Browserify with Zurb Foundation Framework

两盒软妹~` 提交于 2019-12-06 07:14: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

ES6 编译 ES5 环境搭建

旧时模样 提交于 2019-12-06 07:08:53
目录结构 scripts main.es6 products.es6 temp gulpfile.js package.json index.html 文件内容 package.json { "devDependencies": { "browserify": "^11.2.0", "gulp": "^3.9.0", "gulp-babel": "^5.2.1", "gulp-buffer": "0.0.2", "gulp-clean": "^0.3.1", "gulp-uglify": "^1.4.1", "vinyl-source-stream": "^1.1.0" } } gulpfile.js var gulp = require('gulp'), babel = require('gulp-babel'), browserify = require('browserify'), source = require('vinyl-source-stream'), buffer = require('gulp-buffer'), uglify = require('gulp-uglify'), clean = require('gulp-clean') ; gulp.task('help', function () { console.log( `使用帮助: gulp

Gulp plugin for running a PHP server?

馋奶兔 提交于 2019-12-06 06:38:51
I'm looking to transition over from grunt to gulp. However I'm not finding a way to serve PHP files with livereload support, such as gateway ( https://www.npmjs.org/package/gateway ) using mounts. Are ther any plugins out there for running/server PHP using a gulp task? 来源: https://stackoverflow.com/questions/26226881/gulp-plugin-for-running-a-php-server

javascript, gulp, watch, changed

强颜欢笑 提交于 2019-12-06 06:06:00
问题 I cannot get my head around this. This is supposed to be a gulp task that is executed every time a watched file is modified. Can anyone explain why it is required to pipe the watched files through the changed plugin? gulp.task('build-css', function () { return gulp.src(paths.css) .pipe(changed(paths.output, {extension: '.css'})) .pipe(gulp.dest(paths.output)); }); gulp.task('watch', ['serve'], function() { gulp.watch(paths.css, ['build-css']); }); Disclaimer: this is not my code. Just trying

npm hangs while trying to install gulp

99封情书 提交于 2019-12-06 05:55:15
UPDATED: When I try to install any package with 'npm install', or any variant: npm install gulp -g -verbose npm install gulp -verbose npm install gulp npm install npm install connect I get the following output but it just hangs on the last line, never finishing the install: npm info it worked if it ends with ok npm verb cli [ 'C:\\Program Files\\nodejs\\\\node.exe', npm verb cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js', npm verb cli 'install', npm verb cli 'gulp', npm verb cli '-g', npm verb cli '-verbose' ] npm info using npm@2.5.1 npm info using node@v0.12.0 npm verb

Gulp Vinyl FTP using Gulp newer is not noticing changes in files and is therefore not deploying UPDATE: TIME ZONE ISSUE

可紊 提交于 2019-12-06 05:54:45
问题 RESOLVED: I built a gulp plugin to solve the problem... https://www.npmjs.com/package/gulp-mtime-correction The issue I'm having is that my gulp task using Vinyl-FTP and Gulp-Newer doesn't seem to be noticing changes in my files and therefore is not sending the changes via FTP. So here are the FTP gulp settings/tasks in gulpfile.js // FTP settings const FTP = { connOpts : { host : 'ftp.****.co.uk', user : '****', password : '*****', parallel : 10, log : gutil.log }, directoryPath :

Chain Gulp glob to browserify transform

只谈情不闲聊 提交于 2019-12-06 05:51:34
问题 I have a project with a few relatively disjoint pages, each including their own entry point script. These scripts require a number of others using commonjs syntax, and need to be transformed by 6to5 and bundled by browserify. I would like to set up a gulp task that captures all the files matching a pattern and passes them on to the bundler, but I'm not sure how to pass files from gulp.src to browserify(filename) . My gulpfile looks like: var gulp = require("gulp"); var browserify = require(

Can I set gulp livereload to run after all files are compiled?

喜你入骨 提交于 2019-12-06 05:39:59
问题 I've got a gulp set up to work with Stylus, Jade and tiny-lr. My problem is that when I save one jade file, it start's compiling them all, therefore live reloading fires on the first file copied to the destination, before the file I am working on currently is compiled, resulting in me having to refresh manually. I have fixing this issue using "gulp-changed" but I don't seem to be able to configure it or something. Anyone had this problem before? I am posting my Gulp file so you can take a

CSS and JS minification doesn't work with gulp-filter, gulp-csso, gulp-uglify

佐手、 提交于 2019-12-06 05:16:04
I'm working thorough johnpapa's course on automation with Gulp and seem to hit a weird wall: when I'm trying to run the CSS and JS concatenation and minification task it fails to do the minification. This is the task: gulp.task('optimize', ['inject'], function () { var assets = $.useref.assets({searchPath: ''}); var cssFilter = $.filter(['**/*.css'], {restore: true}); var jsFilter = $.filter(['**/*.js'], {restore: true}); return gulp .src(config.indexFile) .pipe($.rename('test.jsp')) .pipe($.plumber()) .pipe(assets) .pipe(cssFilter) .pipe($.csso()) .pipe(cssFilter.restore) .pipe(jsFilter)