Skip to content

Commit 3dcc7bb

Browse files
committed
Add basics for new workflow
1 parent f943d43 commit 3dcc7bb

4 files changed

Lines changed: 113 additions & 6 deletions

File tree

gulpfile.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,27 @@
11
var gulp = require('gulp');
22
var rename = require('gulp-rename');
33
var uglify = require('gulp-uglify');
4+
var resolveDependencies = require('gulp-resolve-dependencies');
5+
var concat = require('gulp-concat');
46

57
gulp.task('prod', function () {
68

79
gulp.src('src/explode_shape_layer.jsx')
10+
.pipe(resolveDependencies({
11+
pattern: /\* @requires [\s-]*(.*\.jsx)/g
12+
}))
13+
.on('error', function(err) { console.log(err.message); })
14+
.pipe(concat('explode_shape_layer.jsx'))
15+
.pipe(rename('./explode_shape_layer.jsx'))
816
.pipe(gulp.dest('dist/'))
917
.pipe(rename('./explode_shape_layer.min.jsx'))
1018
.pipe(uglify())
11-
.pipe(gulp.dest('dist/'))
19+
.pipe(gulp.dest('dist/'));
20+
21+
});
22+
23+
gulp.task('watch', ['prod'], function () {
24+
25+
gulp.watch('src/*', ['prod']);
1226

1327
});

package-lock.json

Lines changed: 94 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/explode_shape_layer.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
function explodeLayer(layers) {
1+
/* @requires utils.jsx */
2+
3+
function explodeLayer(layers) {
24

35
consLog('==============\n==============');
46

@@ -222,8 +224,6 @@ function createUI(thisObj) {
222224

223225
}
224226

225-
function consLog(text) { if (configs.log) $.writeln(text); }
226-
227227
var configs = {
228228
title: 'Explode layer tool',
229229
log : false,

src/utils.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
function consLog(text) { if (configs.log) $.writeln(text); }

0 commit comments

Comments
 (0)