Authored by xuqi

change package way & folder

... ... @@ -10,13 +10,16 @@ var gulp = require('gulp'),
concat = require('gulp-concat'),
compass = require('gulp-compass'),
exec = require('child_process').exec,
uglify = require('gulp-uglify'),
Package = require('father').SpmPackage,
transport = require('gulp-spm'),
server = require('gulp-develop-server');
var config = JSON.parse(fs.readFileSync('./package.json').toString());
var assets_dir = 'dist/' + config.name + '/assets';
var assets_dir = 'dist/yoho-mobile/' + config.name + '/assets';
var dist_dir = {
js: 'dist/' + config.name + '/' + config.version,
css: 'dist/' + config.name + '/' + config.version,
js: 'dist/yoho-mobile/' + config.name + '/' + config.version,
css: 'dist/yoho-mobile/' + config.name + '/' + config.version,
image: assets_dir + '/images',
font: assets_dir + '/fonts'
};
... ... @@ -97,11 +100,16 @@ gulp.task('compass-production', function() {
});
});
//spm build
//STEP3: build
gulp.task('build', function() {
exec('spm build', function() {
//移动到发布目录
fs.rename('dist/index-debug.js', dist_dir.js + '/index-debug.js');
fs.rename('dist/index.js', dist_dir.js + '/index.js');
});
var pkg = new Package(__dirname);
return gulp.src(pkg.main)
.pipe(transport({
pkg: pkg
}))
.pipe(concat('index-debug.js'))
.pipe(gulp.dest(distDir.js))
.pipe(uglify())
.pipe(concat('index.js'))
.pipe(gulp.dest(distDir.js));
});
\ No newline at end of file
... ...
{
"name": "yohobuy-mobile",
"name": "guang",
"version": "1.2.2",
"description": "yohobuy-mobile frontend",
"description": "yohobuy-mobile saunter src",
"keywords": [],
"homepage": "",
"author": "xuqi <xuqi9010@gmail.com>",
... ...