Commit 77d10f2b authored by wu.hui's avatar wu.hui

build: gulp

parent abb789a2
node_modules
## 本地运行
```js
yarn // 安装包
gulp // http://localhost:3000/
```
\ No newline at end of file
const gulp = require("gulp");
var less = require('gulp-less');
const browserSync = require("browser-sync").create();
var autoprefixer = require('gulp-autoprefixer');
// less -> css
gulp.task('less', function () {
return gulp.src(['./src/less/*.less'])
.pipe(less())
.pipe(autoprefixer({
overrideBrowserslist: ['last 20 versions']
}))
.pipe(gulp.dest('./src/css'))
});
// 浏览器刷新
gulp.task("watch", function (cb) {
gulp.watch("./src/less/*.less", gulp.series(['less']));
browserSync.init(
{
files: ["./src/**/*.*"],
// port: 3001,
server: {
baseDir: ['./src']
}
},
function () {
console.log("browser refreshed.");
}
);
cb();
});
gulp.task("default", gulp.series("watch"));
{
"name": "zh_zcb-ems",
"version": "1.0.0",
"description": "zh_zcb-ems",
"main": "gulpfile.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git@git.soejh.com:chen.yiwen/zh_zcb-ems.git"
},
"author": "",
"license": "ISC",
"devDependencies": {
"browser-sync": "^2.27.10",
"gulp": "^4.0.2",
"gulp-autoprefixer": "^8.0.0",
"gulp-less": "^5.0.0"
}
}
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment