gulp

How to get gulp-html-minifier's output into gulp-inject-stringified-html?

流过昼夜 提交于 2019-12-11 15:47:17
问题 I'm trying to use these two gulp plugins together: gulp-html-minifier gulp-inject-stringified-html Or put differently, I'm trying to inject the contents of files containing html fragments into my javascript files after they're minified. When I'm trying to run a straight up gulp build I get this: Error: ENOENT: no such file or directory, open 'C:\path\to\.temp\template.html' Here's a repro of my situation. My folder structure: /src/app.js /src/template.html /gulpfile.js /package.json My

CSS inject not working with Gulp + Browsersync

别来无恙 提交于 2019-12-11 14:40:59
问题 I'm new in gulp, I used to work with grunt, and I'm having some troubles with gulp now. The most important of them is the auto CSS inject, that isn't woking and after a lot of time I don't know why. Can anyone help me? And also give me some suggestions about my config? Thanks in advance! 'use strict'; var gulp = require('gulp'), sass = require('gulp-sass'), autoprefixer = require('gulp-autoprefixer'), csso = require('gulp-csso'), jshint = require('gulp-jshint'), uglify = require('gulp-uglify'

Inject variable into html via Gulp Task

冷暖自知 提交于 2019-12-11 13:59:16
问题 I'm using Gulp and a number of plugins to template my HTML and minify my HTML i.e. "gulp-file-include", "gulp-inject", "gulp-minify-html" none seem to offer a way of injecting a constant at build time i.e something like this: .pipe('*.html', $.gulpVar({urlpath: 'www.myurl.com'}))) then in my HTML a reference to the variable Contact Us The closest I can find to something similar is gulp-ng-constant although this injects it into the JS and uses Angular, but I'm not using Angular and wish to

gulp sourcemaps not writing expected sourcemap

孤街醉人 提交于 2019-12-11 13:46:55
问题 Here is the task: dev.assets.sass = [ 'client/modules/*[!public]*/scss/*.scss' ]; gulp.task('sass', function () { gulp.src(dev.assets.sass) .pipe(sourcemaps.init()) .pipe(sass({outputStyle: 'compressed'}).on('error', sass.logError)) .pipe(concat('application.min.css')) .pipe(sourcemaps.write('./maps')) .pipe(gulp.dest('./client/build')); }); The issue is that the source map looks like this: {"version":3,"sources":["../../stdin"].... which is not what I expected. I would like something similar

(No tasks found) message in task runner explorer VS 2015

南笙酒味 提交于 2019-12-11 13:43:31
问题 I have task which generates CSS from LESS. It worked perfectly but I found out that it doesn't work now. I found some questions here but they weren't helpful for me. Could you tell me what can be the problem? enter image description here 回答1: The problem was that "node_modules" was missing in my project. I added it and task runner worked correctly. 回答2: Visual Studio's task runner will not recognize gulp tasks unless your project is not actually a project but a website. Right click your

Insert jquery on web starter kit

一世执手 提交于 2019-12-11 13:35:43
问题 I want to add jquery for product dependency. I have already install gulp jquery via npm command. How to insert script in my index html file? But when I have run command gulp serve:dist it's not showing on scripts folder or even in my project files. 回答1: gulp-jquery is not meant to install jQuery to your project dependencies, but meant to build a subset of jQuery which you can use for your build. How this can be achieved is in the docs of this plugin. With the web starter kit, you can't just

Browserify + shim on jquery and signalR not working

左心房为你撑大大i 提交于 2019-12-11 13:18:00
问题 I'm using gulp + browserify to bundle my source but i got always the same error : jQuery was not found. Please ensure jQuery is referenced before the SignalR client JavaScript file. SignalR get $ = undefined... I split my source into two bundle : vendor and app. Vendor bundle get lib's id from packages.json and the bundle require it. App bundle get main entry and i passe id's lib to this bundle with bundle.external. Here my packages.json : "browser": { "angular-notify": "./node_modules

concatenate javascript in anonymous function with gulp

旧城冷巷雨未停 提交于 2019-12-11 13:10:54
问题 I use gulp to concat my scripts into one file. Before concatenation I've split up my .js files into seperate files. So I've got app.js where I declare my angular app and some other stuff. But I've also got route.js where I declare my routing. However, the declaration of my angular app in app.js is wrapped inside an anonymous function, so when it concatenates app.js and route.js, route.js falls outside the scope of the declaration of my Angular app. Is there some way to inject a script into

Can I use both ES6 and ES5 in the same React codebase?

自作多情 提交于 2019-12-11 12:46:12
问题 I have the following gulpfile.js: var gulp = require('gulp'); var browserify = require('gulp-browserify'); var concat = require('gulp-concat'); gulp.task('browserify', function() { gulp.src('js/ScheduleMain.js') .pipe(browserify({transform:'reactify'})) .pipe(concat('ScheduleMain.js')) .pipe(gulp.dest('static/dist/js')); gulp.src('js/ConfidenceMain.js') .pipe(browserify({transform:'reactify'})) .pipe(concat('ConfidenceMain.js')) .pipe(gulp.dest('static/dist/js')); }); gulp.task('default',[

gulp tasks execution in bamboo

梦想与她 提交于 2019-12-11 12:28:34
问题 I have added npm task to install all my dependencies in bamboo. This command is working successfully. Now I want add gulp task. I have added nodeJS addon in my bamboo plan. Using this I want to execute the gulp command (e.x : gulp minify). I am not able to find the way how to execute this command. Can someone please help me to resolve this issue. 回答1: The Bamboo Node.js Support add-on you referenced features a dedicated Gulp task. I think it is shipped alongside newer versions of Atlassian