-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(config): make the location of the ImageIOs and web workers confi…
…gurable With node, it can be configured as described in the node-config documentation: https://www.npmjs.com/package/config With browserify, it can be configured by supplying a JSON file with something like aliasify for 'config': https://github.com/benbria/aliasify With webpack, it can also be configured by supplying a JSON file: https://github.com/lorenwest/node-config/wiki/Webpack-Usage
- Loading branch information
Showing
12 changed files
with
56 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
'itk': { | ||
imageIOsPath: '/itkImageIOs', | ||
webWorkersPath: '/itkWebWorkers' | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
const path = require('path') | ||
let config = { | ||
'itk': { | ||
imageIOsPath: path.resolve(__dirname, '..', 'dist', 'itkImageIOs'), | ||
webWorkersPath: path.resolve(__dirname, '..', 'dist', 'itkWebWorkers') | ||
} | ||
} | ||
|
||
module.exports = config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,18 @@ | ||
const config = { | ||
const config = require('config') | ||
|
||
let itkConfig = { | ||
imageIOsPath: '/itkImageIOs', | ||
webWorkersPath: '/itkWebWorkers' | ||
} | ||
|
||
module.exports = config | ||
if (typeof config.has === 'function') { | ||
if (config.has('itk.imageIOsPath')) { | ||
itkConfig['imageIOsPath'] = config.get('itk.imageIOsPath') | ||
} | ||
|
||
if (config.has('itk.webWorkersPath')) { | ||
itkConfig['webWorkersPath'] = config.get('itk.webWorkersPath') | ||
} | ||
} | ||
|
||
module.exports = itkConfig |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters