Skip to content

Commit

Permalink
fix: CSS files minification
Browse files Browse the repository at this point in the history
  • Loading branch information
Limon Monte committed May 8, 2019
1 parent 80d3181 commit c8e7e7a
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ const themes = fs.readdirSync('.')
return fs.statSync(path.join('.', file)).isDirectory()
})

const scssFiles = themes.map(i => i + '/*.scss')
const cssFiles = themes.map(i => i + '/*.css')
const scssFiles = themes.map(theme => `${theme}/${theme}.scss`)
const cssFiles = themes.map(theme => `${theme}/${theme}.css`)

gulp.task('lint', () => {
return gulp.src(scssFiles)
Expand All @@ -27,20 +27,20 @@ gulp.task('lint', () => {
})

gulp.task('sass', gulp.series('lint', function compile () {
return gulp.src(scssFiles, {base: '.'})
return gulp.src(scssFiles, { base: '.' })
.pipe(sass({ importer: tildeImporter }))
.pipe(autoprefix())
.pipe(gulp.dest('./'))
}))

gulp.task('css.min', gulp.series('sass', function minify () {
return gulp.src(cssFiles)
gulp.task('css.min', function minify () {
return gulp.src(cssFiles, { base: '.' })
.pipe(cleanCSS())
.pipe(rename({extname: '.min.css'}))
.pipe(gulp.dest('dist'))
}))
.pipe(gulp.dest('./'))
})

gulp.task('build', gulp.series('sass'))
gulp.task('build', gulp.series('sass', 'css.min'))

gulp.task('default', gulp.series('build'))

Expand Down

0 comments on commit c8e7e7a

Please sign in to comment.