vite-plugin-debugger 0.0.1 → 0.0.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/README.md CHANGED
@@ -37,9 +37,9 @@ export default defineConfig(({ command, mode }) => ({
37
37
  plugins: [
38
38
  vDebugger({
39
39
  debug: mode !== 'production',
40
- // cdn: 'jsdelivr', // 'jsdelivr' | 'unpkg' | 'cdnjs'
41
- // src: 'custom CDN URL',
42
40
  eruda: {
41
+ // cdn: 'jsdelivr', // 'jsdelivr' | 'unpkg' | 'cdnjs'
42
+ // src: 'custom CDN URL',
43
43
  options: {
44
44
  tool: ['console', 'elements'],
45
45
  useShadowDom: true,
package/dist/index.js CHANGED
@@ -1,6 +1,8 @@
1
+ var __create = Object.create;
1
2
  var __defProp = Object.defineProperty;
2
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
4
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
5
7
  var __export = (target, all) => {
6
8
  for (var name in all)
@@ -14,6 +16,7 @@ var __copyProps = (to, from, except, desc) => {
14
16
  }
15
17
  return to;
16
18
  };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
17
20
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
21
 
19
22
  // src/index.ts
@@ -22,16 +25,7 @@ __export(src_exports, {
22
25
  default: () => src_default
23
26
  });
24
27
  module.exports = __toCommonJS(src_exports);
25
-
26
- // node_modules/.pnpm/slash@4.0.0/node_modules/slash/index.js
27
- function slash(path) {
28
- const isExtendedLengthPath = /^\\\\\?\\/.test(path);
29
- const hasNonAscii = /[^\u0000-\u0080]+/.test(path);
30
- if (isExtendedLengthPath || hasNonAscii) {
31
- return path;
32
- }
33
- return path.replace(/\\/g, "/");
34
- }
28
+ var import_slash = __toESM(require("slash"));
35
29
 
36
30
  // src/helpers/index.ts
37
31
  var capitalize = (str) => str.charAt(0).toUpperCase() + str.slice(1);
@@ -71,7 +65,7 @@ var transformErudaOptions = (html, opts) => {
71
65
  });
72
66
  let erudaScript = `eruda.init(${JSON.stringify(options)});
73
67
  `;
74
- if (plugins.length > 0) {
68
+ if (plugins && plugins.length > 0) {
75
69
  if (cdn === "jsdelivr") {
76
70
  tags.push({
77
71
  tag: "script",
@@ -179,7 +173,7 @@ var transformVConsoleImport = (code, opts) => {
179
173
  // src/index.ts
180
174
  var src_default = (options) => {
181
175
  const { eruda, vConsole, local, entry } = options;
182
- const entryPath = (Array.isArray(entry) ? entry : [entry]).map((path) => slash(path));
176
+ const entryPath = entry ? (Array.isArray(entry) ? entry : [entry]).map((path) => (0, import_slash.default)(path)) : [];
183
177
  if (eruda && vConsole) {
184
178
  throw new Error("[vite-plugin-debugger]: You'd better use only one debugger tool at a time.");
185
179
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vite-plugin-debugger",
3
- "version": "0.0.1",
3
+ "version": "0.0.4",
4
4
  "description": "A vite plugin provide the debugger tools for mobile devices.",
5
5
  "author": "jade-gjz",
6
6
  "license": "MIT",
@@ -18,8 +18,8 @@
18
18
  "dist"
19
19
  ],
20
20
  "peerDependencies": {
21
- "eruda": "^2.0.0",
22
- "vconsole": "^3.0.0",
21
+ "eruda": "^2.4.0",
22
+ "vconsole": "^3.14.0",
23
23
  "vite": "^2.0.0"
24
24
  },
25
25
  "peerDependenciesMeta": {
@@ -30,13 +30,15 @@
30
30
  "optional": true
31
31
  }
32
32
  },
33
+ "dependencies": {
34
+ "slash": "^4.0.0"
35
+ },
33
36
  "devDependencies": {
34
37
  "@jhqn/eslint-config-ts": "^0.0.30",
35
38
  "bumpp": "^8.2.1",
36
39
  "conventional-changelog-cli": "^2.2.2",
37
40
  "eruda": "https://github.com/liriliri/eruda.git",
38
41
  "eslint": "^8.19.0",
39
- "slash": "^4.0.0",
40
42
  "tsup": "^6.1.3",
41
43
  "typescript": "^4.7.4",
42
44
  "vconsole": "^3.14.6",
@@ -47,6 +49,6 @@
47
49
  "build": "tsup src/index.ts --dts",
48
50
  "prepublish": "pnpm build",
49
51
  "lint": "eslint . --fix",
50
- "release": "bumpp package.json --commit --push --tag && pnpm publish --access public"
52
+ "release": "bumpp package.json --commit --push --tag && pnpm publish --access public --no-git-checks"
51
53
  }
52
54
  }