@byteluck-fe/model-driven-engine 1.8.1-beta.3 → 2.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -52,9 +52,10 @@ function _unsupportedIterableToArray(o, minLen) {
|
|
|
52
52
|
import { error } from "@byteluck-fe/model-driven-shared";
|
|
53
53
|
export var ES6ModulePlugin = /*#__PURE__*/ function() {
|
|
54
54
|
"use strict";
|
|
55
|
-
function ES6ModulePlugin(config) {
|
|
55
|
+
function ES6ModulePlugin(config, env) {
|
|
56
56
|
_classCallCheck(this, ES6ModulePlugin);
|
|
57
57
|
this.config = config;
|
|
58
|
+
this.env = env;
|
|
58
59
|
}
|
|
59
60
|
var _proto = ES6ModulePlugin.prototype;
|
|
60
61
|
_proto.apply = function apply(engine) {
|
|
@@ -63,7 +64,7 @@ export var ES6ModulePlugin = /*#__PURE__*/ function() {
|
|
|
63
64
|
if (!action) {
|
|
64
65
|
return;
|
|
65
66
|
}
|
|
66
|
-
var res = parseModule(action, engine);
|
|
67
|
+
var res = parseModule(action, engine, this.env);
|
|
67
68
|
if (!res) {
|
|
68
69
|
return;
|
|
69
70
|
}
|
|
@@ -93,7 +94,7 @@ export var ES6ModulePlugin = /*#__PURE__*/ function() {
|
|
|
93
94
|
};
|
|
94
95
|
return ES6ModulePlugin;
|
|
95
96
|
}();
|
|
96
|
-
export function parseModule(action, engine) {
|
|
97
|
+
export function parseModule(action, engine, env) {
|
|
97
98
|
if (!action.module || !action.module.compiled) {
|
|
98
99
|
return;
|
|
99
100
|
}
|
|
@@ -101,7 +102,8 @@ export function parseModule(action, engine) {
|
|
|
101
102
|
var module = {
|
|
102
103
|
exports: {
|
|
103
104
|
ctx: engine,
|
|
104
|
-
utils: engine.getAction().actionUtils
|
|
105
|
+
utils: engine.getAction().actionUtils,
|
|
106
|
+
env: env
|
|
105
107
|
}
|
|
106
108
|
};
|
|
107
109
|
try {
|