@shijiu/jsview-vue 1.9.631 → 1.9.642

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.
@@ -12555,6 +12555,20 @@ function printServerUrls(urls, optionsHost, info) {
12555
12555
  const note = `use ${picocolors.exports.white(picocolors.exports.bold('--host'))} to expose`;
12556
12556
  info(picocolors.exports.dim(` ${picocolors.exports.green('➜')} ${picocolors.exports.bold('Network')}: ${note}`));
12557
12557
  }
12558
+ // JsView Modified >>>
12559
+ if (urls.network.length > 0) {
12560
+ const saveUrlToCache = async function () {
12561
+ const fs = await import('fs');
12562
+ const path = await import('path')
12563
+ const jsviewCacheDir = path.resolve('node_modules', '.vite', 'jsview')
12564
+ const urlCachePath = path.resolve(jsviewCacheDir, 'network.mjs')
12565
+ fs.mkdirSync(jsviewCacheDir, { recursive : true });
12566
+ fs.writeFileSync(urlCachePath, `export default "${urls.network[0]}"`)
12567
+ }
12568
+
12569
+ saveUrlToCache();
12570
+ }
12571
+ // JsView Modified <<<
12558
12572
  }
12559
12573
 
12560
12574
  const writeColors = {
@@ -40741,7 +40755,10 @@ function preload(baseModule, deps, importerUrl) {
40741
40755
  function buildImportAnalysisPlugin(config) {
40742
40756
  const ssr = !!config.build.ssr;
40743
40757
  const isWorker = config.isWorker;
40744
- const insertPreload = false && !(ssr || !!config.build.lib || isWorker); // JsView Modified
40758
+ // JsView Modified >>>
40759
+ // const insertPreload = !(ssr || !!config.build.lib || isWorker);
40760
+ const insertPreload = false;
40761
+ // JsView Modified <<<
40745
40762
  const relativePreloadUrls = config.base === './' || config.base === '';
40746
40763
  const scriptRel = config.build.polyfillModulePreload
40747
40764
  ? `'modulepreload'`
@@ -62581,6 +62598,15 @@ async function resolveConfig(inlineConfig, command, defaultMode = 'development')
62581
62598
  configFileDependencies = loadResult.dependencies;
62582
62599
  }
62583
62600
  }
62601
+
62602
+ // JsView Added >>>
62603
+ const jsviewViteConfigPath = path.resolve(__dirname, '..', 'jsview.vite.config.js');
62604
+ const jsviewViteConfig = (await import(jsviewViteConfigPath));
62605
+ if (jsviewViteConfig) {
62606
+ config = mergeConfig(jsviewViteConfig.default, config);
62607
+ }
62608
+ // JsView Added <<<
62609
+
62584
62610
  // Define logger
62585
62611
  const logger = createLogger(config.logLevel, {
62586
62612
  allowClearScreen: config.clearScreen,
@@ -0,0 +1,50 @@
1
+ import { defineConfig } from 'vite'
2
+ import { resolve as pathResolve } from 'path'
3
+ import fullReload from 'vite-plugin-full-reload';
4
+ import vue from '@vitejs/plugin-vue'
5
+
6
+ // https://vitejs.dev/config/
7
+ export default defineConfig({
8
+ assetsInclude: ['**/*.bmp'],
9
+ build: {
10
+ assetsInlineLimit: 0,
11
+ //cssTarget: 'css/', // 未生效
12
+ emptyOutDir: true,
13
+ minify: false,
14
+ polyfillModulePreload: false,
15
+ rollupOptions: {
16
+ output: {
17
+ format: 'esm',
18
+ entryFileNames: 'js/main.jsv.[hash].js',
19
+ //chunkFileNames: 'js/[name].[hash].js',
20
+ chunkFileNames: 'js/chunk.jsv.[hash].js',
21
+ assetFileNames: (chunkInfo) => chunkInfo.name.endsWith('.css')
22
+ ? 'css/[name].[hash].css' : 'assets/[name].[hash].[ext]'
23
+ },
24
+ },
25
+ sourcemap: true,
26
+ target: 'es2017', // 不转译async/await
27
+ },
28
+ optimizeDeps: {
29
+ exclude: ['jsview'],
30
+ },
31
+ plugins: [
32
+ fullReload('node_modules/@shijiu/jsview-vue/**/*'),
33
+ ],
34
+ resolve: {
35
+ alias: {
36
+ 'jsview': pathResolve(process.env.PWD, 'node_modules/@shijiu/jsview-vue'),
37
+ '/js/main.jsv.js': pathResolve(process.env.PWD, 'node_modules/@shijiu/jsview-vue/loader/jsview-main.js'),
38
+ },
39
+ preserveSymlinks: true
40
+ },
41
+ server: {
42
+ host: true,
43
+ open: true,
44
+ watch: {
45
+ ignored: [
46
+ '!**/node_modules/@shijiu/jsview-vue/**',
47
+ ],
48
+ }
49
+ },
50
+ });