use module-dir

This commit is contained in:
Lloyd Brookes
2017-05-14 23:06:20 +01:00
parent 3a49b48c89
commit 07294f3cbc
3 changed files with 23 additions and 15 deletions

View File

@ -11,7 +11,7 @@ const Lws = require('lws')
class LocalWebServer extends Lws {
constructor (options) {
const path = require('path')
const stack = [
let stack = [
'lws-log',
'lws-cors',
'lws-json',
@ -25,10 +25,9 @@ class LocalWebServer extends Lws {
'lws-spa',
'lws-static',
'lws-index'
].map(name => {
return path.resolve(__dirname, `../node_modules/${name}`)
})
options = Object.assign({ stack }, options)
]
const moduleDir = path.resolve(__dirname, `../node_modules`)
options = Object.assign({ stack, 'module-dir': moduleDir, prefix: 'lws-' }, options)
super(options)
}