-
Notifications
You must be signed in to change notification settings - Fork 489
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Middleware doesn't load relative to where you run the CLI from #245
Comments
I've also been struggling with this issue. The problem is especially prominent when running I'm setting up a small dev environment for our frontenders, and this is not possible without explicitly installing |
@rasmniel If you're including middleware for live-server in the project, what's wrong with installing |
Since my middleware is generic Adding the dependency would be a workaround rather than a fix, which seems kinda half-hearted to me. There's so much "out-of-the-box" utility in this little package. Why not make it go a bit further with more reliable path resolution? |
I've made a pull request to remedy this problem #330 |
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.)
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
live-server
:live-server --middleware=extensionless-urls.js
live-server
version: 1.2.0The text was updated successfully, but these errors were encountered: