This repository has been archived by the owner on Mar 27, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
UPDATE: 移除Grunt和Makefile,添加Gulp和npm scripts.
- Loading branch information
Showing
37 changed files
with
152 additions
and
276 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"presets": ["stage-0", "es2015", "react"], | ||
"plugins": ["react-hot-loader/babel", "transform-runtime", "transform-class-properties", "transform-decorators-legacy"] | ||
"plugins": ["transform-runtime", "transform-class-properties", "transform-decorators-legacy"] | ||
|
||
} | ||
} |
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
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
This file was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
var gulp = require('gulp'), | ||
clean = require('gulp-clean'), | ||
sass = require('gulp-sass'), | ||
watch = require('gulp-watch'), | ||
imagemin = require('gulp-imagemin'), | ||
cssmin = require('gulp-minify-css'), | ||
sequence = require('gulp-run-sequence'), | ||
autoprefixer = require('gulp-autoprefixer'); | ||
|
||
|
||
//清空 | ||
gulp.task('clean', function(){ | ||
return gulp.src('build', {read: false}) | ||
.pipe(clean({force: true})); | ||
}); | ||
|
||
//复制图片 | ||
gulp.task('copy-image', function(){ | ||
return gulp.src('images/*.*') | ||
.pipe(imagemin({verbose: true})) | ||
.pipe(gulp.dest('build/images')); | ||
}); | ||
|
||
//复制字体 | ||
gulp.task('copy-font', function(){ | ||
return gulp.src('styles/font-awesome/fonts/**') | ||
.pipe(gulp.dest('build/styles/fonts')); | ||
}); | ||
|
||
//复制HTML | ||
gulp.task('copy-html', function(){ | ||
return gulp.src('index.html') | ||
.pipe(gulp.dest('build')); | ||
}); | ||
|
||
//编译impress | ||
gulp.task('sass-index', function(){ | ||
return gulp.src('styles/index.scss') | ||
.pipe(sass().on('error', sass.logError)) | ||
.pipe(autoprefixer({browsers: ['last 30 version', '> 90%']})) | ||
.pipe(cssmin()) | ||
.pipe(gulp.dest('build/styles')); | ||
}); | ||
|
||
//编译font-awesome | ||
gulp.task('sass-fontawesome', function(){ | ||
return gulp.src('styles/font-awesome/index.scss') | ||
.pipe(sass().on('error', sass.logError)) | ||
.pipe(autoprefixer({browsers: ['last 30 version', '> 90%']})) | ||
.pipe(cssmin()) | ||
.pipe(gulp.dest('build/styles/font-awesome')); | ||
}); | ||
|
||
//监听 | ||
gulp.task('watch', function(){ | ||
gulp.watch('styles/**/*.scss', ['sass-index']); | ||
}); | ||
|
||
|
||
//本地启动 | ||
gulp.task('build', function(cb) { | ||
sequence('clean', ['copy-html', 'copy-image', 'copy-font'], ['sass-index', 'sass-fontawesome'], cb); | ||
}); |
Oops, something went wrong.