gulp

Docker-compose volume mount before run

匿名 (未验证) 提交于 2019-12-03 01:25:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a Dockerfile I'm pointing at from a docker-compose.yml. I'd like the volume mount in the docker-compose.yml to happen before the RUN in the Dockerfile. Dockerfile: FROM node WORKDIR /usr/src/app RUN npm install --global gulp-cli \ && npm install ENTRYPOINT gulp watch docker-compose.yml version: '2' services: build_tools: build: docker/gulp volumes_from: - build_data:rw build_data: image: debian:jessie volumes: - .:/usr/src/app It makes complete sense for it to do the Dockerfile first, then mount from docker-compose, however is there a

How to Increment Version Number via Gulp Task?

匿名 (未验证) 提交于 2019-12-03 01:25:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I would like to replace a string indicating version number in a javascript file ( myConstantsFile.js ), with another string. So, for example, my version number looks like this: "01.11.15", written like this in myConstantsFile.js with other constants: . constant ( 'productVersion' , '1.11.15' ); Right now, my task looks like this: gulp . task ( 'increment-version' , function (){ gulp . src ([ './somedir/myConstantsFile.js' ]) . pipe ( replace ( /'productVersion', '(.*)'/ g , '99.99.99' )) . pipe ( gulp . dest ( './somedir/' )); });

How to compile or convert sass / scss to css with node-sass (no Ruby)?

匿名 (未验证) 提交于 2019-12-03 01:23:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I was struggling with setting up libsass as it wasn't as straight-forward as the Ruby based transpiler. Could someone explain how to: install libsass? use it from command line? use it with task runners like gulp and grunt? I have little experience with package managers and even less so with task runners. 回答1: I picked node-sass implementer for libsass because it is based on node.js. Installing node-sass (Prerequisite) If you don't have npm, install Node.js first. $ npm install -g node-sass installs node-sass globally -g . This will hopefully

gulp watch doesn't watch

匿名 (未验证) 提交于 2019-12-03 01:23:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: Following is my gulpfile.js. There are a couple of more tasks in it and all are working fine - but the last task, watch doesn't. I've tried every possible combination of paths and files and what so ever, but still I don't have luck. I've read many answers on this here, but couldn't solve my problem. I tried to run gulp.watch with and without requiring gulp-watch, tried several different approaches on how to set up the task and so on and so on... var gulp = require ( 'gulp' ); var browserify = require ( 'browserify' ); var babelify

Running a shell command from gulp

匿名 (未验证) 提交于 2019-12-03 01:20:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I would like to run a shell command from gulp, using gulp-shell . I see the following idiom being used the gulpfile. Is this the idiomatic way to run a command from a gulp task? var cmd = 'ls' ; gulp . src ( '' , { read : false }) . pipe ( shell ( cmd , { quiet : true })) . on ( 'error' , function ( err ) { gutil . log ( err ); }); 回答1: gulp-shell has been blacklisted. You should use gulp-exec instead, which has also a better documentation. For your case it actually states: Note: If you just want to run a command, just run the

Gulp throwing error: File not found with singular glob

匿名 (未验证) 提交于 2019-12-03 01:18:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: After renaming my file I am getting the following error when running the gulp build task: Error: Error: File not found with singular glob: F:\Projects\xyz\HTML\app\css\main.css at DestroyableTransform.<anonymous> (F:\Projects\xyz\HTML\node_modules\gulp-useref\lib\streamManager.js:90:36) main.css file no longer exists as I changed it to style.css but for some reason it is searching for the old file. 回答1: As it turns out I missed changing file name in HTML file as it was calling main.css instead of style.css. <!--build:css css/main.min.css -->

Performing a npm install via Docker on a windows host

匿名 (未验证) 提交于 2019-12-03 01:17:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm trying to create a docker dev tools container for a devlopement environment on a windows host via docker toolbox but I have some trouble running the npm install command. It worked fine on a linux host but on the windows host I got the following error : npm ERR! Linux 4.1.13-boot2docker npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" npm ERR! node v5.5.0 npm ERR! npm v3.3.12 npm ERR! path /var/www/site/.npm/gulp/3.9.0/package.tgz.e87c24357cd6065ee71ce44c6f23673b npm ERR! code ETXTBSY npm ERR! errno -26 npm ERR! syscall

Gulp Concat JS results in require is not defined

匿名 (未验证) 提交于 2019-12-03 01:05:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I have project using gulp. I am trying to get jquery, jquery ui and bootstrap into one file called vendor.js. This works fine however when I run "gulp serve" to run the project fromthe dist folder of the project i get the error ReferenceError: require is not defined http://localhost:3000/assets/toolkit/scripts/vendor.js Line 6 var jQuery = require ( 'jquery' ); gulp . task ( 'vendor-js' , function () { return gulp . src ([ 'src/assets/toolkit/scripts/vendor/jquery.min.js' , 'src/assets/toolkit/scripts/vendor/jquery-ui.js' , 'src

'gulp' is not recognized as an internal or external command

与世无争的帅哥 提交于 2019-12-03 01:04:31
I am trying to use Gulp and Node.Js to stream my process for minifying and concatenating CSS/JS files for production. Here is what I have done. I installed Node.Js on my Windows 7 machine. Installed Gulp globally using this command npm install -g gulp Then I added a new User variable called NODE_PATH set it to %AppData%\npm\node_modules After closing and re-opening my command line, I tried to run a gulp task from the command line (i.e. gulp css ). But that give me the following error 'gulp' is not recognized as an internal or external command How can I get this to work? When I opened the

Using Travis-CI for client-side JavaScript libraries?

匿名 (未验证) 提交于 2019-12-03 01:04:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm not sure to use Travis-CI for my client-side JavaScript library or not, because it compiles with NodeJs on Travis-CI servers. I want to know is this a good approach to use some kind of continuous integration such as Travis-CI for client-side libraries or not? 回答1: Yes of course you should use continous integration with client side libraries. I personally use PhantomJS (headless webkit browser) which is already installed in Travis-CI . I think this is the better option for client-side stuff than NodeJs. If you use Grunt , it gets even