From 1d4d3f41f3eae0e4e802cb7ef6614e036c14f605 Mon Sep 17 00:00:00 2001 From: huqi Date: Mon, 30 Nov 2020 13:21:18 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0sourcemap?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- o2web/gulpfile.js | 4 ++++ o2web/package.json | 3 ++- o2web/source/o2_core/o2/xScript/Macro.js | 5 +---- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/o2web/gulpfile.js b/o2web/gulpfile.js index 3613c69c71..dede3d4c38 100644 --- a/o2web/gulpfile.js +++ b/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, diff --git a/o2web/package.json b/o2web/package.json index 98e8b74b41..de3aa2c3cc 100644 --- a/o2web/package.json +++ b/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" } } diff --git a/o2web/source/o2_core/o2/xScript/Macro.js b/o2web/source/o2_core/o2/xScript/Macro.js index bc69b9bcb8..627e633ba0 100644 --- a/o2web/source/o2_core/o2/xScript/Macro.js +++ b/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; -- GitLab