forked from rsuite/rsuite
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update:Add gulp && complie the less files
- Loading branch information
Showing
11 changed files
with
24,542 additions
and
2 deletions.
There are no files selected for viewing
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
const plugins = [ | ||
require('autoprefixer'), | ||
require('cssnano')({ | ||
preset: [ | ||
'default', { | ||
discardComments: { | ||
removeAll: true | ||
} | ||
} | ||
] | ||
}) | ||
]; | ||
|
||
module.exports = { | ||
plugins | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
const gulp = require('gulp'); | ||
const clean = require('gulp-clean'); | ||
const less = require('gulp-less'); | ||
const postcss = require('gulp-postcss'); | ||
const sourcemaps = require('gulp-sourcemaps'); | ||
const rename = require('gulp-rename'); | ||
|
||
const SOURCE_PATH = '../styles/less'; | ||
const DIST_PATH = '../dist/css'; | ||
|
||
gulp.task('clean', () => { | ||
return gulp.src(DIST_PATH, { read: true }) | ||
.pipe(clean({ force: true })) | ||
}); | ||
|
||
gulp.task('build-less', () => { | ||
return gulp.src(`${SOURCE_PATH}/rsuite.less`) | ||
.pipe(sourcemaps.init()) | ||
.pipe(less({ javascriptEnabled: true })) | ||
.pipe(postcss([ | ||
require('autoprefixer') | ||
])) | ||
.pipe(sourcemaps.write('./')) | ||
.pipe(gulp.dest(`${DIST_PATH}`)); | ||
}); | ||
|
||
gulp.task('min-css', () => { | ||
return gulp.src(`${DIST_PATH}/rsuite.css`) | ||
.pipe(sourcemaps.init()) | ||
.pipe(postcss()) | ||
.pipe(rename(path => { | ||
path.basename += '.min' | ||
})) | ||
.pipe(sourcemaps.write('./')) | ||
.pipe(gulp.dest(`${DIST_PATH}`)) | ||
}); | ||
|
||
gulp.task('postcss', ['build-less'], () => { | ||
return gulp.start('min-css'); | ||
}); | ||
|
||
gulp.task('copy-fonts', () => { | ||
return gulp.src(`${SOURCE_PATH}/fonts/**/*`) | ||
.pipe(gulp.dest(`${DIST_PATH}/fonts`)) | ||
}); | ||
|
||
gulp.task('default', ['clean'], () => { | ||
gulp.start(['postcss', 'copy-fonts']); | ||
}); |