Skip to content

Commit

Permalink
fix(provider): normalize runtime paths to support windows
Browse files Browse the repository at this point in the history
  • Loading branch information
farnabaz committed Sep 25, 2020
1 parent f7512c7 commit df9470f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
"dependencies": {
"hasha": "^5.2.0",
"ipx": "latest",
"node-fetch": "^2.6.1"
"node-fetch": "^2.6.1",
"upath": "^1.2.0"
},
"devDependencies": {
"@babel/preset-env": "latest",
Expand Down
4 changes: 3 additions & 1 deletion src/module.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import path from 'path'
import fs from 'fs-extra'
import upath from 'upath'

import { ModuleOptions, ProviderFactory } from './types'
import { downloadImage, getFileExtension, hashGenerator, logger, tryRequire } from './utils'

Expand Down Expand Up @@ -87,7 +89,7 @@ async function ImageModule (moduleOptions) {
for (const p of providers) {
const { middleware, runtime, runtimeOptions } = p.provider(p.options)
const importName = 'runtime_' + hash(runtime).substr(0, 8)
pluginOptions.imports[importName] = runtime
pluginOptions.imports[importName] = upath.normalize(runtime)
pluginOptions.providers.push({
name: p.name,
import: importName,
Expand Down

0 comments on commit df9470f

Please sign in to comment.