Authored by ccbikai

增加代码检查

{
"extends": "yoho"
}
... ...
{
"extends": "stylelint-config-yoho"
}
... ...
... ... @@ -5,8 +5,8 @@
*/
module.exports = app => {
//公共服务
// 公共服务
//业务模块
// 业务模块
app.use('/guang', require('./apps/guang'));
};
... ...
{
"name": "m-yohobuy-node",
"version": "0.0.1",
"private": true,
"description": "A New Yohobuy Project With Express",
"repository": {
"type": "git",
"url": "http://git.dev.yoho.cn/web/yohobuy-node.git"
},
"scripts": {
"start": "node app.js",
"dev": "node_modules/.bin/nodemon -e js,hbs -i public/ app.js",
"online": "NODE_ENV=\"production\" node app.js",
"debug": "DEBUG=\"express:*\" node app.js",
"lint-js": "node_modules/.bin/eslint -c .eslintrc --cache --fix `git diff --cached --name-only --diff-filter=ACM | grep .js$` app.js",
"lint-css": "node_modules/.bin/stylelint --config .stylelintrc `git diff --cached --name-only --diff-filter=ACM | grep .css$`",
"precommit": "npm run lint-js && npm run lint-css"
},
"license": "MIT",
"dependencies": {
"body-parser": "^1.15.0",
... ... @@ -15,17 +25,19 @@
"lodash": "^4.8.2",
"morgan": "^1.7.0",
"request-promise": "^2.0.1",
"serve-favicon": "^2.3.0",
"shelljs": "^0.7.0"
"serve-favicon": "^2.3.0"
},
"devDependencies": {
"autoprefixer": "^6.3.6",
"eslint": "^2.9.0",
"eslint-config-yoho": "^1.0.1",
"gulp": "^3.9.1",
"gulp-cssnano": "^2.1.2",
"gulp-ftp": "^1.1.0",
"gulp-postcss": "^6.1.0",
"gulp-sourcemaps": "^2.0.0-alpha",
"gulp-util": "^3.0.7",
"husky": "^0.11.4",
"postcss-assets": "^4.0.1",
"postcss-cachebuster": "^0.1.2",
"postcss-calc": "^5.2.1",
... ... @@ -38,8 +50,11 @@
"postcss-sprites": "^3.1.2",
"postcss-use": "^2.0.2",
"precss": "^1.4.0",
"stylelint": "^6.2.2",
"stylelint-config-yoho": "^1.2.0",
"webpack": "^1.13.0",
"webpack-dev-server": "^1.14.1",
"webpack-stream": "^3.1.0"
"webpack-stream": "^3.1.0",
"shelljs": "^0.7.0"
}
}
... ...
... ... @@ -61,7 +61,7 @@ const postcssPlugin = (et) => {
// assets & sprites config in both dev and pro
if (et === env.pro) {
assets = {
loadPaths: [dist.img, dist.font],
loadPaths: [dist.img, dist.font]
};
Object.assign(sprites, {
... ... @@ -80,7 +80,7 @@ const postcssPlugin = (et) => {
stylesheetPath: 'css/',
spritePath: 'img/'
});
};
}
plugins = [
require('autoprefixer')({
... ... @@ -92,7 +92,7 @@ const postcssPlugin = (et) => {
require('postcss-calc'),
require('postcss-opacity'),
//可选
// 可选
require('postcss-use')({
modules: ['postcss-clearfix', 'postcss-crip', 'postcss-short', 'postcss-center', 'postcss-position']
})
... ... @@ -145,7 +145,7 @@ gulp.task('img', () => {
.pipe(gulp.dest(dist.img));
});
//copy font
// copy font
gulp.task('font', () => {
return gulp.src('font/*')
.pipe(gulp.dest(dist.font));
... ...
... ... @@ -15,9 +15,9 @@ require('shelljs/global');
var entries = {};
//构建各模块子页面JS。生成规则module.page.js
// 构建各模块子页面JS。生成规则module.page.js
ls(__dirname + '/js/**/*.page.js').forEach((f) => {
var dir = _.slice(f.split('/'), -2); //[modulename, xx.page.js]
var dir = _.slice(f.split('/'), -2); // [modulename, xx.page.js]
// Important
// 生成规则:module.page: './js/module/xx.page.js'
... ... @@ -27,7 +27,7 @@ ls(__dirname + '/js/**/*.page.js').forEach((f) => {
module.exports = {
entry: entries,
output: {
path: path.join(__dirname, 'bundle'), //absolute path
path: path.join(__dirname, 'bundle'), // absolute path
filename: '[name].js'
}
};
... ...