gulp

Gulp Sass not compiling partials

 ̄綄美尐妖づ 提交于 2019-12-19 19:30:11
问题 So I am using Gulp Sass with gulp-changed (i've also tried gulp-newer with the updated syntax changes) and watching all the scss files in my folders. When I change a base scss file it will compile without any problems. However if I change a partial it won't compile the sass file that has a dependency on that partial. Gulp var SRC = './stylesheets/**/*.scss'; var DEST = './stylesheets'; gulp.task('sass', function() { return gulp.src(SRC) .pipe(changed(DEST, { extension: '.css' })) .pipe

combine html template files into one JS file

折月煮酒 提交于 2019-12-19 17:46:28
问题 I have HTML template files (underscore template syntax) These files are saved in HTML format so they would be easy to edit (IDE syntax highlight) I don't want to fetch them with ajax, but rather combine them all and include them as a js file. Using GULP as my task-runner, I would like it to somehow combine all the HTML to something like this, as a javascript file that I could include in my BUILD process: template_file_name is the HTML file name. var templates = { template_file_name : '..

Combine all sass files into a single file

南楼画角 提交于 2019-12-19 12:52:47
问题 Is there any option available in gulp-sass to combine sass files? For example: main.scss: $var: red; control.scss: @import 'main'; .a{ color: $var; } The combined output file should be single scss file like below $var: red; .a{ color: $var; } 回答1: Did you try something like this? gulp = require('gulp'); concat = require('gulp-concat'); // the default task gulp.task('default', function() { return gulp.src('./*.scss') .pipe(concat('all.scss')) .pipe(gulp.dest('./dist/')); }); This should

Passing arguments to combined npm script

和自甴很熟 提交于 2019-12-19 10:28:19
问题 I have in my package.json the following "scripts": { ... "prod": "gulp build --production && webpack --env.config=production" } I now want to pass a parameter "theme" to both gulp and webpack to be able to adjust the output of the build process from the command line. I figured out how to pass it to webpack: npm run prod -- --env.theme=themename but gulp does not take care of this. I also played around with the yargs -package, processs.argv and bash string substitution by changing the npm

gulp: how to update the browser without refresh (for css changes only)

谁说胖子不能爱 提交于 2019-12-19 10:10:54
问题 I've setup gulp such that the browser reloads when I make changes. However, for css changes I want the browser to update without refresh, but I'm not sure how to do this. For my current setup I've used this tutorial: var debug = require('gulp-debug'), connect = require('gulp-connect'), watch = require('gulp-watch'), livereload = require('gulp-livereload'); gulp.task('webserver', function () { connect.server({ livereload: true, root: ['demo/'] }); }); gulp.task('livereload', function () { gulp

Chrome can't open localhost:3000 with Gulp / BrowserSync

纵饮孤独 提交于 2019-12-19 09:09:47
问题 For some reason, no matter what I try, Google Chrome never seems to be able to display http://localhost:3000 (or any other specified port number for that matter) when starting up a server with BrowserSync through Gulp. Navigating to the same URI in Firefox, shows that it works and that BrowserSync is connected . gulp.task('browser-sync', function() { browserSync.init({ server: { baseDir: './' }, port: 8080 }); }); I'm specifying port 8080 above as an alternative , but even using the default

gulp-load-plugins not loading plugins

a 夏天 提交于 2019-12-19 08:55:17
问题 gulp-load-plugins is not loading any plugins. Can anyone suggest why this might be? Node: v0.12.0 NPM: v2.7.3 My package.json : { "name": "foo", "version": "0.0.1", "dependencies": {}, "devDependencies": { "gulp": "^3.8.11", "gulp-load-plugins": "^0.9.0" } } My gulpfile.js : var gulp = require('gulp'); var gulpLoadPlugins = require('gulp-load-plugins'); var plugins = gulpLoadPlugins(); console.log(JSON.stringify(plugins)); // {} gulp.task('default'); 回答1: Install other gulp plugins. tl;dr If

Gulp-sourcemaps not creating a sourcemap file?

依然范特西╮ 提交于 2019-12-19 06:39:31
问题 I'm trying to get Gulp sourcemaps to write files, but I can't see these files anywhere. If any new files were created in the working tree, I would see them in git status , but nothing no new files to be found. Below is my gulpfile.js var gulp = require('gulp'), sourcemaps = require('gulp-sourcemaps'), minify = require('gulp-minify'), concat = require('gulp-concat'), uglify = require('gulp-uglify'); gulp.task('js', function() { return gulp.src('src/js/**/*.js') .pipe(sourcemaps.init()) .pipe

Uncaught ReferenceError: exports is not defined and require

纵然是瞬间 提交于 2019-12-19 05:52:21
问题 I'm using angularjs and typescript to create some app, I'm having a trouble with this error that I can't solve Here is my *.ts code export var NgApp = new application.Startup(); ///<reference path="../../../../../typings/tsd.d.ts"/> import {NgApp} from "../../bootstrap"; module views.components.home { export class HomeComponent { public constructor() { } public static factory():Function[] { return [ () => new HomeComponent() ] } } } NgApp.registerComponents(views.components.home,() => this

Gulp won't work in Jenkins

别等时光非礼了梦想. 提交于 2019-12-19 05:46:42
问题 I've installed gulp globally (npm install gulp -g). But this isn't working I think. When I'm doing gulp test on my local program it works fine. But when I'm doing a gulp test on my (the same) program from github (on Jenkins), it gives the following error. It won't recognize the gulp command. Can someone help me? Thanks Error in Jenkins: [EnvInject] - Loading node environment variables. Building in workspace C:\Program Files (x86)\Jenkins\workspace\project1 > C:\Program Files (x86)\Git\bin\git