Issue description
If I try to use the --middleware option with a relative path, it fails, and it doesn't give much information.
(It's hard to tell where it's searching from; it's buried in the middle of a stack trace.)
Error: Cannot find module 'extensionless-urls.js'
at Function.Module._resolveFilename (module.js:325:15)
at Function.Module._load (module.js:276:25)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at /home/ubuntu/workspace/node_modules/live-server/index.js:174:10
at Array.map (native)
at Object.LiveServer.start (/home/ubuntu/workspace/node_modules/live-server/index.js:168:13)
at Object.<anonymous> (/home/ubuntu/workspace/node_modules/live-server/live-server.js:166:12)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
I had to add ../../ to the --middleware option to get it to work, which is ugly. It seems like it should really look for files relative to where you launch the CLI from, i.e. the current working directory of the process.
Software details
- Command line used for launching
live-server: live-server --middleware=extensionless-urls.js
- OS: Linux
- Browser (if browser related):
- Node.js version: v9.5.0
live-server version: 1.2.0
Issue description
If I try to use the
--middlewareoption with a relative path, it fails, and it doesn't give much information.(It's hard to tell where it's searching from; it's buried in the middle of a stack trace.)
I had to add
../../to the--middlewareoption to get it to work, which is ugly. It seems like it should really look for files relative to where you launch the CLI from, i.e. the current working directory of the process.Software details
live-server:live-server --middleware=extensionless-urls.jslive-serverversion: 1.2.0