mirror of
https://github.com/papercss/papercss
synced 2024-06-08 00:42:20 +02:00
Update build tools to clean CSS and create minified CSS
This commit is contained in:
parent
81196cba13
commit
7c79ff885f
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,2 +1,3 @@
|
|||
/node_modules
|
||||
npm-debug.log
|
||||
/dist
|
15
gulpfile.js
15
gulpfile.js
|
@ -1,6 +1,8 @@
|
|||
var gulp = require('gulp'),
|
||||
connect = require('gulp-connect'),
|
||||
less = require('gulp-less');
|
||||
less = require('gulp-less'),
|
||||
cleanCSS = require('gulp-clean-css'),
|
||||
rename = require('gulp-rename');
|
||||
|
||||
gulp.task('webserver', function() {
|
||||
connect.server({
|
||||
|
@ -11,12 +13,21 @@ gulp.task('webserver', function() {
|
|||
gulp.task('less', function() {
|
||||
gulp.src('src/styles.less')
|
||||
.pipe(less())
|
||||
.pipe(cleanCSS({format: 'beautify'}))
|
||||
.pipe(gulp.dest('dist'))
|
||||
.pipe(connect.reload());
|
||||
});
|
||||
|
||||
gulp.task('watch', function() {
|
||||
gulp.watch('src/*.less', ['less']);
|
||||
})
|
||||
});
|
||||
|
||||
gulp.task('minify-css', () => {
|
||||
gulp.src('dist/styles.css')
|
||||
.pipe(cleanCSS())
|
||||
.pipe(rename('styles.min.css'))
|
||||
.pipe(gulp.dest('dist'));
|
||||
});
|
||||
|
||||
gulp.task('default', ['less', 'webserver', 'watch']);
|
||||
gulp.task('build', ['less', 'minify-css'])
|
|
@ -5,6 +5,7 @@
|
|||
"main": "index.js",
|
||||
"scripts": {
|
||||
"start": "node node_modules/gulp/bin/gulp.js",
|
||||
"build": "node node_modules/gulp/bin/gulp.js build",
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"repository": {
|
||||
|
@ -19,9 +20,11 @@
|
|||
"homepage": "https://github.com/rhyneav/papercss#readme",
|
||||
"devDependencies": {
|
||||
"gulp": "3.9.1",
|
||||
"gulp-clean-css": "^3.9.0",
|
||||
"gulp-connect": "5.0.0",
|
||||
"gulp-less": "3.3.2",
|
||||
"gulp-plumber": "1.1.0",
|
||||
"gulp-rename": "^1.2.2",
|
||||
"gulp-watch-less": "1.0.1",
|
||||
"install": "0.10.1",
|
||||
"less": "2.7.2",
|
||||
|
|
Loading…
Reference in a new issue