@unocss/inspector 0.50.3 → 0.50.4
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.
- package/dist/index.cjs +4 -4
- package/dist/index.mjs +2 -2
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const
|
|
4
|
-
const
|
|
3
|
+
const node_path = require('node:path');
|
|
4
|
+
const node_url = require('node:url');
|
|
5
5
|
const sirv = require('sirv');
|
|
6
6
|
const gzipSize = require('gzip-size');
|
|
7
7
|
|
|
@@ -10,11 +10,11 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
10
10
|
const sirv__default = /*#__PURE__*/_interopDefaultLegacy(sirv);
|
|
11
11
|
const gzipSize__default = /*#__PURE__*/_interopDefaultLegacy(gzipSize);
|
|
12
12
|
|
|
13
|
-
const _dirname = typeof __dirname !== "undefined" ? __dirname :
|
|
13
|
+
const _dirname = typeof __dirname !== "undefined" ? __dirname : node_path.dirname(node_url.fileURLToPath((typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('index.cjs', document.baseURI).href))));
|
|
14
14
|
function UnocssInspector(ctx) {
|
|
15
15
|
async function configureServer(server) {
|
|
16
16
|
await ctx.ready;
|
|
17
|
-
server.middlewares.use("/__unocss", sirv__default(
|
|
17
|
+
server.middlewares.use("/__unocss", sirv__default(node_path.resolve(_dirname, "../dist/client"), {
|
|
18
18
|
single: true,
|
|
19
19
|
dev: true
|
|
20
20
|
}));
|
package/dist/index.mjs
CHANGED