gulp

How to precompile gulp-handlebars helpers?

流过昼夜 提交于 2019-12-11 10:26:43
问题 I am precompiling my templates into JS using gulp-handlebars but I am having trouble getting custom handlebars helpers to also precompile. Does anyone know if there is any support/way to precompile custom helper methods? 回答1: I noticed that gulp-handlebars can use a specific handlebars library, essentially overriding its default. So, by just creating my own module and registering some helpers, and feeding that into the handlebars call, things are working locally. // helpers.js var handlebars

Nodejs > Gulp > through2 > Limitation to 16 files?

*爱你&永不变心* 提交于 2019-12-11 10:16:58
问题 update Ok, this seems to be linked to through2's "highWaterMark" property. Basically, it means "don't buffer more than x files, wait for someone to consume it and then only then accept another batch of files". Since it works this way by design, the snippet in this question is being reviewed. There must be a better way to handle many files. Quick fix, allowing 8000 files: through.obj({ highWaterMark: 8000 }, (file, enc, next) => { ... }) Original question I'm using a gulp task to create

gulp-minify without rename original files

梦想与她 提交于 2019-12-11 09:59:41
问题 It is possible minify js files without add -min suffix? I want keep original name. gulp.task("js-external-release", function() { gulp.src(config.vendorJs) .pipe(minify()) .pipe(gulp.dest(config.dist + "/scripts")); }); 回答1: Use gulp-uglify instead - it doesn't rename files, which is the default behavior for most gulp plugins. var gulp = require('gulp'); var uglify = require('uglify'); gulp.task("js-external-release", function() { gulp.src(config.vendorJs) .pipe(uglify()) .pipe(gulp.dest

gulp-usemin TypeError: Path must be a string. Received undefined

谁说胖子不能爱 提交于 2019-12-11 09:54:11
问题 I'm using gulp-usemin for minify the javascript files I use in my app, for some reason gulp is not seeing one of my files. I have this in my index.html: <body ng-app="App"> <!--[if lte IE 8]> <p class="browsehappy">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p> <![endif]--> <div> <ui-view></ui-view> </div> <div class="footer"> <div class="container"> <!-- TODO: add fotter here --> </div> <

ASP.Net Core 2.1: How to use Gulp with npm for project dependencies

 ̄綄美尐妖づ 提交于 2019-12-11 08:43:08
问题 Now that Bower is dead with ASP.Net Core 2.0, I need to find an equally effective way to minify/inject my dependencies from npm. I installed gulp , and using npm , I'm updating all my dependencies into the node_modules folder in the root of my project. The next step is getting all the dependencies listed in my package.json file to be injected into the wwwroot folder of my project. I was going along Shawn Wildermuth's tutorial: https://wildermuth.com/2017/11/19/ASP-NET-Core-2-0-and-the-End-of

Starting Gulp with Gulp-less maintain folder structure

泪湿孤枕 提交于 2019-12-11 08:23:55
问题 I've today started to look at gulp.js to compile my less files etc. I've got it up and running with a task but the compiled files are all placed in the same folder - not maintaining the source hierarchy. Is there a way to ensure that the output maintains the original file structure? I'm new to gulp so may not be doing this correctly. Here is my gulp file (the part relating to Less): var sourceLess = 'app/assets/stylesheets/less'; var targetCss = 'public/css2'; // Compile Our Less gulp.task(

Gulp and wire dep not injecting file type *.*.js files

泄露秘密 提交于 2019-12-11 08:18:52
问题 I am facing below issue - I have Yeomen generator and wiredep to inject bower dependencies in index.html file. I have installed angular tree view by bower then noticed that lib files and css file of angular tree view are not getting injected in index file. After debugging for while found that the lib file of angular tree view has one extras dot (angular.treeview.js) same with the css file as well So how to inject that file in index.html i have below task in inject.js file in gulp folder to

Gulp: custom pipe to transform a lot of files in a batch

走远了吗. 提交于 2019-12-11 08:01:34
问题 edit it seems I'm trying to create some concat gulp pipe that first transforms the contents of the various files. I have been using through2 to write a custom pipe. Scope: Using gulp-watch, run a task that loads all of them, transform them in memory and output a few files. Through2 comes with a "highWaterMark" option that defaults to 16 files being read at a time. My pipe doesn't need to be memory optimized (it reads dozens of <5kb jsons, runs some transforms and outputs 2 or 3 jsons). But I

Debug Typescript in Chrome bundled by Webpack Visual Studio 2017 .NET Core 2.2

限于喜欢 提交于 2019-12-11 07:45:47
问题 There are a couple questions out there but most of the answers seem to be "it should be default now if you have VS 2017". My debugger isn't working, so I'd like to give my specific case to get some help. I'm also new to Typescript & Webpack to give some context. Project Hiearchy ./wwwroot/bundles/bundle.js <- this is the final bundled file ./Scripts/ <- various directories where all the separate Typescript files live When the project builds, it goes through these steps: Core project builds

React Build Tool and Dev Server

£可爱£侵袭症+ 提交于 2019-12-11 07:24:44
问题 Need some direction in terms of setting up the DEV environment and server for a project I'm starting for learning purposes. I want to use ReacJS with Bootstrap. Last time I worked with ReactJS, the build and server was already configured and I did not have to do much. We were using npm, gulp and bunch of other stuff. Now that I'm trying to set this up, I'm not sure what to do. Can someone outline the simplest steps I can follow. I want to use latest versions of React eco-system and ideally