forked from heineiuo/seashell
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
71 lines (59 loc) · 1.62 KB
/
gulpfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
var gulp = require('gulp')
var webpack = require('webpack-stream')
var fs = require('fs')
var path = require("path")
var uglify = require("gulp-uglify")
var jsonomit = require('gulp-json-omit')
var nodeExternals = require('webpack-node-externals')
var filter = require('gulp-filter')
/**
* seashell
*/
gulp.task('seashell-webpack', function() {
return gulp.src('src/seashell.js')
.pipe(webpack({
cache: false,
target: 'node',
externals: nodeExternals(),
output: {
libraryTarget: "commonjs",
filename: "seashell.js"
}
}))
//.pipe(uglify())
.pipe(gulp.dest('build/release/seashell/lib'))
})
gulp.task('seashell-pkg', function () {
return gulp.src(['packages/seashell/**/*'])
.pipe(gulp.dest('build/release/seashell'))
})
gulp.task('seashell',[
'seashell-webpack',
'seashell-pkg'
])
/**
* seashell-cli
*/
gulp.task('seashell-cli-copy-pkg', function () {
return gulp.src('packages/seashell-cli/**/*')
.pipe(gulp.dest('build/release/seashell-cli'))
})
gulp.task('seashell-cli-cli', function () {
return gulp.src('src/cli.js')
.pipe(gulp.dest('build/release/seashell-cli/lib'))
})
gulp.task('seashell-cli-template', function () {
return gulp.src('src/template/**/*')
.pipe(gulp.dest('build/release/seashell-cli/template'))
})
gulp.task('seashell-cli-copy', function () {
return gulp.src('packages/seashell-cli/**/*')
.pipe(gulp.dest('build/release/seashell-cli'))
})
gulp.task('seashell-cli', [
'seashell-cli-copy',
'seashell-cli-copy-pkg',
'seashell-cli-template',
'seashell-cli-cli'
])
gulp.task('default', ['seashell', 'seashell-cli'])