gulp

How should I transform ES6 node_modules with browserify and babelify?

孤人 提交于 2019-12-10 14:16:16
问题 I'm using gulp, browserify and babelify in order to use ES6 syntax in my project. As soon as I import a node_module, which was also written in ES6, gulp throws an error: 'import' and 'export' may appear only with 'sourceType: module' I've read the proposed solutions on babelify's github page. In short, the two possibilities are: Add a browserify option to the affected node_module's package.json Configure gulp, so that browserify tries to transform all files with babelify (and add an ignore

Heroku gulp deploy

天涯浪子 提交于 2019-12-10 14:13:06
问题 I read all the topic about gulp and heroku but I don't udnerstand what's wrong with my procfile. When I'm in local launching like that works: node node_modules/gulp/bin/gulp build So in the procfile I write: web: node node_modules/gulp/bin/gulp build as advised here http://www.sitepoint.com/deploying-heroku-using-gulp-node-git/ But still this is not working. No build problem nothing with the heroku log... Any idea ? 来源: https://stackoverflow.com/questions/30386492/heroku-gulp-deploy

gulp main-bower-files regular expression filter not working

旧街凉风 提交于 2019-12-10 13:59:24
问题 Why is the second array, bowerFiles , not filtered to just javascript files. var gulp = require('gulp'); var mainBowerFiles = require('main-bower-files'); gulp.task('default', function () { var unfiltered = mainBowerFiles(); console.log('unfiltered files:', unfiltered); // 11 FILES //var jsRegEx = /js$/i; // tried this way too... var jsRegEx = new RegExp('js$', 'i'); var bowerFiles = mainBowerFiles(jsRegEx); console.log('bower files:', bowerFiles); // 11 FILES }); I have tried to mimic what

Node Sass could not find a binding for your current environment: Windows 64-bit with Node.js 6.x

扶醉桌前 提交于 2019-12-10 13:46:58
问题 I get following error message when running gulp : Error: Missing binding Z:\Themewagon\Premium\sparrow\zcore\node_modules\node-sass\vendor\win32-x64-48\binding.node Node Sass could not find a binding for your current environment: Windows 64-bit with Node.js 6.x Found bindings for the following Environments: Linux 64-bit with Node.js 7.x To resolve this error I tried: npm install node-sass, npm rebuild node-sass, npm uninstall -save node-sass, npm install -save node-sass, npm cache clean. etc

Multilingual Jade templates?

穿精又带淫゛_ 提交于 2019-12-10 13:46:26
问题 I'm using the Jade template engine with gulp, gulp-jade and gulp-data to build a very basic one-page website in two languages. The result should be static HTML documents with no further server-side or client-side processing. Is it possible to load website content from a JSON file depending on a language I define in my index.jade , and what would be the best way to go about doing this? My current attempt causes an error: gulpfile.js: gulp.task('views', function () { return gulp.src('app/**/*

How to use gulp to build JavaScript bundles?

寵の児 提交于 2019-12-10 13:43:30
问题 I want to use gulp to build bundles of JavaScript files. For example I have the following structure in my project: /vendor/vendor1/vendor1.js /vendor/vendor2/vendor2.js /js/includes/include1.js /js/includes/include2.js /js/bundle1.js /js/bundle2.js There are vendor includes (1-2), local includes (3-4), and bundle files (5-6). Vendor includes are just third-party JavaScript libraries installed with bower or composer. They can be CommonJS , AMD or just a plain-old jQuery plugins. I want to

Gulp-inject says “Nothing to inject into index.html”

家住魔仙堡 提交于 2019-12-10 13:24:32
问题 I'm trying to inject some files in my index, all of them concatenated and minified into a .tmp folder, as follows: gulp.task('prep-js',['clean'], function(){ var jspath = './src/page/**/*.js'; var treatJs = gulp.src(jspath) .pipe(plugins.concat('scripts.js')) .pipe(plugins.uglify()) .pipe(gulp.dest('.tmp/page/js')) }); But when I run the injection task, it says "Nothing to inject into index.html". Here's the code: gulp.task('inject-deps', ['prep-css', 'prep-js'], function(){ //select main

gulp-jscs autofix doesn't work

 ̄綄美尐妖づ 提交于 2019-12-10 12:59:13
问题 I have the following code in my gulpfile.js gulp.src(['server.js']) .pipe(jscs({fix: true})) .pipe(gulp.dest('prod-app')); But in prod-app/server.js is the same file as server.js. Without any fixes. How to fix it? 回答1: You can read about base option to modify a lot of scripts together here and use it like this: gulp.task('lint-jscs-fix', function() { return gulp.src(quantumArtScripts, { base: './' }) .pipe(jscs({ fix: true })) .pipe(jscs.reporter()) // log all errors that should be fixed

Batch script stops executing after `gulp` process is complete, does not continue executing the rest of the script

半世苍凉 提交于 2019-12-10 12:58:05
问题 I am attempting to write a simple batch file to build a gulp project and a maven project. The current file follows: cd C:\my\file\path cmd /k gulp maven-deploy-local cd C:\my\file\path\two\project-pom-parent cmd /k mvn clean install -Dmaven.test.skip=true Whenever I run this script, the command line stops after line 2 and before line 3. I end up looking at this line in cmd with a blinking cursor: C:\my\file\path> If I run the file without the cmd /k (as follows) then the prompt simply closes

Gulp src returns empty file

杀马特。学长 韩版系。学妹 提交于 2019-12-10 12:53:39
问题 I'm trying to create Gulp task for sass/js compilation and I've also included code for live reload. It works fine except that sometimes gulp.src throws empty files into the pipe when I edit them. var gulp = require('gulp'); var sass = require('gulp-sass'), concat = require('gulp-concat'), uglify = require('gulp-uglify'), rename = require('gulp-rename'), clean = require('gulp-clean'), debug = require('gulp-debug'), livereload = require('gulp-livereload'), lr = require('tiny-lr'), server = lr()