mirror of
https://github.com/papercss/papercss
synced 2024-06-07 16:32:15 +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
|
/node_modules
|
||||||
npm-debug.log
|
npm-debug.log
|
||||||
|
/dist
|
17
gulpfile.js
17
gulpfile.js
|
@ -1,6 +1,8 @@
|
||||||
var gulp = require('gulp'),
|
var gulp = require('gulp'),
|
||||||
connect = require('gulp-connect'),
|
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() {
|
gulp.task('webserver', function() {
|
||||||
connect.server({
|
connect.server({
|
||||||
|
@ -11,12 +13,21 @@ gulp.task('webserver', function() {
|
||||||
gulp.task('less', function() {
|
gulp.task('less', function() {
|
||||||
gulp.src('src/styles.less')
|
gulp.src('src/styles.less')
|
||||||
.pipe(less())
|
.pipe(less())
|
||||||
|
.pipe(cleanCSS({format: 'beautify'}))
|
||||||
.pipe(gulp.dest('dist'))
|
.pipe(gulp.dest('dist'))
|
||||||
.pipe(connect.reload());
|
.pipe(connect.reload());
|
||||||
});
|
});
|
||||||
|
|
||||||
gulp.task('watch', function() {
|
gulp.task('watch', function() {
|
||||||
gulp.watch('src/*.less', ['less']);
|
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('default', ['less', 'webserver', 'watch']);
|
||||||
|
gulp.task('build', ['less', 'minify-css'])
|
|
@ -5,6 +5,7 @@
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "node node_modules/gulp/bin/gulp.js",
|
"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"
|
"test": "echo \"Error: no test specified\" && exit 1"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
|
@ -19,9 +20,11 @@
|
||||||
"homepage": "https://github.com/rhyneav/papercss#readme",
|
"homepage": "https://github.com/rhyneav/papercss#readme",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"gulp": "3.9.1",
|
"gulp": "3.9.1",
|
||||||
|
"gulp-clean-css": "^3.9.0",
|
||||||
"gulp-connect": "5.0.0",
|
"gulp-connect": "5.0.0",
|
||||||
"gulp-less": "3.3.2",
|
"gulp-less": "3.3.2",
|
||||||
"gulp-plumber": "1.1.0",
|
"gulp-plumber": "1.1.0",
|
||||||
|
"gulp-rename": "^1.2.2",
|
||||||
"gulp-watch-less": "1.0.1",
|
"gulp-watch-less": "1.0.1",
|
||||||
"install": "0.10.1",
|
"install": "0.10.1",
|
||||||
"less": "2.7.2",
|
"less": "2.7.2",
|
||||||
|
|
Loading…
Reference in a new issue