Skip to content
This repository has been archived by the owner on Feb 26, 2023. It is now read-only.

Generate invalid bundle.css #19

Open
benlau opened this issue Oct 27, 2014 · 9 comments
Open

Generate invalid bundle.css #19

benlau opened this issue Oct 27, 2014 · 9 comments
Labels

Comments

@benlau
Copy link

benlau commented Oct 27, 2014

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
Copy link
Owner

jgoux commented Oct 27, 2014

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 jgoux added the bug label Oct 27, 2014
@jgoux
Copy link
Owner

jgoux commented Oct 31, 2014

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
Copy link

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
Copy link
Owner

jgoux commented Oct 31, 2014

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
Copy link

@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
Copy link
Owner

jgoux commented Dec 7, 2014

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
Copy link
Contributor

Haven't noticed this before, but got the same issue, check changes here: #29

@andreialecu
Copy link

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
Copy link

bump

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

7 participants