Browse Source

:construction_worker: Add source zip for Firefox extensions

Clement Desmidt 4 months ago
parent
commit
6e7ae26202
2 changed files with 17 additions and 9 deletions
  1. 15
    8
      gulpfile.babel.js
  2. 2
    1
      package.json

+ 15
- 8
gulpfile.babel.js View File

@@ -39,7 +39,14 @@ var manifest = {
39 39
 // Tasks
40 40
 gulp.task('clean', () => {
41 41
   return pipe(`./build/${target}`, $.clean())
42
-})
42
+});
43
+
44
+gulp.task('sourcezip', () => {
45
+	gulp
46
+		.src(['src/**', 'config/**', 'package.json', 'gulpfile.babel.js', '.babelrc'])
47
+		.pipe($.zip('source.zip'))
48
+		.pipe(gulp.dest('dist/'));
49
+});
43 50
 
44 51
 gulp.task('build', (cb) => {
45 52
   $.runSequence('clean', 'styles', 'ext', cb)
@@ -64,8 +71,8 @@ gulp.task('ext', ['manifest', 'js'], () => {
64 71
 // COMMON
65 72
 // -----------------
66 73
 gulp.task('js', () => {
67
-  return buildJS(target)
68
-})
74
+  return buildJS(target);
75
+});
69 76
 
70 77
 gulp.task('styles', () => {
71 78
   return gulp.src('src/styles/**/*.scss')
@@ -99,18 +106,18 @@ gulp.task("manifest", () => {
99 106
 // DIST
100 107
 // -----------------
101 108
 gulp.task('dist', (cb) => {
102
-  $.runSequence('build', 'zip', cb)
109
+  $.runSequence('build', 'zip', cb);
103 110
 });
104 111
 
105 112
 gulp.task('zip', () => {
106
-  return pipe(`./build/${target}/**/*`, $.zip(`${target}.zip`), './dist')
107
-})
113
+  return pipe(`./build/${target}/**/*`, $.zip(`${target}.zip`), './dist');
114
+});
108 115
 
109 116
 
110 117
 // Helpers
111 118
 function pipe(src, ...transforms) {
112 119
   return transforms.reduce((stream, transform) => {
113
-    const isDest = typeof transform === 'string'
120
+    const isDest = typeof transform === 'string';
114 121
     return stream.pipe(isDest ? gulp.dest(transform) : transform)
115 122
   }, gulp.src(src))
116 123
 }
@@ -132,7 +139,7 @@ function buildJS(target) {
132 139
     'options.js',
133 140
     'popup.js',
134 141
     'livereload.js'
135
-  ]
142
+  ];
136 143
 
137 144
   let tasks = files.map( file => {
138 145
     return browserify({

+ 2
- 1
package.json View File

@@ -13,7 +13,8 @@
13 13
     "chrome-dist": "cross-env NODE_ENV=production cross-env TARGET=chrome gulp dist",
14 14
     "opera-dist": "cross-env NODE_ENV=production cross-env TARGET=opera gulp dist",
15 15
     "firefox-dist": "cross-env NODE_ENV=production cross-env TARGET=firefox gulp dist",
16
-    "dist": "npm run chrome-dist && npm run opera-dist && npm run firefox-dist"
16
+    "dist": "npm run chrome-dist && npm run opera-dist && npm run firefox-dist",
17
+    "sourcezip": "gulp sourcezip"
17 18
   },
18 19
   "repository": {
19 20
     "type": "git",

Loading…
Cancel
Save