forked from firefox-devtools/debugger
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdev-server.js
More file actions
29 lines (21 loc) · 1.07 KB
/
dev-server.js
File metadata and controls
29 lines (21 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
const fs = require("fs");
const path = require("path");
const toolbox = require("devtools-launchpad/index");
const feature = require("devtools-config");
const getConfig = require("./getConfig");
const express = require("express");
const serve = require("express-static");
const envConfig = getConfig();
feature.setConfig(envConfig);
let webpackConfig = require("../webpack.config");
let { app } = toolbox.startDevServer(envConfig, webpackConfig, __dirname);
app.use("/integration/examples", express.static("test/mochitest/examples"));
app.use("/images", serve(path.join(__dirname, "../images")));
// Serve devtools-reps images
app.use("/devtools-reps/images/", serve(path.join(__dirname, "../src/shared/images")));
// As well as devtools-components ones, with a different path, which we are going to
// write in the postCSS config in development mode.
app.use("/devtools-components/images/",
serve(path.join(__dirname, "../node_modules/devtools-components/src/images")));
console.log("View debugger examples here:");
console.log("https://github.com/firefox-devtools/debugger-examples");