Sotaro KARASAWA 10 лет назад
Родитель
Сommit
4068fb01d1
2 измененных файлов с 19 добавлено и 2 удалено
  1. 17 1
      gulpfile.js
  2. 2 1
      package.json

+ 17 - 1
gulpfile.js

@@ -11,6 +11,7 @@ var jshint = require('gulp-jshint');
 var source = require('vinyl-source-stream');
 var source = require('vinyl-source-stream');
 var webpack = require('webpack-stream');
 var webpack = require('webpack-stream');
 
 
+var del     = require('del');
 var stylish = require('jshint-stylish');
 var stylish = require('jshint-stylish');
 
 
 var pkg = require('./package.json');
 var pkg = require('./package.json');
@@ -45,12 +46,14 @@ var js = {
     'resource/thirdparty-js/jquery.selection.js',
     'resource/thirdparty-js/jquery.selection.js',
   ],
   ],
   src:          dirs.jsSrc  + '/app.js',
   src:          dirs.jsSrc  + '/app.js',
+
   bundled:      dirs.jsDist + '/bundled.js',
   bundled:      dirs.jsDist + '/bundled.js',
   dist:         dirs.jsDist + '/crowi.js',
   dist:         dirs.jsDist + '/crowi.js',
   admin:        dirs.jsDist + '/admin.js',
   admin:        dirs.jsDist + '/admin.js',
   form:         dirs.jsDist + '/form.js',
   form:         dirs.jsDist + '/form.js',
   presentation: dirs.jsDist + '/presentation.js',
   presentation: dirs.jsDist + '/presentation.js',
   app:          dirs.jsDist + '/app.js',
   app:          dirs.jsDist + '/app.js',
+
   clientWatch: ['resource/js/**/*.js'],
   clientWatch: ['resource/js/**/*.js'],
   watch: ['test/**/*.test.js', 'app.js', 'lib/**/*.js'],
   watch: ['test/**/*.test.js', 'app.js', 'lib/**/*.js'],
   lint: ['app.js', 'lib/**/*.js'],
   lint: ['app.js', 'lib/**/*.js'],
@@ -63,7 +66,20 @@ var cssIncludePaths = [
   'node_modules/reveal.js/css'
   'node_modules/reveal.js/css'
 ];
 ];
 
 
-gulp.task('js:concat', function() {
+gulp.task('js:del', function() {
+  var fileList = [
+    js.dist,
+    js.bundled,
+    js.admin,
+    js.form,
+    js.presentation,
+    js.app,
+  ];
+  fileList = fileList.concat(fileList.map(function(fn){ return fn.replace(/\.js/, '.min.js');}));
+  return del(fileList);
+});
+
+gulp.task('js:concat', ['js:del'], function() {
   return gulp.src(js.bundledSrc)
   return gulp.src(js.bundledSrc)
     .pipe(concat('bundled.js')) // jQuery
     .pipe(concat('bundled.js')) // jQuery
     .pipe(gulp.dest(dirs.jsDist));
     .pipe(gulp.dest(dirs.jsDist));

+ 2 - 1
package.json

@@ -30,7 +30,7 @@
   "dependencies": {
   "dependencies": {
     "async": "~1.5.0",
     "async": "~1.5.0",
     "aws-sdk": "~2.2.26",
     "aws-sdk": "~2.2.26",
-    "axios": "~0.9.1",
+    "axios": "0.9.x",
     "babel-core": "~6.7.6",
     "babel-core": "~6.7.6",
     "babel-loader": "~6.2.4",
     "babel-loader": "~6.2.4",
     "babel-preset-es2015": "~6.6.0",
     "babel-preset-es2015": "~6.6.0",
@@ -49,6 +49,7 @@
     "consolidate": "~0.11.0",
     "consolidate": "~0.11.0",
     "cookie-parser": "~1.3.4",
     "cookie-parser": "~1.3.4",
     "debug": "~2.2.0",
     "debug": "~2.2.0",
+    "del": "~2.2.0",
     "diff": "~2.2.2",
     "diff": "~2.2.2",
     "elasticsearch": "~11.0.1",
     "elasticsearch": "~11.0.1",
     "errorhandler": "~1.3.4",
     "errorhandler": "~1.3.4",