mirror of
https://github.com/vega-org/vega-providers.git
synced 2026-04-17 23:51:44 +00:00
fix: update manifest path to use current directory in DevServer
This commit is contained in:
@@ -12,6 +12,7 @@ class DevServer {
|
|||||||
this.app = express();
|
this.app = express();
|
||||||
this.port = 3001;
|
this.port = 3001;
|
||||||
this.distDir = path.join(__dirname, "dist");
|
this.distDir = path.join(__dirname, "dist");
|
||||||
|
this.currentDir = path.join(__dirname);
|
||||||
|
|
||||||
this.setupMiddleware();
|
this.setupMiddleware();
|
||||||
this.setupRoutes();
|
this.setupRoutes();
|
||||||
@@ -43,7 +44,8 @@ class DevServer {
|
|||||||
setupRoutes() {
|
setupRoutes() {
|
||||||
// Serve manifest.json
|
// Serve manifest.json
|
||||||
this.app.get("/manifest.json", (req, res) => {
|
this.app.get("/manifest.json", (req, res) => {
|
||||||
const manifestPath = path.join(this.distDir, "manifest.json");
|
const manifestPath = path.join(this.currentDir, "manifest.json");
|
||||||
|
console.log(`Serving manifest from: ${manifestPath}`);
|
||||||
|
|
||||||
if (fs.existsSync(manifestPath)) {
|
if (fs.existsSync(manifestPath)) {
|
||||||
res.sendFile(manifestPath);
|
res.sendFile(manifestPath);
|
||||||
@@ -133,7 +135,7 @@ class DevServer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getBuildTime() {
|
getBuildTime() {
|
||||||
const manifestPath = path.join(this.distDir, "manifest.json");
|
const manifestPath = path.join(this.rootDir, "manifest.json");
|
||||||
if (fs.existsSync(manifestPath)) {
|
if (fs.existsSync(manifestPath)) {
|
||||||
const stats = fs.statSync(manifestPath);
|
const stats = fs.statSync(manifestPath);
|
||||||
return stats.mtime.toISOString();
|
return stats.mtime.toISOString();
|
||||||
|
|||||||
Reference in New Issue
Block a user