nvm 版本:v1.1.7
node 版本:v6.4.0
npm 版本:3.10.3
pycharm 版本:pycharm 2018.2.4(Professional Edition)
{
"name": "xfz_front",
"version": "1.0.0",
"description": "xfz front code",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "zhiliao",
"license": "ISC",
"devDependencies": {
"browser-sync": "^2.24.4",
"gulp": "^3.9.1",
"gulp-autoprefixer": "^5.0.0",
"gulp-cache": "^1.0.2",
"gulp-concat": "^2.6.1",
"gulp-concat-folders": "^1.3.1",
"gulp-connect": "^5.5.0",
"gulp-cssnano": "^2.1.3",
"gulp-imagemin": "^4.1.0",
"gulp-rename": "^1.2.3",
"gulp-sass": "^4.0.1",
"gulp-sourcemaps": "^2.6.4",
"gulp-uglify": "^3.0.0",
"gulp-util": "^3.0.8",
"underscore": "^1.9.1"
}
}
var gulp = require("gulp");
var cssnano = require("gulp-cssnano");
var rename = require("gulp-rename");
var uglify = require("gulp-uglify");
var concat = require("gulp-concat");
var cache = require('gulp-cache');
var imagemin = require('gulp-imagemin');
var bs = require('browser-sync').create();
var sass = require("gulp-sass");
// gulp-util:这个插件中有一个方法log,可以打印出当前js错误的信息
var util = require("gulp-util");
var sourcemaps = require("gulp-sourcemaps");
var path = {
'html': './templates/**/',
'css': './src/css/**/',
'js': './src/js/',
'images': './src/images/',
'css_dist': './dist/css/',
'js_dist': './dist/js/',
'images_dist': './dist/images/'
};
// 处理html文件的任务
gulp.task("html",function () {
gulp.src(path.html + '*.html')
.pipe(bs.stream())
});
// 定义一个css的任务
gulp.task("css",function () {
gulp.src(path.css + '*.scss')
.pipe(sass().on("error",sass.logError))
.pipe(cssnano())
.pipe(rename({"suffix":".min"}))
.pipe(gulp.dest(path.css_dist))
.pipe(bs.stream())
});
// 定义处理js文件的任务
gulp.task("js",function () {
gulp.src(path.js + '*.js')
.pipe(sourcemaps.init())
.pipe(uglify().on("error",util.log))
.pipe(rename({"suffix":".min"}))
.pipe(sourcemaps.write())
.pipe(gulp.dest(path.js_dist))
.pipe(bs.stream())
});
// 定义处理图片文件的任务
gulp.task('images',function () {
gulp.src(path.images + '*.*')
.pipe(cache(imagemin()))
.pipe(gulp.dest(path.images_dist))
.pipe(bs.stream())
});
// 定义监听文件修改的任务
gulp.task("watch",function () {
gulp.watch(path.html + '*.html',['html']);
gulp.watch(path.css + '*.scss',['css']);
gulp.watch(path.js + '*.js',['js']);
gulp.watch(path.images + '*.*',['images']);
});
// 初始化browser-sync的任务
gulp.task("bs",function () {
bs.init({
'server': {
'baseDir': './'
}
});
});
// 创建一个默认的任务
// gulp.task("default",['bs','watch']);
gulp.task("default",['watch']);
新手求教,在线等。谢谢各位。可以请抽烟。
可以用vscode,这个我用过,没有任何问题
关于 pycharm 可否有解决方案呢?
换源