jgoux / generator-angulpify

Yeoman generator involving AngularJS, Gulp and Browserify
138 stars 21 forks source link

Generate invalid bundle.css #19

Open benlau opened 9 years ago

benlau commented 9 years ago

Hi ,

I would like to report an issue about the generation of bundle.css. It is related to the issue about gulp-ruby-sass:

Disabling sourcemaps and Sass 3.4 · Issue #113 · sindresorhus/gulp-ruby-sass

Since sass 3.4 , the sourcemap generation has been turned on by default. It will generate two files in a single time. That will make the gulp-rename produce an invalid bundle.css (I guess it has merged two file into one?)

Run gulp will not show any error . Just all the change from app.scss will not take effect.

The suggested method to fix is to run sass by :

sass({ style: 'expanded', 'sourcemap=none': true })

I have changed the gulp/tasks/styles.js to fix this issue:

var sassOptions = { // The options to be passed to sass()
    style: 'expanded', 
    'sourcemap=none': true 
}

module.exports = gulp.task('styles', function () {
  return gulp.src(config.paths.src.styles)
    .pipe(autoprefixer('last 1 version'))
    .pipe(gulpif(release, csso()))
    .pipe(gulpif(release, sass(sassOptions).on('error', handleError), sass(sassOptions).on('error', handleError))) 
    .pipe(gulpif(release, rename(config.filenames.release.styles), rename(config.filenames.build.styles)))
    .pipe(gulpif(release, gulp.dest(config.paths.dest.release.styles), gulp.dest(config.paths.dest.build.styles)))
});
jgoux commented 9 years ago

I'm in the process of upgrading all the third party libraries, thanks for the report. It will be integrated in the next version.

jgoux commented 9 years ago

The next version will be a total rewrite of the tasks. As gulp-ruby-sass is very close to hit the v1.0, I'll use the master branch which requires Sass 3.4 and use the sourcemap: 'auto' syntax (the v1.0 will rely on gulp-sourcemaps instead of Sass) I'm trying the make the tasks more customizable.

dancancro commented 9 years ago

Hi Julien,

Totally unrelated to this, but I don't have a direct way of writing you. I am setting up a Google Hangout next week for people working on this type of project and online instructors and some of the Angular team at Google to discuss possibilities of pooling the expertise. I'd be happy to have you take part. If you'd like to participate, please email me your address and I'll pass along the relevant information.

Cheers, Dan

jgoux commented 9 years ago

Hey @dancancro , I'm available on the gittip of the project : https://gitter.im/jgoux/generator-angulpify and I'm on hangout as well : juliengoux.jgx@gmail.com :)

rchampourlier commented 9 years ago

@benlau Thanks for the fix, I was getting crazy... Kind a newbie on this, so tracking the bug down was not an easy task for me!

jgoux commented 9 years ago

The sourcemaps are still a problem, even with the new 1.0.0-alpha version of ruby-sass. I have to work on it, the syntax changed a lot. You can see my progress and contribute if you want in the dev branch.

robertbak commented 9 years ago

Haven't noticed this before, but got the same issue, check changes here: https://github.com/jgoux/generator-angulpify/pull/29

andreialecu commented 9 years ago

I changed gulp-ruby-sass to gulp-sass and that fixed css generation with no further changes. Also, it removes the dependency on ruby.

Is there anything wrong with using gulp-sass instead of gulp-ruby-sass?

thespacecadette commented 9 years ago

bump