Adds Middleware API (#40)

* Adds test project

* Adds e2e for end-2-end tests

* Update gitignore

* Update loaders

* Creates test project

* v0.1.27

* Upgrade

* dependency fixes

* Load project plugins in the plugin loader

* Issue with instanceof

* Fixes versioning issues

* Adds medusa middleware api

* Adds documentation

* Fixes tests
This commit is contained in:
Sebastian Rindom
2020-05-01 13:33:03 +02:00
committed by GitHub
parent 964e26e310
commit 516bc7675d
46 changed files with 10163 additions and 977 deletions
@@ -0,0 +1,18 @@
import Module from "module"
import path from "path"
const fallback = filename => {
const mod = new Module(filename)
mod.filename = filename
mod.paths = Module._nodeModulePaths(path.dirname(filename))
mod._compile(`module.exports = require;`, filename)
return mod.exports
}
// Polyfill Node's `Module.createRequireFromPath` if not present (added in Node v10.12.0)
const createRequireFromPath =
Module.createRequire || Module.createRequireFromPath || fallback
export default createRequireFromPath