ソースを参照

增加sourcemap

huqi 5 年 前
コミット
1d4d3f41f3
3 ファイル変更7 行追加5 行削除
  1. 4 0
      o2web/gulpfile.js
  2. 2 1
      o2web/package.json
  3. 1 4
      o2web/source/o2_core/o2/xScript/Macro.js

+ 4 - 0
o2web/gulpfile.js

@@ -16,6 +16,7 @@ var gulp = require('gulp'),
 //let uglify = require('gulp-uglify-es').default;
 var through2 = require('through2');
 var path = require('path');
+var sourceMap = require('gulp-sourcemaps');
 
 
 var assetRev = require('gulp-tm-asset-rev');
@@ -506,6 +507,7 @@ function createBaseWorkConcatBodyTask(path, isMin, thisOptions) {
         ];
         var dest = option.dest+'/' + path + '/';
         return gulp.src(src)
+            .pipe(sourceMap.init())
             .pipe(concat('js/base_work.js'))
             .pipe(gulpif((option.upload == 'local' && option.location != ''), gulp.dest(option.location + path + '/')))
             .pipe(gulpif((option.upload == 'ftp' && option.host != ''), ftp({
@@ -523,8 +525,10 @@ function createBaseWorkConcatBodyTask(path, isMin, thisOptions) {
                 remotePath: (option.remotePath || '/') + path
             })))
             .pipe(gulp.dest(dest))
+
             .pipe(uglify())
             .pipe(rename({ extname: '.min.js' }))
+            .pipe( sourceMap.write("") )
             .pipe(gulpif((option.upload == 'local' && option.location != ''), gulp.dest(option.location + path + '/')))
             .pipe(gulpif((option.upload == 'ftp' && option.host != ''), ftp({
                 host: option.host,

+ 2 - 1
o2web/package.json

@@ -40,6 +40,7 @@
     "gulp-uglify-es": "^2.0.0",
     "merge-stream": "^1.0.1",
     "minimist": "^1.2.0",
-    "readline-sync": "^1.4.10"
+    "readline-sync": "^1.4.10",
+    "gulp-sourcemaps": "^3.0.0"
   }
 }

+ 1 - 4
o2web/source/o2_core/o2/xScript/Macro.js

@@ -6,14 +6,11 @@ MWF.xScript.Macro = MWF.Macro = {
     expression: function(code, bind){},
     runEvent: function(code, bind, arg){},
 
-    run: function(code, bind){
-
-    },
     exec: function(code, bind){
-        debugger;
         var returnValue;
         //try{
         if (!bind) bind = window;
+        //this.bind = bind || window;
 
         var n = 0;
         var o = "f"+"_"+n;