@octohash/vite-config 0.2.3 → 0.2.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.
Files changed (2) hide show
  1. package/dist/index.mjs +5 -4
  2. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -7,8 +7,8 @@ import deepmerge from 'deepmerge';
7
7
  import { findUp } from 'find-up';
8
8
  import { readPackageJSON } from 'pkg-types';
9
9
  import fsp from 'node:fs/promises';
10
- import { visualizer } from 'rollup-plugin-visualizer';
11
10
  import { fileURLToPath } from 'node:url';
11
+ import { visualizer } from 'rollup-plugin-visualizer';
12
12
  import { EOL } from 'node:os';
13
13
  import dayjs from 'dayjs';
14
14
  import Vue from '@vitejs/plugin-vue';
@@ -55,6 +55,9 @@ function resolveSubOptions(options, key) {
55
55
  return typeof options[key] === "boolean" ? {} : options[key] || {};
56
56
  }
57
57
 
58
+ const PACKAGE_ROOT = fileURLToPath(new URL(".", import.meta.url));
59
+ const VUE_PACKAGES = ["vue", "nuxt", "vitepress"];
60
+
58
61
  const INJECT_SCRIPT = `
59
62
  <script data-app-loading="inject-js">
60
63
  ;(function () {
@@ -69,7 +72,7 @@ async function AppLoadingPlugin(options) {
69
72
  const {
70
73
  rootContainer = "app",
71
74
  title = "",
72
- filePath = path.join(__dirname, "./default-loading.html")
75
+ filePath = path.join(PACKAGE_ROOT, "./default-loading.html")
73
76
  } = options || {};
74
77
  const loadingHtml = await getLoadingRawByHtmlTemplate(filePath);
75
78
  return {
@@ -607,8 +610,6 @@ function defineLibConfig(options) {
607
610
  });
608
611
  }
609
612
 
610
- const VUE_PACKAGES = ["vue", "nuxt", "vitepress"];
611
-
612
613
  function defineConfig(options) {
613
614
  const resolved = {
614
615
  type: getProjectType(),
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@octohash/vite-config",
3
3
  "type": "module",
4
- "version": "0.2.3",
4
+ "version": "0.2.4",
5
5
  "description": "A personal ready-to-use Vite configuration repository, opinionated but customizable.",
6
6
  "author": "jinghaihan",
7
7
  "license": "MIT",