es6-dev-server
Advanced tools
Comparing version 0.0.3 to 0.0.4
@@ -17,6 +17,10 @@ const express = require('express') | ||
// Middleware to map imports in JS files so that node module resolution is used | ||
app.use(moduleMiddleware(root)) | ||
// Serve static files | ||
app.use(express.static(path.join(root))) | ||
// If there is a defalt entry defined, then always return that one | ||
// for not found entries | ||
if (entry) { | ||
@@ -30,2 +34,3 @@ app.use((req, res, next) => { | ||
// Default "not found" | ||
app.use(function (req, res, next) { | ||
@@ -32,0 +37,0 @@ res |
@@ -68,5 +68,2 @@ const path = require('path') | ||
} | ||
// if (/\.map$/.test(moduleFilePath)) { | ||
// cached = this.cache[path] = new Cached(code, "application/json") | ||
// } else { | ||
const { resolvedCode, error } = this.resolveImports(moduleFilePath, code) | ||
@@ -78,3 +75,3 @@ if (error) { | ||
cached = this.cache[pathname] = new Cached(resolvedCode, 'application/javascript') | ||
// } | ||
// Drop cache entry when the file changes. | ||
@@ -81,0 +78,0 @@ const watching = fs.watch(moduleFilePath, () => { |
{ | ||
"name": "es6-dev-server", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"bin": { | ||
@@ -5,0 +5,0 @@ "es6-dev-server": "./server" |
@@ -7,2 +7,5 @@ # Serve ES6 modules | ||
_NOTE: this module draws strong inspiration (and large chunks of repurposed code) from | ||
Marijn Haverbeke's awesome [esmoduleserve](https://github.com/marijnh/esmoduleserve)._ | ||
## Usage as a stand alone server | ||
@@ -49,3 +52,3 @@ | ||
const mm = new ModuleMiddleware({ root }) | ||
const mm = new ModuleMiddleware({ root: '.' }) | ||
app.use((req, res, next) => { | ||
@@ -52,0 +55,0 @@ if (mm.handleRequest(req, res)) { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
44833
170
61