gulp

Hidden characters '\u0' added to file after save on server

我们两清 提交于 2019-12-05 01:06:34
问题 I'm using an Apache server to serve websites for web development. That way i'm constantly saving and editing files. I'm using Gulp for Sass and to concat and uglify css and js files. A month ago i'm experiencing problems with my js and css files. It seems that there are randomly generated '\u0' characters added below the files. These characters are not visible in the code editor only in the browser inspect: Chrome says: SyntaxError: Invalid or unexpected token Firefox says: 'SyntaxError:

Gulp: How to set dest folder relative to processed file (when using wildcards)?

爱⌒轻易说出口 提交于 2019-12-05 00:51:43
Under my assets/ folder, I have numerous subfolders, each containing an arbitrary number of images, like so: assets/article1/ assets/article2/ I'm trying to write a gulp task to locate all .jpg images within and generate their thumbnail versions, to be saved in a thumbs/ subfolder within the folder where each file resides: assets/article1/ # original jpg images assets/article1/thumbs/ # thumbnail versions of above.. assets/article2/ assets/article2/thumbs/ I've been trying various approaches but no luck. The closest I've come is: gulp.task('thumbs', function () { return gulp.src( './assets/**/

Gulp throwing error: File not found with singular glob

∥☆過路亽.° 提交于 2019-12-05 00:22:06
After renaming my file I am getting the following error when running the gulp build task: Error: Error: File not found with singular glob: F:\Projects\xyz\HTML\app\css\main.css at DestroyableTransform.<anonymous> (F:\Projects\xyz\HTML\node_modules\gulp-useref\lib\streamManager.js:90:36) main.css file no longer exists as I changed it to style.css but for some reason it is searching for the old file. As it turns out I missed changing file name in HTML file as it was calling main.css instead of style.css. <!--build:css css/main.min.css --> <link rel="stylesheet" href="css/main.css"> <!-- endbuild

Gulp4. “AssertionError : Task never defined” when calling or importing tasks

戏子无情 提交于 2019-12-05 00:20:55
Below you can see simplified view of an issue. Basically, I'm able to call task1.js using gulp.series in tasks task2,3.js , but once I add same code to call task1.js in task4.js - Task never defined: task1 error gets thrown. There are more tasks in the tasks folder than in file structure example below. I've got three tasks, ... /tasks build.js clean.js dev.js gulpfile.babel.js ... all of them required in gulpfile.babel.js using the require-dir package import requireDir from 'require-dir'; requireDir('./tasks', {recurse: true}); This allows me to call a task from clean.js at dev.js , and it

How to use gulp webpack-stream to generate a proper named file?

被刻印的时光 ゝ 提交于 2019-12-05 00:01:49
Currently we're using Webpack for our Module loader, and Gulp for everything else (sass -> css, and the dev/production build process) I want to wrap the webpack stuff into gulp, so all I have to do is type gulp and it starts, watches and runs webpack and the rest of what our gulp is setup to do. So I found webpack-stream and implemented it. gulp.task('webpack', function() { return gulp.src('entry.js') .pipe(webpack({ watch: true, module: { loaders: [ { test: /\.css$/, loader: 'style!css' }, ], }, })) .pipe(gulp.dest('dist/bundle.js')); }); The problem is that it generates a random character

Express and BrowserSync without gulp?

て烟熏妆下的殇ゞ 提交于 2019-12-04 23:53:11
问题 I'm working on an express app. I used browserSync only to watch static files but now, I want to do the same with an express app. I saw a lot of examples using Gulp. But i wonder if there is any solution to manage only with npm scripts? (and nodemon?) My current scripts: "scripts": { "start": "npm run start-server & npm run watch-js", "build-js": "browserify -t babelify -t aliasify -t partialify src/ | uglifyjs > public/app.js", "start-server": "browser-sync start --server 'public/' --files

gulp silently failing - no errors printed to console

纵然是瞬间 提交于 2019-12-04 23:35:44
My gulp file is not emitting any errors on either standard gulp methods like gulp.src() with non existant paths nor are stream errors being called by their handler. I've included a simple file that silently fails, printing only the starting.. and finished.. default messages. var // gulp = require( "gulp" ), gulpUtil = require( "gulp-util" ), sass = require( "gulp-ruby-sass"); gulp.task( "default", function() { gulp.src( "path-that-does-not-exist.scss" ) .pipe( sass() ) .on( "error", function( err ) { console.log( "this should print" ); }) .pipe( gulp.dest( "./client-side/public/compiled" ) );

Browser refresh after breakpoint

杀马特。学长 韩版系。学妹 提交于 2019-12-04 23:35:29
问题 Something that drives me crazy, it started suddenly to all my team members. If you pause at a breakpoint for more than a couple of seconds and then continue (F8) the browser refreshes the page. it happens on our mac and windows machines. We are running an AngularJS project with gulp and browser-sync. Even if i turn of all the watchers it still happens. What can i do?? 回答1: browserSync.init({ files: ['./**/*'], startPath: '/src', server: '', watchOptions: { ignored: 'node_modules/*',

Use Javascript frameworks without build tools like grunt and gulp? [closed]

元气小坏坏 提交于 2019-12-04 22:24:44
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed last year . I'm trying out some modern Javascript frameworks like Angular, React, Vue and Ember, and they all want me to use build tools like npm , grunt , gulp , maven , etc. Web-programming used to be fun. Just change some files, refresh the browser and see if it works. Now every time I

Debugging node app in WebStorm when run from gulp

£可爱£侵袭症+ 提交于 2019-12-04 20:46:42
问题 I am using webstorm 10.0.2 and have used the bangular yeoman template to generate a project. I can run the gulp commands via the gulp window, and I can set a breakpoint in the gulpfile.js and it will hit it, but I can't seem to get it to hit a breakpoint in my server.js It looks to me like the gulp file is launching another instance of node and thus when you do "debug" from webstorm you are just debugging the gulp. I also tried with another project using yo hottowel but get the same thing - I