gulp

【译】Webpack对比

a 夏天 提交于 2020-01-21 02:20:33
  原文链接: http://survivejs.com/webpack_react/webpack_compared/ 开始正文   当你把Webpack放到过往历史中你就会很好地理解为什么它的方法是如此的有力。在早些时候,它的能力对于仅仅把一些脚本连接在一起是足够的。然而时光变迁,现在分布你的Javascript代码可以是个复杂的奋斗者号。    SPA(单页应用)的崛起    随着单页应用(SPAs,single page application)的崛起,这个问题已经逐渐凸显出来。它们倾向于使用非常多笨重的库。你最不想看到的应该是一次性地把它们全部加载出来。其实有很多很好的解决办法,Webpack与它们中的很多都可以紧密配合使用。   得益于Node.js的火爆,Node.js的包管理器npm提供了许多环境。在之前,npm还难以让开发人员去使用这些依赖。现在,随着npm已经因为前端开发而变得广为熟知,环境已经发生了很多变化。依赖管理也是越来越简单了。    任务运行工具和打包工具   从历史上来讲,已经有了很多的构建系统。 Make 可能是最广为数值的,并且仍然是个可行的选项。为了让工作简单一些,专业的任务运行工具,类似于Grunt和Gulp出现了。通过npm可获得的插件使得这些任务运行工具变得非常好用。   任务运行工具已经是高水准中的非常棒的工具了

前端开发工程师要求

匆匆过客 提交于 2020-01-21 02:17:39
前端开发工程师要求这些? 1、精通各种Web前端技术(HTML5/CSS/Javascript等),熟练跨浏览器、跨终端的开发; 2、有大型网站前端架构、前端性能、可访问性、可维护性等方面的实践经验; 3、对前端构建有一定了解(如:gulp/webpack等); 4、实际项目中应用过Vue/ReactJS/AngularJS任意一种框架为佳,并了解其中原理; 5、具有node开发经验,熟悉Express框架等主流框架 6.使用过任何一种 Web 自动化构建工具 grunt、gulp、webpack、fis 7. 熟悉前端框架React、Vue、AngularJS、Ionic等,并对源码有一定的研究; 8. 熟悉构建工具Grunt、Gulp;熟悉RequireJS、SeaJS、Browserify、Webpack;熟悉NodeJS 据说具备以上特点可以得到不少的工作机会,接下来开始学习学习吧。 来源: https://www.cnblogs.com/wangbaohui/p/6582787.html

Gulp tasks appear to be running twice, instead of once

限于喜欢 提交于 2020-01-17 09:15:27
问题 Problem My gulp tasks seem to be running twice instead of once, trying to fix thatI think some have suggested that the culprit might lie in the default task in Gulpfile.js Gulpfile.js // Include Gulp var gulp = require('gulp'); // All of your plugins var autoprefixer = require('gulp-autoprefixer'); var imagemin = require('gulp-imagemin'); var jshint = require('gulp-jshint'); var livereload = require('gulp-livereload'); var minify = require('gulp-minify-css'); var notify = require('gulp-notify

Compass mixins with Gulp

微笑、不失礼 提交于 2020-01-17 08:00:08
问题 Is there a way to use Compass mixins with Gulp ? How to use them ? I tried to use Compass on my Gulp project but each time I get an error with my Compass @import. Thanks in advance ! 回答1: It's even simpler to use compass-importer. Install it with npm install --save-dev compass-importer require it in your gulpfile.js and add importer: compass to sass options var gulp = require('gulp') var sass = require('gulp-sass') var compass = require('compass-importer') gulp.task('sass', function() {

Compass mixins with Gulp

半腔热情 提交于 2020-01-17 08:00:01
问题 Is there a way to use Compass mixins with Gulp ? How to use them ? I tried to use Compass on my Gulp project but each time I get an error with my Compass @import. Thanks in advance ! 回答1: It's even simpler to use compass-importer. Install it with npm install --save-dev compass-importer require it in your gulpfile.js and add importer: compass to sass options var gulp = require('gulp') var sass = require('gulp-sass') var compass = require('compass-importer') gulp.task('sass', function() {

get the path where npm gulp called from

雨燕双飞 提交于 2020-01-17 07:27:28
问题 New with gulp and npm, I am trying to write a script that takes into account the current directory: gulp.task('render', function(){ var folder = process.cwd(); console.info("I am called from:" + folder); //renderThisData(folder + "/data.json"); }) I tried this one as well, it gives same result: gulp.task('render', function(){ var folder = process.env.INIT_CWD; console.info("I am called from:" + folder); //renderThisData(folder + "/data.json"); }) where my tree is like: root |--- package.json

gulp-protractor error with chrome v54 / web driver v2.25

◇◆丶佛笑我妖孽 提交于 2020-01-17 05:22:20
问题 Due to the latest update of chrome (v54) we've noticed our protractor tests failing. We attempted to update to the latest version of gulp-protractor (v3.0.0) which in turn downloads the latest web driver (v2.25) to resolve the issue but unfortunately a new error occurs we've been unable to resolve. Everything worked fine before chrome's update. Our protractor configuration is as follows: exports.config = { // Capabilities to be passed to the webdriver instance. capabilities: { 'browserName':

gulp-protractor error with chrome v54 / web driver v2.25

落爺英雄遲暮 提交于 2020-01-17 05:22:04
问题 Due to the latest update of chrome (v54) we've noticed our protractor tests failing. We attempted to update to the latest version of gulp-protractor (v3.0.0) which in turn downloads the latest web driver (v2.25) to resolve the issue but unfortunately a new error occurs we've been unable to resolve. Everything worked fine before chrome's update. Our protractor configuration is as follows: exports.config = { // Capabilities to be passed to the webdriver instance. capabilities: { 'browserName':

In a Gulp task, how can I set a variable value in the first pipe and read it in the second pipe?

放肆的年华 提交于 2020-01-17 05:13:30
问题 I have a task with two piped statements. The second pipe relies on a global variable whose value is declared in the first pipe. But, I am not able to access the global variable from the second pipe. It seems like pipe 2 is starting before pipe 1 finishes. var responsive = require('gulp-responsive'); var tap = require('gulp-tap'); // global variables for image-generator task var imageA1Width = 0; var imageA1Height = 0; // extracts width and height from image path function getDimensionsFromPath

In a Gulp task, how can I set a variable value in the first pipe and read it in the second pipe?

99封情书 提交于 2020-01-17 05:13:08
问题 I have a task with two piped statements. The second pipe relies on a global variable whose value is declared in the first pipe. But, I am not able to access the global variable from the second pipe. It seems like pipe 2 is starting before pipe 1 finishes. var responsive = require('gulp-responsive'); var tap = require('gulp-tap'); // global variables for image-generator task var imageA1Width = 0; var imageA1Height = 0; // extracts width and height from image path function getDimensionsFromPath