gulp

How to run livereload with gulp within a docker container?

﹥>﹥吖頭↗ 提交于 2019-12-03 09:38:54
问题 I created a docker container to run tasks with gulp. All tasks are running, the problem is I can't enable livrereload in Chrome although I exposed the 35729 port in my container. Here is the Dockerfile : FROM ubuntu:latest MAINTAINER jiboulex EXPOSE 80 8080 3000 35729 RUN apt-get update RUN apt-get install curl -y RUN apt-get install software-properties-common -y RUN add-apt-repository ppa:chris-lea/node.js RUN apt-get update RUN apt-get install nodejs -y RUN curl -L https://www.npmjs.com

How to create repeating pipe in gulp?

允我心安 提交于 2019-12-03 09:20:09
I have a gulp task to inject several dependencies in index.html as this : return gulp.src(config.serve.html) .pipe($.inject(gulp.src(prependSource(config.inject.source.indexes)), { read: false, starttag: config.inject.indexes, addRootSlash: false, addPrefix: prefix, ignorePath: ignore })) .pipe($.inject(gulp.src(managerList), { read: false, starttag: config.inject.managers, addRootSlash: false, addPrefix: prefix, ignorePath: ignore })) .pipe($.inject(gulp.src(prependSource(config.inject.source.directives)), { read: false, starttag: config.inject.directives, addRootSlash: false, addPrefix:

gulp: where is the gulp task callback function defined?

血红的双手。 提交于 2019-12-03 09:16:37
问题 A task in gulp can be defined like so: gulp.task('foobar', function(callback) { ... }); I'm trying to understand what the callback function is. Where is it defined? Can I pass in some other function as an argument at runtime? What does it do? These docs indicate that the callback argument is a hint to Orchestrator that the task should be run asynchronously, where the executing the callback indicates that the async task has completed. With some experimentation it looks like calling the

Yeoman - Gulp spawn cmd enoent

匿名 (未验证) 提交于 2019-12-03 09:05:37
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: With the help gulp yeoman-webapp 'im wolf. But it also serves on the command line, I get the following error gulp. Can you help me? Thank you in advance. I work in Windows 10 and 64 bit computing. events.js:85 throw er; // Unhandled 'error' event ^ Error: spawn cmd ENOENT at exports._errnoException (util.js:746:11) at Process.ChildProcess._handle.onexit (child_process.js:1053:32) at child_process.js:1144:20 at process._tickCallback (node.js:355:11) 回答1: Try to put in your system variables in the PATH : C:\Windows\System32; 文章来源: Yeoman -

gulp how to sync folders using gulp while ignoring some patterns

…衆ロ難τιáo~ 提交于 2019-12-03 08:59:41
I want to sync two folders using gulp. I have managed to achieve this with the a package called gulp-directory-sync (see included task below), but now I need to exclude some files from the sync based on if the file or directory name starts with "__" (two underscores). I have tried to find a sync plugin with an ignore or exclude feature, but without success, so I am now wondering if anyone might know a workaround for this. var gulp = require('gulp'); var dirSync = require('gulp-directory-sync'); gulp.task('sync', function () { return gulp.src('') .pipe(dirSync('./one', './two')); }); I'd always

Gulp, Vue, Webpack, Babel and Uncaught SyntaxError: Unexpected token import

匿名 (未验证) 提交于 2019-12-03 08:56:10
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I've been trying whole day to get it to work without any luck so if someone could shine some light that would be very much appreciated. I'm trying to set up environment for working with ES6 files as well as Vue using Webpack. I've installed all dependencies, and created the following files: webpack.config.js module.exports = { entry: './resources/assets/source/js/app.js', output: { filename: 'app.js' }, devtool: 'source-map', resolve: { alias: { 'vue$': 'vue/dist/vue.js' } }, module: { loaders: [ { test: /\.js$/, loader: 'babel', exclude:

Gulp glob to ignore file types and not copy empty folders

匿名 (未验证) 提交于 2019-12-03 08:48:34
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have created a glob for gulp which ignores javascript and coffeescript files within a set of directories. I'd like it to copy all other files into a directory which works fine. The only problem is that when there are only javascript or coffeescript files it copies an empty folder. Any ideas how this glob could be amended to not copy empty folders? gulp.task('copyfiles', function(){ gulp.src('apps/*/static_src/**/!(*.js|*.coffee)') .pipe(gulp.dest('dest')); }); Example source files: apps/appname/static_src/images/image.jpg apps/appname

Gulp - Handling multiple themes and folders

眉间皱痕 提交于 2019-12-03 08:41:41
I am trying to create an ultimate gulpfile that we can use on one of our big sites (one with multiple themes depending on the section of the site you are in). I'm trying to get it to only run the process it needs to run and not recompile everything. Let me layout exactly what i'm trying to achieve: Folder Structure src/ master-theme/ css/ style.scss partials/ _a.scss _b.scss img/ a.jpg b.jpg sub-theme/ css/ style.scss partials/ _c.scss _d.scss img/ c.png d.jpg I want these files to be compressed/compiled and to end up in the destination folder with the same folder structure (just replace src

How to use gulp webpack-stream to generate a proper named file?

匿名 (未验证) 提交于 2019-12-03 08:41:19
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Currently we're using Webpack for our Module loader, and Gulp for everything else (sass -> css, and the dev/production build process) I want to wrap the webpack stuff into gulp, so all I have to do is type gulp and it starts, watches and runs webpack and the rest of what our gulp is setup to do. So I found webpack-stream and implemented it. gulp.task('webpack', function() { return gulp.src('entry.js') .pipe(webpack({ watch: true, module: { loaders: [ { test: /\.css$/, loader: 'style!css' }, ], }, })) .pipe(gulp.dest('dist/bundle.js')); });

-bash: gulp: command not found in Mac

匿名 (未验证) 提交于 2019-12-03 08:35:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I try install gulp in mac like this : Is-iMac:~ itop$ npm root /Users/itop/node_modules Is-iMac:~ itop$ npm config set prefix /usr/local Is-iMac:~ itop$ npm root -g /usr/local/lib/node_modules Is-iMac:~ itop$ sudo npm install -g gulp After Install I see this error In terminal: npm WARN deprecated graceful-fs@3.0.8: graceful-fs version 3 and before will fail on newer node releases. Please update to graceful-fs@^4.0.0 as soon as possible. npm WARN deprecated lodash@1.0.2: lodash@<3.0.0 is no longer maintained. Upgrade to lodash@^4.0.0. npm