mikenorthorp / gulp-shopify-upload

gulp plugin to watch and upload files to Shopify for use in theme editing
Other
40 stars 21 forks source link

Only uploading assets css #17

Closed rjulio closed 9 years ago

rjulio commented 9 years ago

Im using this plugin inside a vagrant vm and this is my gulpfile: var gulp = require('gulp'), watch = require('gulp-watch'), sass = require('gulp-sass'), rename = require('gulp-rename'), gulpShopify = require('gulp-shopify-upload');

gulp.task('scss_css', function(){ return gulp.src('./dev_assets/*.scss') .pipe(sass({outputStyle:'compressed'}).on('error', sass.logError)) .pipe(rename({suffix:'.min'})) .pipe(gulp.dest('./assets')); });

gulp.task('themewatch', function(){ return watch('./+(assets|config|layout|locales|snippets|templates)/**') .pipe(gulpShopify('xxxxx','xxxxx','simek.myshopify.com','35916035')); });

gulp.task('sasswatch', function(){ return gulp.watch('./devassets/*/_.scss', ['scss_css']); });

gulp.task('default',['scss_css','sasswatch', 'themewatch']);

Everytime i update my css file it uploads ok, but if i make a change on any other folder (theme/templates/etc..) the watch doesnt work and the file is not uploaded.

Can you help me?

mgirouard commented 9 years ago

@rjulio are the files in the same directory as your gulpfile.js or are they in your dev_assets/ directory?

When you run the themewatch task, what happens when you explicitly touch a file, like:

touch layout/theme.liquid

Also, you might want to change your API keys — It's kind of a bad idea to post those publicly. You should treat those like a password since they give anyone anywhere direct access to your theme.

mikenorthorp commented 9 years ago

I removed your API keys from your comment, don't post those...

rjulio commented 9 years ago

Thank you for removing the api keys, i should have paid more attention to that. I have founded the solution to my problem:

return watch('./+(assets|config|layout|locales|snippets|templates)/**',{usePolling:true})

using the 'usePolling:true' solved my problem.

Thank you for your support. Really loving this plugin.