gulp

Gulp simple concatenation of main file that requires another JS file

流过昼夜 提交于 2021-02-04 06:40:06
问题 I have a simple file: main.js: 'use strict'; const somefile = require('somefile') // class MyClass ... // some js I want to use gulp to create a minified file that has the code from somefile.js included too. But for some reason, I can't find a way to do this. Inside my minified file I have require('somefile') , not the full code. gulpfile.js const gulp = require('gulp'); const minify = require('gulp-minify'); const babel = require('gulp-babel'); const include = require("gulp-include"); const

Cannot GET - Error After refresh using Ionic

喜夏-厌秋 提交于 2021-01-28 12:14:05
问题 I'm using Ionic framework to build a hybrid mobile application and I have html5Mode set to true, Ui-Router, and gulp to provide me with livereload, sass compiling, css and javascript minifying. The problem is whenever I navigate to a state directly from the index, everything works fine, requests are being made to my server, but when I refresh that same state, I get Cannot GET error. I am treating my Ionic application as a separate thing from my Express.JS app. Here's some code: States

Executing tasks in series which creates file dynamically in Gulp 4

点点圈 提交于 2021-01-28 09:17:40
问题 I've recently migrated from using Gulp 3 to Gulp 4. Introducing the new tasks like gulp.src() and gulp.parallel() adds more flexibility and ease of use. Here is my code attempting to execute tasks in series. Asynchronous task which creates files dynamically let css_purge_libs = async () => { var pacs = ["!bootstrap", "bulma", "animate.css"]; var paths = await fetch_resources(pacs, "bower", "css|sass"); return gulp.src(paths) .pipe(before(true, config.css.destination.temp + "/lib")()) .pipe(P

Passing a variable between pipes in Gulp 3.9.1

孤街浪徒 提交于 2021-01-28 05:29:39
问题 Using gulp 3.9.1 I am attempting to return a bunch of files and perform a task that requires a var to be passed between two pipes. I'm using node uuid to create a v3 UUID for each file path to ultimately end up with a uuid for each page. I'm grabbing the file path with gulp-print. I want to store that uuid value as a var. In the next pipe Im using gulp-inject-string to write it into the page during the build. Help: Either I need help getting the file path inside the gulp-inject-string pipe or

gulp-order : not Ordering properly

独自空忆成欢 提交于 2021-01-27 03:55:32
问题 Gulp newbie here, I downloaded gulp-order for ordering js files when concating *.js because some of my javascript files require jquery to load first. Below are my gulpfile.js that have order,concat,rename & uglify. var date = new Date(); var uniq = date.getTime(); gulp.task('admin-scripts', function() { return gulp.src(['assets/admin/js/*.js','!assets/admin/js/respond.min.js','!assets/admin/js/html5shiv.js']) .pipe(order([ "assets/admin/js/jquery.min.js", 'assets/admin/js/*.js' ])) .pipe

gulp integration in Visual Studio 2017 not working

亡梦爱人 提交于 2021-01-26 19:07:49
问题 I'm attempting to get gulp integration into Visual Studio 2017. It's working on the command line. The Task Runner Explorer in VS2017 is telling me Failed to load. See output window. The Output Window is telling me the following: Failed to run "<ProjectPath>\Gulpfile.js"... cmd.exe /c gulp --tasks-simple <ProjectPath>\node_modules\node-sass\lib\binding.js:15 throw new Error(errors.missingBinary()); ^ Error: Missing binding <ProjectPath>\node_modules\node-sass\vendor\win32-x64-47\binding.node

gulp integration in Visual Studio 2017 not working

不想你离开。 提交于 2021-01-26 19:04:56
问题 I'm attempting to get gulp integration into Visual Studio 2017. It's working on the command line. The Task Runner Explorer in VS2017 is telling me Failed to load. See output window. The Output Window is telling me the following: Failed to run "<ProjectPath>\Gulpfile.js"... cmd.exe /c gulp --tasks-simple <ProjectPath>\node_modules\node-sass\lib\binding.js:15 throw new Error(errors.missingBinary()); ^ Error: Missing binding <ProjectPath>\node_modules\node-sass\vendor\win32-x64-47\binding.node

gulp concat after sass

女生的网名这么多〃 提交于 2021-01-21 06:34:49
问题 I would like to take the sass output and concat it to another css regular file. example: animate.css app.scss return gulp.src('app.scss') .pipe(sass({ errLogToConsole: true })) .pipe(concat(['animate.css', OUTPUT_OF_THE_SASS_ABOVE])) .pipe(gulp.dest(paths.public+'css/')) .pipe(rename({ extname: '.min.css' })) .pipe(gulp.dest('css/')) .on('end', done); any ideas how to do it? ******* IDEA maybe is it possible to generate the css file from sass in to a temp location, then concat it with css

Node.js - Auto Refresh In Dev

风流意气都作罢 提交于 2021-01-14 02:28:40
问题 I am trying to improve the DEV experience in my Node. To do that, I want to: a) restart my server when server-side code is changed b) refresh the browser when client-side code is changes. In an effort to accomplish this, I began integrating nodemon and browserSync into my gulp script. In my gulp script, I have the following task: gulp.task('startDevEnv', function(done) { // Begin watching for server-side file changes nodemon( { script: input.server, ignore:[input.views] }) .on('start',

Node.js - Auto Refresh In Dev

邮差的信 提交于 2021-01-14 02:28:15
问题 I am trying to improve the DEV experience in my Node. To do that, I want to: a) restart my server when server-side code is changed b) refresh the browser when client-side code is changes. In an effort to accomplish this, I began integrating nodemon and browserSync into my gulp script. In my gulp script, I have the following task: gulp.task('startDevEnv', function(done) { // Begin watching for server-side file changes nodemon( { script: input.server, ignore:[input.views] }) .on('start',