Skip to content

Commit

Permalink
fix: resolving module load in linux (#250)
Browse files Browse the repository at this point in the history
  • Loading branch information
whilke authored Apr 5, 2022
1 parent 3e3d6b6 commit 5b90aa1
Show file tree
Hide file tree
Showing 11 changed files with 29,133 additions and 22,166 deletions.
11 changes: 10 additions & 1 deletion core/src/ingredient-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ import {DeploymentContext} from "./deployment-context"
import * as process from "process"
import * as fs from 'fs'

const {createRequire} = require('module');
const path = require('path');

export class IngredientManager {

private static ingredientTypes : Map<string, IIngredientType>
Expand All @@ -13,9 +16,15 @@ export class IngredientManager {
private static ingredientTypesVersions : Map<string, string>
= new Map<string, string>()

public static RequireIngredient(moduleName: string): any {
const packagePath = path.resolve('./', 'noop.js');
const module = createRequire(packagePath)(moduleName);
return module;
}

public static Register(moduleName: string):void {

var module = require(moduleName)
const module = IngredientManager.RequireIngredient(moduleName);

if (module.plugin){

Expand Down
6 changes: 3 additions & 3 deletions ingredient/ingredient-functions/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions ingredient/ingredient-network-interface/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions ingredient/ingredient-sql-dwh/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 5b90aa1

Please sign in to comment.