gulp

Passing gulp-front-matter value to gulp-wrap

冷暖自知 提交于 2019-12-12 01:47:20
问题 I'm hoping to do something like this: gulp.src('src/*.html') .pipe(fm ({ property: 'fm' })) .pipe(wrap({ src: fm['template'] })) where template is a value in the front-matter. I can create a separate function where I pass the value using gulp-tap but I was hoping to keep it "simple". I don't think gulp-wrap supports accessing front-matter vars. 回答1: This seems to be one solution but it starts to fail as I add more complexity, for instance with gulp-swig. The source file contains: --- template

Can't install gulp on windows 10

岁酱吖の 提交于 2019-12-12 01:45:01
问题 I'm busy learning Laravel and in the process trying to install gulp. Operating system: Windows 10 In the command line: npm -v gives: 2.15.2 node -v gives: v4.4.5 Then I tried all kinds of ways I found on the internet to install gulp, all give me a cursor that keeps rotating and nothing happens. What I tried: npm install -g gulp npm install gulp -g npm install --global gulp-cli I also tried: npm config set proxy false npm cache clean That didn't help. What am I doing wrong? 回答1: This also

Gulp with “NPM start” causes a blank page with the text: Cannot GET / when testing Locally

ⅰ亾dé卋堺 提交于 2019-12-12 01:44:36
问题 I've been following this tutorial Angular2, Bootstrap, Yeoman, Gulp, tutorial and I get up to the frontend task section, but then something happens when I try to test the code locally. Whenever I use npm start I run the following code, but end up getting the blank webpage with Cannot GET/ Folder Structure: > my-vzlr > -build > -node_modules > -src > --app > ---app.js > ---index.html > ---main.js > --electron > --fonts > --images > --styles > -gulpfile.js > -package.json Package.json: > {

How to use Lumx in Laravel with Elixir?

北城余情 提交于 2019-12-12 01:36:15
问题 I followed one answer provided in AngularJS with Laravel 5 using NPM but I cannot successfully compile the SCSS files of lumx using Gulp. Anyone knows how to fix this? My app.scss contains this: @import "../../../bower_components/mdi/scss/materialdesignicons"; @import "../../../bower_components/lumx/dist/scss/lumx"; After running gulp, I'm getting this error: gulp-notify: [Laravel Elixir] Sass Compilation Failed: bower_components\lumx\dist\scss\_lumx.scss Error: File to import not found or

Run gulp watch command forever

走远了吗. 提交于 2019-12-12 01:27:19
问题 gulp.task('css', function () { gulp.src('custom_css/sass/style.scss') .pipe(sass({ style: 'compressed' })) .pipe(gulp.dest('./public/css/')); }); gulp.task('watch', function() { gulp.watch('custom_css/sass/style.scss', ['css']); }); gulp.task('default', ['css','watch']); this is my gulp script code. when I run gulp in the terminal it start watching for changes, auto compile sass file, but it stop watching if I closed the terminal window. I have also used gulp & to run it in background but not

Can I bind the instance to non-static method immediately after creating instance of ES6-class?

房东的猫 提交于 2019-12-12 01:19:28
问题 Is it some way to assemble first two rows into one? I am not feeling comfortable to force users of MarkupPreprocessingHelper write two rows... let markupPreprocessingHelper = new MarkupPreprocessingHelper(config); let preprocessTemplates = markupPreprocessingHelper.takeCareAboutMarkupPreprocessing.bind(markupPreprocessingHelper); gulp.task('Development run', gulp.series( preprocessTemplates, // ... )); 回答1: If you make a rebound copy of the function and save it as an instance property, you

Gulp dependant task not working properly

你离开我真会死。 提交于 2019-12-12 00:23:33
问题 I have two gulp tasks, one to compile stylus files and the other is to clean my css files but I don't understand why only clean-styles run when I executed the command: gulp styles on the terminal. gulp.task("clean-styles", function (done) { clean(config.css + "**/*.css", done); }); gulp.task("styles", ["clean-styles"], function () { return gulp.src(config.styles) .pipe($.plumber()) .pipe($.stylus()) .pipe(gulp.dest(config.css)); }); function clean(path, done) { del(path, done); } I"m using

HTML bundling in Angular2

我是研究僧i 提交于 2019-12-12 00:06:07
问题 I've already managed to bundle all of my JS files with SystemJS Builder. Now, I want to minify and concat all of my html files. However, in my components, I use: tempalateUrl: '....' Now: How can I bundle html's into one file? Will angular2 see those htmls out of the box? 回答1: There's a gulp plugin that does the job nicely gulp-inline-ng2-template. This is the task I'm using (a bit long, because of the CSS processing pipeline): gulp .src('src/app/**/*.ts', { since: gulp.lastRun('typescript')

gulp/minify: index.html gets cryptic extension in file name, how to take advantage?

允我心安 提交于 2019-12-11 23:35:20
问题 I am minifying an index.html file with gulp (note: took over this project, build system has been done by former dev). It all works fine, but the gulp task generates a HTML file which has a cryptic extension to it, like: index-bd2c7f58f0.html I understand this must have it's advantage, but I can't grasp what...:) Because the disadvantage now is: The node server needs the presence of an index.html file to allow the '/' route to work. Thus so far, I either have to copy the file on every build or

Gulp dest: warn if 2 tasks try to write to the same destination

房东的猫 提交于 2019-12-11 23:08:09
问题 I wonder if there is an easy way to detect if two tasks write to the same file. In this example there is a /js directory alongside a /ts directory. The /ts will get transpiled to the same directory as the /js . There shouldn't be any collisions. The ask is that, if there are collisions, the ts will win; but, I would like to warn that there is a collision. gulp.task('js', function() { return es.concat( gulp.src(config.src.path('js', '**', '*.js')) .pipe(gulp.dest(config.build.path(app, 'js')))