mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-21 04:35:49 +00:00
Add build-core gulp task
This commit is contained in:
101
Gulpfile.js
101
Gulpfile.js
@@ -68,6 +68,53 @@ gulp.task('build', [ 'concat-sjcl' ], function(callback) {
|
|||||||
}, callback);
|
}, callback);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
gulp.task('build-min', [ 'build' ], function(callback) {
|
||||||
|
return gulp.src([ './build/ripple-', '.js' ].join(pkg.version))
|
||||||
|
.pipe(uglify())
|
||||||
|
.pipe(rename([ 'ripple-', '-min.js' ].join(pkg.version)))
|
||||||
|
.pipe(gulp.dest('./build/'));
|
||||||
|
});
|
||||||
|
|
||||||
|
gulp.task('build-debug', [ 'concat-sjcl' ], function(callback) {
|
||||||
|
webpack({
|
||||||
|
cache: true,
|
||||||
|
entry: './src/js/ripple/index.js',
|
||||||
|
output: {
|
||||||
|
library: 'ripple',
|
||||||
|
path: './build/',
|
||||||
|
filename: [ 'ripple-', '-debug.js' ].join(pkg.version)
|
||||||
|
},
|
||||||
|
debug: true,
|
||||||
|
devtool: 'eval'
|
||||||
|
}, callback);
|
||||||
|
});
|
||||||
|
|
||||||
|
gulp.task('build-core', [ 'concat-sjcl' ], function(callback) {
|
||||||
|
const NONE = 'var {}';
|
||||||
|
|
||||||
|
webpack({
|
||||||
|
entry: [
|
||||||
|
'./src/js/ripple/remote.js'
|
||||||
|
],
|
||||||
|
externals: [
|
||||||
|
{
|
||||||
|
'./transaction': NONE,
|
||||||
|
'./orderbook': NONE,
|
||||||
|
'./account': NONE,
|
||||||
|
'./serializedobject': NONE
|
||||||
|
}
|
||||||
|
],
|
||||||
|
output: {
|
||||||
|
library: 'ripple',
|
||||||
|
path: './build/',
|
||||||
|
filename: [ 'ripple-', '-core.js' ].join(pkg.version)
|
||||||
|
},
|
||||||
|
plugins: [
|
||||||
|
new webpack.optimize.UglifyJsPlugin()
|
||||||
|
]
|
||||||
|
}, callback);
|
||||||
|
});
|
||||||
|
|
||||||
gulp.task('bower-build', [ 'build' ], function(callback) {
|
gulp.task('bower-build', [ 'build' ], function(callback) {
|
||||||
return gulp.src([ './build/ripple-', '.js' ].join(pkg.version))
|
return gulp.src([ './build/ripple-', '.js' ].join(pkg.version))
|
||||||
.pipe(rename('ripple.js'))
|
.pipe(rename('ripple.js'))
|
||||||
@@ -92,41 +139,7 @@ gulp.task('bower-version', function() {
|
|||||||
.pipe(gulp.dest('./dist/'));
|
.pipe(gulp.dest('./dist/'));
|
||||||
});
|
});
|
||||||
|
|
||||||
gulp.task('version-bump', function() {
|
gulp.task('bower', ['bower-build', 'bower-build-min', 'bower-build-debug', 'bower-version']);
|
||||||
if (!argv.type) {
|
|
||||||
throw new Error("No type found, pass it in using the --type argument");
|
|
||||||
}
|
|
||||||
gulp.src('./package.json')
|
|
||||||
.pipe(bump({type:argv.type}))
|
|
||||||
.pipe(gulp.dest('./'));
|
|
||||||
});
|
|
||||||
|
|
||||||
gulp.task('version-beta', function() {
|
|
||||||
gulp.src('./package.json')
|
|
||||||
.pipe(bump({version: pkg.version+'-beta'}))
|
|
||||||
.pipe(gulp.dest('./'));
|
|
||||||
});
|
|
||||||
|
|
||||||
gulp.task('build-min', [ 'build' ], function(callback) {
|
|
||||||
return gulp.src([ './build/ripple-', '.js' ].join(pkg.version))
|
|
||||||
.pipe(uglify())
|
|
||||||
.pipe(rename([ 'ripple-', '-min.js' ].join(pkg.version)))
|
|
||||||
.pipe(gulp.dest('./build/'));
|
|
||||||
});
|
|
||||||
|
|
||||||
gulp.task('build-debug', [ 'concat-sjcl' ], function(callback) {
|
|
||||||
webpack({
|
|
||||||
cache: true,
|
|
||||||
entry: './src/js/ripple/index.js',
|
|
||||||
output: {
|
|
||||||
library: 'ripple',
|
|
||||||
path: './build/',
|
|
||||||
filename: [ 'ripple-', '-debug.js' ].join(pkg.version)
|
|
||||||
},
|
|
||||||
debug: true,
|
|
||||||
devtool: 'eval'
|
|
||||||
}, callback);
|
|
||||||
});
|
|
||||||
|
|
||||||
gulp.task('lint', function() {
|
gulp.task('lint', function() {
|
||||||
gulp.src('src/js/ripple/*.js')
|
gulp.src('src/js/ripple/*.js')
|
||||||
@@ -158,6 +171,20 @@ gulp.task('watch', function() {
|
|||||||
gulp.watch('src/js/ripple/*', [ 'build-debug' ]);
|
gulp.watch('src/js/ripple/*', [ 'build-debug' ]);
|
||||||
});
|
});
|
||||||
|
|
||||||
gulp.task('default', [ 'concat-sjcl', 'build', 'build-debug', 'build-min' ]);
|
gulp.task('version-bump', function() {
|
||||||
|
if (!argv.type) {
|
||||||
|
throw new Error("No type found, pass it in using the --type argument");
|
||||||
|
}
|
||||||
|
|
||||||
gulp.task('bower', ['bower-build', 'bower-build-min', 'bower-build-debug', 'bower-version']);
|
gulp.src('./package.json')
|
||||||
|
.pipe(bump({ type: argv.type }))
|
||||||
|
.pipe(gulp.dest('./'));
|
||||||
|
});
|
||||||
|
|
||||||
|
gulp.task('version-beta', function() {
|
||||||
|
gulp.src('./package.json')
|
||||||
|
.pipe(bump({ version: pkg.version + '-beta' }))
|
||||||
|
.pipe(gulp.dest('./'));
|
||||||
|
});
|
||||||
|
|
||||||
|
gulp.task('default', [ 'concat-sjcl', 'build', 'build-debug', 'build-min' ]);
|
||||||
|
|||||||
Reference in New Issue
Block a user