gulp

Starting Node.js server w/ Gulp “connect” breaks on live reload (Angular app w/ html5 mode)

China☆狼群 提交于 2019-12-06 05:15:18
I'm trying to solve a problem that's been bugging me for awhile. The Scenario: The problem is when I use Gulp to start up my local server w/ Live Reload. It starts up my Angular app just fine, but when I make a file change Live Reload (page refreshes) breaks my app and gives me a "CANNOT GET" because my server.js (node server) file has a special way that it redirects the user to my "index.html" file. The reason for this is because I have "HTML5 mode" enabled in the Angular app (for pretty URL's) and I have to specify this in the server.js file for it to properly work. Before I turned "html5 on

Gulp SASS Sourcemap sources are incorrect

我的梦境 提交于 2019-12-06 05:07:41
问题 I am struggling to get my SASS sourcemaps to work correctly. The problem seems to be the "sources" attribute within the sourcemap and how my SASS files are nested. I have a Gulp task that compiles SASS to CSS. Here is an example of that var paths = { styles: { src: './Stylesheets/SCSS/', files: './Stylesheets/SCSS/**/*.scss', dest: './Stylesheets/CSS/' } } gulp.task('compile-sass', function (){ return gulp.src(paths.styles.files) .pipe(sourcemaps.init()) .pipe(sass({ outputStyle: 'compressed'

Cannot read property 'line' of undefined at originalPosition in gulp-clean-css plugin

冷暖自知 提交于 2019-12-06 05:01:38
As mentioned in the question, when I launch gulp build I get the following error: C:\dev\work\viewAngular\web\node_modules\gulp-clean-css\node_modules\clean-css\lib\reader\input-source-map-tracker.js:37 if (originalPosition.line === null && line > 1 && selectorFallbacks > 0) { ^ TypeError: Cannot read property 'line' of undefined at originalPosition For (C:\dev\work\viewAngular\web\node_modules\gulp-clean-css\node_modules\clean-css\lib\reader\input-source-map-tracker.js:37:23) I dont know where this is coming up from since I didn't make any changes to gulp-clean-css files or anything related.

Debug ExpressJS server side code using Visual Studio Code

狂风中的少年 提交于 2019-12-06 04:59:59
问题 i have made a simple CRUD app using express: 4.13.4 gulp: 3.9.1 mongodb :v3.0.6 reactjs : 15.0.2. node : 4.0.0 For server side code i hear it is possible to debug via Visual Studio Code (v1.1.1.) . From git bash i start the app via gulp serve .But i am at a loss to find out how to Start debugging! A snippet of my gulp task. gulp.task('serve',['bundle','start-server'],function(){ browserSync.init({ proxy:'http://localhost:3000', port:9001 }); }); When we click the debug button on VS Code to

Nodemon watch option broken

纵然是瞬间 提交于 2019-12-06 03:50:04
问题 I am using gulp-nodemon config directory includes only one file, server.js. $.nodemon({ script: 'config/server.js', watch: ['config/**/*.js'] }) .on('restart', function () { setTimeout(function () { $.livereload.changed(); }, 1000); }); Output: [gulp] [nodemon] v1.2.1 [gulp] [nodemon] to restart at any time, enter `rs` [gulp] [nodemon] watching: config/**/*.js [gulp] [nodemon] starting `node config/server.js` [gulp] [nodemon] watching 34,325 files - this might cause high cpu usage. To reduce

Issue when using gulp to run protractor and selenium

让人想犯罪 __ 提交于 2019-12-06 03:35:43
I am new to protractor and also new to gulp task.I had gulp file which looks like this: 'use strict'; var global = { app_files: { spec: './e2e/**/*_spec.js' }, folders: { specs: './specs' } }; var gulp = require('gulp'); var jshint = require('gulp-jshint'); var stylish = require('jshint-stylish'); var beautify = require('gulp-jsbeautifier'); var protractor = require('gulp-protractor').protractor; // Download and update the selenium driver var webdriver_update = require('gulp-protractor').webdriver_update; var webdriver_standalone = require('gulp-protractor').webdriver_standalone; // Downloads

Remove windows file readonly attribute in gulp file

蓝咒 提交于 2019-12-06 02:28:41
How can we remove readonly attribute from all files under a folder in Windows? UPDATE : The question is more about how to remove readonly attribute using gulpfile I figured out the answer: To remove readonly attribute of all files under a directory recursively, we run the following command in windows Command line attrib -r <dir-name>\*.* /s Following gulp task removes readonly attribute of all files under gulp.task('remove-readonly-attributes', function() { require("child_process").exec("attrib -r <dir-name>\*.* /s"); }); I ended up solving this problem with gulp-chmod. https://www.npmjs.com

WebPack ts-loader compiling all files when I only want it to run in one folder/file

戏子无情 提交于 2019-12-06 02:23:53
问题 I found a problem in my app structure and build process using WebPack, TypeScript, and TS-Loader that I thought was caused by TypeScript 2.1.4, but apparently was there the whole time. You can see all the details from my other post: TypeScript 2.1.4 breaking changes in webpack ts-loader In short, I have Gulp and WebPack set to an entry point of /client/app.ts which for now has almost nothing in it (certainly nothing referencing /server/) but the TypeScript compilation stage of the WebPack

Gulp issues with cario install command not found when trying to installing canvas

筅森魡賤 提交于 2019-12-06 02:21:12
I'm fairly new to working in command line. I have a project that I'm setting up with gulp, and have gulp installed and compiling the sass files successfully. However, I cannot install canvas via: $ npm install canvas I need to install canvas because of the dependencies css-sprite has to run. I am getting the following error. I have installed cairo, quartz, and homebrew installed. I've researched other tickets and tried to run the export PKG_CONFIG_PATH=/opt/X11/lib/pkgconfig and install again. I've had no luck, and have no idea what else to do in attempts to troubleshoot. Here is the error...

关于安装gulp-sass失败的问题解决

时光毁灭记忆、已成空白 提交于 2019-12-06 02:07:39
该文章所介绍的问题均是在64位win8下出现的。 网络原因导致gulp-sass安装失败 如果你正在构建一个基于 gulp 的前端自动化开发环境,那么极有可能会用到 gulp-sass ,由于网络原因你可能会安装失败,因为安装过程中部分细节会到亚马逊云服务器上获取文件。 执行安装gup-sass的命令 $ npm install gulp -sass -- save -dev 这个过程中会先安装 node-sass ,因为 gulp-sass 依赖于 node-sass 。中间出现的错误信息类似下面这样: Cannot download https: / /github.com/sass /node-sass/releases /download/v 3. 4.2 /win32-x64- 46_ bind 处理思路 看现象很有可能是这些二进制文件使用了 GitHub 的 lfs 服务,而 lfs 使用的是亚马逊云,由于网络原因,这些服务器无法访问。 现在解决问题的办法思路就很清晰了,下载源码自己编译一个这样的二进制文件,或下载官方的二进制文件。只要解决该文件的下载问题就可以继续往后安装。 打开 github 看一下该项目 https://github.com/sass/node-sass ,在 releases 页面能找到下失败的文件 win32-x64-46_binding