gulp

git 与npm+gulp

佐手、 提交于 2019-12-09 13:56:43
流行框架 ssh方式上传代码 公钥 私钥,两者之间是有关联的。 生成公钥,和私钥 ssh-keygen -t rsa -C "xiaoming@sina.com" 在push和pull操作进 先pull , 再push 当我们在push时,加上-u参数,那么在下一次push时 我们只需要写上 git push 就能上传我们的代码。(加上-u之后,git会把 当前分支与远程的指定的分支进行关联。git push origin master) npm node package manager 管理项目的依赖包 可以用来下载我们需要使用的东西 安装后可以通过 npm -v 查看版本 npm 使用 1.初始化操作 npm init 会生成一个package.json文件 2.下载所需要的包 npm install jquery 下载jquery 会去 registry.npmjs.org 这个地址下载jquery 会生成一个node_modules目录,下载的内容就放在这个目录 3.下载包时,可以加上 --save 参数 npm install jquery --save , 下载之后会在package.json中添加 当前下载的包的版本信息。 gulp 官网 中文网 前端自动化构建工具 js: function(){//},代码压缩,混淆 : var name = 123,var x =

Tasks for production prepared Ionic app

Deadly 提交于 2019-12-09 10:20:37
问题 I'm trying to figure out what's the best process to pass from the code to the final deployable apk/ipa. So far I have a testsuite using Karma + Jasmine, which transpiles the TypeScript to JS and runs some unit tests. I start that process via gulp. After that all I know is to ionic build android --release what generates (an unsigned yet) apk. But I'm not sure of how ofuscated/minificated the generated apk is. So, keeping in mind the code has to be as private as possible, is the minification

Browser-sync TypeError args.cb is not a function

て烟熏妆下的殇ゞ 提交于 2019-12-09 09:18:45
问题 I'm using browser-sync in gulp task for example : gulp.task('gulp-task',function(){ browserSync.init({ server:{ baseDir: 'app' } }) //rest of task }); I use this gulp task in gulp watch for( for example ) app/**/*.html like : gulp.task('watch',function(){ gulp.watch('app/**/*.html', ['gulp-task']); }); for first time change in html files everything is ok but for next changes i get error: TypeError: args.cbn is not a function ... guys said to install latest version for browser-sync with

What is the purpose(s) of JavaScript build tools

五迷三道 提交于 2019-12-09 08:08:56
问题 Lately I have been studying Node.js. In this time,I have heard a lot about using Gulp or Grunt in as a build tool. Now I am interested in learning how to use Gulp. I have heard it was a build tool, but I am not sure what all that covers. What would I do(what kind of tasks) with a build tool like Gulp that would assist me in development? Some examples would be nice. 回答1: Gulp ( and Grunt ) allows for task automation. Pretty much anything you find yourself doing repeatedly in a project, can be

Cancel Build if Task Runner Explorer Task Fails

╄→尐↘猪︶ㄣ 提交于 2019-12-09 05:18:20
问题 I am using visual studio task runner (2015) to run a Gulp task bound to before build. I have set it up so that when the gulp tasks fails it sends exit code 1 and at the end it says "Process terminated with code 1." however the build continues. This will cancel the build in team city so seems an issue linked Task Runner inside visual studio. How can I prevent the build from taking place if it exits with a code other than 0? 回答1: You are correct in that this seems to be a Task Runner issue. The

Calling gulp-notify without using .pipe()

泪湿孤枕 提交于 2019-12-09 04:36:59
问题 In my gulpfile.js I have a task that calls two other tasks. When the previous tasks have run, a notification should be triggered. var notify = require('gulp-notify'); gulp.task('build', ['build:js', 'build:css'], function() { console.log('hello', arguments); gulp.src('gulpfile.js').pipe( notify({ title: 'Production Build', message: 'Done' }) ); }); Is there a way to trigger notify without calling gulp.src('gulpfile.js').pipe( first? While not a real problem, this approach feels unnecessary to

Using Gulp to Compile Sass and minify vendor css

心不动则不痛 提交于 2019-12-09 04:08:27
问题 Getting to grips with Gulp and have a question. So I have a gulp CSS task like the below which works just fine: var sassDir = 'app/scss'; var targetCssDir = 'public/assets'; gulp.task('css', function(){ return gulp.src(sassDir + '/main.scss') .pipe(sass({ style: 'compressed' }).on('error', gutil.log)) .pipe(autoprefix('last 10 version')) .pipe(gulp.dest(targetCssDir));; }); But is there a way to add my vendor files like Bootstrap so it will be included for minification and concatenation. Hope

`gulp build` for semantic ui is giving error 'ENOENT: no such file or directory'

a 夏天 提交于 2019-12-09 03:01:16
问题 version: gulp@3.9.1 I have installed semantic-ui through npm install and given default settings during interactive setup process. But when i do gulp build from the /semantic folder i am getting following error: [20:52:27] Starting 'build'... Building Semantic [20:52:27] Starting 'build-javascript'... Building Javascript [20:52:27] Starting 'build-css'... Building CSS [20:52:27] Starting 'build-assets'... Building assets [20:52:28] Created: dist/components/site.js [20:52:28] Created: dist

gulp-nunjucks-html + gulp-data not compiling on watch

六月ゝ 毕业季﹏ 提交于 2019-12-08 21:03:30
I've written a gulp task to take data from json files and process it as html. When I first run the build this works like a charm, however I've set up a watch task to also do this and although it will rebuild the nunjucks file into html, it seems to ignore the json until the next full build (even though all the watch does is run the same task) here is my task: // Process nunjucks html files (.nunjucks) gulp.task('nunjucks', function() { 'use strict'; return gulp.src('src/html/pages/**/*.nunjucks') .pipe(plumber( { errorHandler: onError } )) .pipe(data(function(file) { return require('./src

Cannot Install gulp-sass

╄→尐↘猪︶ㄣ 提交于 2019-12-08 19:37:42
问题 I'm trying to learn how to use gulp / sass / and all the other fun tools with Nodejs and I'm having an issue installing gulp-sass. The process I'm using to install everything is: 1. Start Git Bash in the project folder 2. npm init 3. npm install gulp -g 4. npm install gulp --save-dev 5. npm install gulp-sass <- this is where I get errors Once I get to step five, I get the following error: $ npm install gulp-sass npm WARN package.json project@1.0.0 No repository field. npm WARN package.json