gulp

vscode gulp / grunt script running vscode chrome debugger extension

无人久伴 提交于 2019-11-29 10:45:48
I am new to vscode and grunt / gulp frameworks and I was wondering, if there is a possible way for your task to do some task ( let say transpile some files, minify some images etc. ) and then access vscode and run the chrome debugger ? Any advice how I could accomplish that. It depends on exactly what you mean. It is easy to accomplish the following workflow. Start a task (like browserSync) that watches your file changes and starts a server. Start the chrome debugger extension via a "launch" command in .vscode/launch.json that connects to that same url started in step 1. Something like {

How do I install gulp 4

女生的网名这么多〃 提交于 2019-11-29 10:34:29
问题 I've been using gulp-watch. The current version of gulp-watch relies on the call gulp.parrallel. This call is only available from gulp 4. However gulp 4 is not available via the npm repo. npm info gulp dist-tags returns: { latest: '3.9.0' } . I can see that there is a 4.0 branch within the git repo. But attempting to install it with variations on this command fails: npm install https://github.com/gulpjs/gulp#v4.0.0 . 回答1: npm install gulpjs/gulp.git#4.0 --save-dev 回答2: Gulp has removed the 4

How to use Grunt/Gulp with pm2?

夙愿已清 提交于 2019-11-29 09:34:19
问题 pm2 is a great tool to manage node apps. How does it work with grunt/glup ? I didn't find any useful clues after Googling for 20 minutes. 回答1: If I understand your question well, it seems you want to deploy your app. Since pm2 0.9 deployment can be done with pm2 deploy see README. In the case of grunt/gulp, I see two options: You've your node_modules comitted. Using pm2 deploy run your gulp process from the post-deploy section: "post-deploy" : "node ./node_modules/gulp/bin/gulp.js ./GulpFile

Gulp change working directory for entire task

时光毁灭记忆、已成空白 提交于 2019-11-29 09:22:41
I'm working on a gulp file that contains tasks for both the frontend and the backend of my site. The task below for example will concat my scripts into app.js: gulp.task 'frontend:scripts', -> gulp.src frontendPath(scriptsFolder, scriptsPattern) .pipe sourcemaps.init() .pipe coffee() .pipe concat 'app.js' .pipe sourcemaps.write('.') .pipe gulp.dest frontendPath(tempFolder, scriptsFolder) As you can see I've created a helper to provide the correct frontend path: frontendPath = (dirs...) -> path.join.apply null, ['frontend'].concat(dirs) But I have to be really careful that all the steps of my

Integrating Grunt/Gulp and Livereload to existing Apache server serving PHP/Zend

╄→尐↘猪︶ㄣ 提交于 2019-11-29 07:58:49
I'm working on a PHP project using the Zend framework which is being served locally using Apache. Is there a plug-in/configuration for Grunt/Gulp that will allow me to use this existing server and reload my browser whenever changes are made to my phtml/php, CSS, and JavaScript files? The normal live-reload plugins will work just fine. It works by running a separate server that simply reports changes — it doesn't serve your code directly. If you are using gulp, you follow the directions in the gulp-livereload README for setting up and running the LR server. The plugin will notify the LR server

gulp 4.0 提示 Error: watching index.html: watch task has to be a function 解决办法

大城市里の小女人 提交于 2019-11-29 06:13:19
gulp 4.0 提示 Error: watching index.html: watch task has to be a function 解决办法 原文链接: https://blog.csdn.net/mlonly/article/details/85917261 提示:Error: watching index.html: watch task has to be a function (optionally generated by using gulp.parallel or gulp.series) gulp 4.0之后不能按照之前的写法了 大有改变 4.0之前的写法 Gulp.watch(“监听的文件”,[任务名字符串]) // gulp.task( "watch",function(){ // gulp.watch( "index.html",[ "copyindex"]); // gulp.watch( "js/**/*",[ "copyjs"]); // gulp.watch( "css/**/*.scss",[ "copycss"]); // gulp.watch( "html/**/*",[ "copyhtml"]); // gulp.watch( "php/**/*",[ "copyphp"]); // gulp.watch( "img/**/*",[

How to disable cross-device action mirroring functionality of BrowserSync? (GhostMode)

非 Y 不嫁゛ 提交于 2019-11-29 05:10:15
问题 Our team used the gulp-angular generator with yeoman to scaffold out our web app. It uses browsersync to handle live reloads, which we want. However, we just deployed to our development server, and now when two developers are using the gulp serve command at the same time, they both are shown the same window (i.e. one developer types on one window, it shows up in the other developer's window as well). I believe this is due to BrowserSync's cross-device testing capabilities, however I am at a

Gulp error internal/child_process.js:298 throw errnoException(err, 'spawn'); Error: spawn EACCES

旧巷老猫 提交于 2019-11-29 03:56:11
I searched for the cause of this error and found that I have to change permissions or run gulp using sudo, but still got the same error. Can anyone please help... internal/child_process.js:298 throw errnoException(err, 'spawn'); ^ Error: spawn EACCES at exports._errnoException (util.js:870:11) at ChildProcess.spawn (internal/child_process.js:298:11) at exports.spawn (child_process.js:362:9) at exports.execFile (child_process.js:151:15) at ExecBuffer. (/var/www/conFusion/node_modules/gulp-imagemin/node_modules/imagemin/node_modules/imagemin-optipng/node_modules/exec-buffer/index.js:91:3) at

Grunt、Gulp和Webpack区别

a 夏天 提交于 2019-11-29 03:51:41
1、Grunt    Grunt 的出现早于 Gulp,Gulp 是后起之秀。他们本质都是通过 JavaScript 语法实现了 shell script 命令的一些功能。比如利用 jshint 插件实现 JavaScript 代码格式检查这一功能。早期需要手动在命令行中输入 jshint test.js,而 Grunt 则通过 Gruntfile.js 进行配置 // Gruntfile.js module.exports = function(grunt) { grunt.initConfig({ // js格式检查任务 jshint: { src: 'src/test.js' } // 代码压缩打包任务 uglify: {} }); // 导入任务插件 grunt.loadnpmTasks('grunt-contrib-uglify'); // 注册自定义任务, 如果有多个任务可以添加到数组中 grunt.regusterTask('default', ['jshint']) } 2、Gulp   Gulp 吸取了 Grunt 的优点,拥有更简便的写法,通过流(stream)的概念来简化多任务之间的配置和输出,让任务更加简洁和容易上手。 Gulp 还是工具链、构建工具,可以配合各种插件做js压缩,css压缩,less编译,替代手工实现自动化工作。 通过配置 gulpfile

How to create an angular 2 build folder when using systemjs.config.js

喜欢而已 提交于 2019-11-29 03:50:53
How to create an angular 2 build folder when using systemjs.config.js My app works fine locally. I need help with my gulp file so I can grab the node modules required and move them to the dist folder ready for deployment. This is my gulp folder: const gulp = require('gulp'); const ts = require('gulp-typescript'); const uglify = require('gulp-uglify'); const concat = require('gulp-concat'); var htmlreplace = require('gulp-html-replace'); var addsrc = require('gulp-add-src'); var sass = require('gulp-sass'); var inject = require('gulp-inject'); var del = require('delete'); var minifyCss =