From 978ddfec289fb987a65c47de1a4e04137d99b82e Mon Sep 17 00:00:00 2001 From: Akash Kava <39438041+ackava@users.noreply.github.com> Date: Tue, 9 Apr 2024 14:05:05 +0530 Subject: [PATCH] Publishing again --- YantraJS.Core/Core/Module/JSModuleContext.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/YantraJS.Core/Core/Module/JSModuleContext.cs b/YantraJS.Core/Core/Module/JSModuleContext.cs index b72737f4..efd932c1 100644 --- a/YantraJS.Core/Core/Module/JSModuleContext.cs +++ b/YantraJS.Core/Core/Module/JSModuleContext.cs @@ -377,8 +377,10 @@ protected virtual async Task LoadModuleAsync(string currentPath, string internal protected virtual async Task CompileModuleAsync(JSModule module) { + // Console.WriteLine($"{DateTime.Now} - Compiling module {module.filePath}"); var filePath = module.filePath; + // if this is a json file... then pad with module.exports = if (module.Code == null) { @@ -392,10 +394,10 @@ internal protected virtual async Task CompileModuleAsync(JSModule module) { code = $"module.exports = {code};"; } - else - { - // code = @$"(async function({{module, import, exports, require, filePath: __filename, dirPath: __dirname}}) {{ return (\r\n{code}\r\n); }})"; - } + // else + // { + // code = @$"(async function({{module, import, exports, require, filePath: __filename, dirPath: __dirname}}) {{ return (\r\n{code}\r\n); }})"; + // } // var factory = FastEval(code, filePath); var factory = CoreScript.Compile(code, module.filePath, new string[]