@unocss/inspector 66.1.0-beta.6 → 66.1.0-beta.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.mjs +4 -4
  2. package/package.json +3 -3
package/dist/index.mjs CHANGED
@@ -823,12 +823,11 @@ function UnocssInspector(ctx) {
823
823
  async function configureServer(server) {
824
824
  await ctx.ready;
825
825
  const baseUrl = "__unocss";
826
- const middlewareUrl = `${server.config.base || "/"}${baseUrl}`;
827
- server.middlewares.use(`${middlewareUrl}`, sirv(resolve(_dirname, "../dist/client"), {
826
+ server.middlewares.use(`/${baseUrl}`, sirv(resolve(_dirname, "../dist/client"), {
828
827
  single: true,
829
828
  dev: true
830
829
  }));
831
- server.middlewares.use(`${middlewareUrl}_api`, async (req, res, next) => {
830
+ server.middlewares.use(`/${baseUrl}_api`, async (req, res, next) => {
832
831
  if (!req.url)
833
832
  return next();
834
833
  if (req.url === "/") {
@@ -905,7 +904,8 @@ function UnocssInspector(ctx) {
905
904
  const colorUrl = (url) => cyan(url.replace(/:(\d+)\//, (_, port) => `:${bold(port)}/`));
906
905
  server.printUrls = () => {
907
906
  _printUrls();
908
- for (const url of server.resolvedUrls?.local ?? []) {
907
+ for (const localUrl of server.resolvedUrls?.local ?? []) {
908
+ const url = server.config.base ? localUrl.replace(server.config.base, "") : localUrl;
909
909
  const inspectorUrl = url.endsWith("/") ? `${url}${baseUrl}/` : `${url}/${baseUrl}/`;
910
910
  console.log(` ${green("\u279C")} ${bold("UnoCSS Inspector")}: ${colorUrl(`${inspectorUrl}`)}`);
911
911
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@unocss/inspector",
3
3
  "type": "module",
4
- "version": "66.1.0-beta.6",
4
+ "version": "66.1.0-beta.7",
5
5
  "description": "The inspector UI for UnoCSS",
6
6
  "author": "Anthony Fu <anthonyfu117@hotmail.com>",
7
7
  "license": "MIT",
@@ -38,8 +38,8 @@
38
38
  "gzip-size": "^6.0.0",
39
39
  "sirv": "^3.0.1",
40
40
  "vue-flow-layout": "^0.1.1",
41
- "@unocss/core": "66.1.0-beta.6",
42
- "@unocss/rule-utils": "66.1.0-beta.6"
41
+ "@unocss/core": "66.1.0-beta.7",
42
+ "@unocss/rule-utils": "66.1.0-beta.7"
43
43
  },
44
44
  "scripts": {
45
45
  "build": "unbuild",