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

Generate invalid bundle.css #19

Open
@benlau

Description

@benlau

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)))
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions