@shijiu/jsview 1.9.837 → 1.9.840

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.
@@ -1,6 +1,6 @@
1
1
  import './browser-root-style.css'
2
2
 
3
- import JsvCodeDebug from './jsv-code-debug'
3
+ import JsvCodeDebug from './jsv-code-debug.mjs'
4
4
 
5
5
  let domBrowser;
6
6
 
package/dom/jsv-dom.js CHANGED
@@ -1,4 +1,4 @@
1
- import JsvCodeDebug from './jsv-code-debug'
1
+ import JsvCodeDebug from './jsv-code-debug.mjs'
2
2
 
3
3
  let domNative;
4
4
 
@@ -1,4 +1,4 @@
1
- import JsvCodeDebug from "./jsv-code-debug"
1
+ import JsvCodeDebug from "./jsv-code-debug.mjs"
2
2
 
3
3
  let engineBrowser;
4
4
 
@@ -1,4 +1,4 @@
1
- import JsvCodeDebug from './jsv-code-debug'
1
+ import JsvCodeDebug from './jsv-code-debug.mjs'
2
2
 
3
3
  let forgeDefine;
4
4
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shijiu/jsview",
3
- "version": "1.9.837",
3
+ "version": "1.9.840",
4
4
  "bin": {
5
5
  "jsview-post-build": "./tools/jsview-post-build.js",
6
6
  "jsview-post-install": "./tools/jsview-post-install.js"
@@ -0,0 +1,125 @@
1
+ import path, { resolve } from 'node:path';
2
+ import { fileURLToPath } from 'node:url';
3
+ import { readFileSync } from 'node:fs';
4
+
5
+ const { version } = JSON.parse(readFileSync(new URL('../../package.json', import.meta.url)).toString());
6
+ const VERSION = version;
7
+ const DEFAULT_MAIN_FIELDS = [
8
+ 'module',
9
+ 'jsnext:main',
10
+ 'jsnext',
11
+ ];
12
+ // Baseline support browserslist
13
+ // "defaults and supports es6-module and supports es6-module-dynamic-import"
14
+ // Higher browser versions may be needed for extra features.
15
+ const ESBUILD_MODULES_TARGET = [
16
+ // JsView Modified >>>
17
+ // 解决对top-level-await的原生支持问题。
18
+ //'es2020',
19
+ //'edge88',
20
+ //'firefox78',
21
+ //'chrome87',
22
+ //'safari14',
23
+ 'es2022',
24
+ // JsView Modified <<<
25
+ ];
26
+ const DEFAULT_EXTENSIONS = [
27
+ '.mjs',
28
+ '.js',
29
+ '.mts',
30
+ '.ts',
31
+ '.jsx',
32
+ '.tsx',
33
+ '.json',
34
+ ];
35
+ const DEFAULT_CONFIG_FILES = [
36
+ 'vite.config.js',
37
+ 'vite.config.mjs',
38
+ 'vite.config.ts',
39
+ 'vite.config.cjs',
40
+ 'vite.config.mts',
41
+ 'vite.config.cts',
42
+ ];
43
+ const JS_TYPES_RE = /\.(?:j|t)sx?$|\.mjs$/;
44
+ const CSS_LANGS_RE = /\.(css|less|sass|scss|styl|stylus|pcss|postcss|sss)(?:$|\?)/;
45
+ const OPTIMIZABLE_ENTRY_RE = /\.[cm]?[jt]s$/;
46
+ const SPECIAL_QUERY_RE = /[?&](?:worker|sharedworker|raw|url)\b/;
47
+ /**
48
+ * Prefix for resolved fs paths, since windows paths may not be valid as URLs.
49
+ */
50
+ const FS_PREFIX = `/@fs/`;
51
+ /**
52
+ * Prefix for resolved Ids that are not valid browser import specifiers
53
+ */
54
+ const VALID_ID_PREFIX = `/@id/`;
55
+ /**
56
+ * Plugins that use 'virtual modules' (e.g. for helper functions), prefix the
57
+ * module ID with `\0`, a convention from the rollup ecosystem.
58
+ * This prevents other plugins from trying to process the id (like node resolution),
59
+ * and core features like sourcemaps can use this info to differentiate between
60
+ * virtual modules and regular files.
61
+ * `\0` is not a permitted char in import URLs so we have to replace them during
62
+ * import analysis. The id will be decoded back before entering the plugins pipeline.
63
+ * These encoded virtual ids are also prefixed by the VALID_ID_PREFIX, so virtual
64
+ * modules in the browser end up encoded as `/@id/__x00__{id}`
65
+ */
66
+ const NULL_BYTE_PLACEHOLDER = `__x00__`;
67
+ const CLIENT_PUBLIC_PATH = `/@vite/client`;
68
+ const ENV_PUBLIC_PATH = `/@vite/env`;
69
+ const VITE_PACKAGE_DIR = resolve(
70
+ // import.meta.url is `dist/node/constants.js` after bundle
71
+ fileURLToPath(import.meta.url), '../../..');
72
+ const CLIENT_ENTRY = resolve(VITE_PACKAGE_DIR, 'dist/client/client.mjs');
73
+ const ENV_ENTRY = resolve(VITE_PACKAGE_DIR, 'dist/client/env.mjs');
74
+ const CLIENT_DIR = path.dirname(CLIENT_ENTRY);
75
+ // ** READ THIS ** before editing `KNOWN_ASSET_TYPES`.
76
+ // If you add an asset to `KNOWN_ASSET_TYPES`, make sure to also add it
77
+ // to the TypeScript declaration file `packages/vite/client.d.ts` and
78
+ // add a mime type to the `registerCustomMime` in
79
+ // `packages/vite/src/node/plugin/assets.ts` if mime type cannot be
80
+ // looked up by mrmime.
81
+ const KNOWN_ASSET_TYPES = [
82
+ // images
83
+ 'png',
84
+ 'jpe?g',
85
+ 'jfif',
86
+ 'pjpeg',
87
+ 'pjp',
88
+ 'gif',
89
+ 'svg',
90
+ 'ico',
91
+ 'webp',
92
+ 'avif',
93
+ // media
94
+ 'mp4',
95
+ 'webm',
96
+ 'ogg',
97
+ 'mp3',
98
+ 'wav',
99
+ 'flac',
100
+ 'aac',
101
+ // fonts
102
+ 'woff2?',
103
+ 'eot',
104
+ 'ttf',
105
+ 'otf',
106
+ // other
107
+ 'webmanifest',
108
+ 'pdf',
109
+ 'txt',
110
+ ];
111
+ const DEFAULT_ASSETS_RE = new RegExp(`\\.(` + KNOWN_ASSET_TYPES.join('|') + `)(\\?.*)?$`);
112
+ const DEP_VERSION_RE = /[?&](v=[\w.-]+)\b/;
113
+ const loopbackHosts = new Set([
114
+ 'localhost',
115
+ '127.0.0.1',
116
+ '::1',
117
+ '0000:0000:0000:0000:0000:0000:0000:0001',
118
+ ]);
119
+ const wildcardHosts = new Set([
120
+ '0.0.0.0',
121
+ '::',
122
+ '0000:0000:0000:0000:0000:0000:0000:0000',
123
+ ]);
124
+
125
+ export { CLIENT_DIR, CLIENT_ENTRY, CLIENT_PUBLIC_PATH, CSS_LANGS_RE, DEFAULT_ASSETS_RE, DEFAULT_CONFIG_FILES, DEFAULT_EXTENSIONS, DEFAULT_MAIN_FIELDS, DEP_VERSION_RE, ENV_ENTRY, ENV_PUBLIC_PATH, ESBUILD_MODULES_TARGET, FS_PREFIX, JS_TYPES_RE, KNOWN_ASSET_TYPES, NULL_BYTE_PLACEHOLDER, OPTIMIZABLE_ENTRY_RE, SPECIAL_QUERY_RE, VALID_ID_PREFIX, VERSION, VITE_PACKAGE_DIR, loopbackHosts, wildcardHosts };
@@ -31,7 +31,10 @@ const jsviewConfig = defineConfig({
31
31
  entryFileNames: 'js/main.jsv.[hash].js',
32
32
  format: 'esm',
33
33
  manualChunks: {
34
- 'vue': ['vue', '\0plugin-vue:export-helper'], // 将vue和_export_sfc独立出来,防止被集成在main.js中导致import deadloop.
34
+ 'vue-tarball': [ // 将vue和_export_sfc独立出来,防止被集成在其他js中导致import deadloop.
35
+ 'vue',
36
+ '\0plugin-vue:export-helper'
37
+ ],
35
38
  },
36
39
  },
37
40
  },