@vixt/core 0.1.23 → 0.1.25

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 +14 -4
  2. package/package.json +3 -3
package/dist/index.mjs CHANGED
@@ -182,12 +182,22 @@ const config = defineVixtModule({
182
182
  vixt.options.vite = config2;
183
183
  },
184
184
  configureServer(server) {
185
+ const mode = server.config.mode;
186
+ const watchFiles = [];
185
187
  const configFiles = vixt._layers.map((layer) => path.resolve(layer.cwd, "vixt.config.ts"));
186
- server.watcher.add(configFiles);
187
- server.watcher.on("change", (file) => {
188
- if (configFiles.includes(path.normalize(file))) {
188
+ const modulesDirs = vixt._layers.map((layer) => path.resolve(layer.cwd, vixt.options.srcDirName, "modules"));
189
+ watchFiles.push(...configFiles, ...modulesDirs);
190
+ const workspaceManifestLocation = findUpSync(["pnpm-workspace.yaml", "pnpm-workspace.yml"]);
191
+ if (workspaceManifestLocation) {
192
+ const workspaceDir = path.dirname(workspaceManifestLocation);
193
+ const envFiles = [`${workspaceDir}/.env`, `${workspaceDir}/.env.local`, `${workspaceDir}/.env.${mode}`, `${workspaceDir}/.env.${mode}.local`];
194
+ watchFiles.push(...envFiles);
195
+ }
196
+ server.watcher.add(watchFiles);
197
+ server.watcher.on("all", (_2, file) => {
198
+ const match = watchFiles.some((e) => path.normalize(file).match(e));
199
+ if (match)
189
200
  server.restart();
190
- }
191
201
  });
192
202
  }
193
203
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vixt/core",
3
3
  "type": "module",
4
- "version": "0.1.23",
4
+ "version": "0.1.25",
5
5
  "author": "SoulLyoko<https://github.com/SoulLyoko>",
6
6
  "license": "MIT",
7
7
  "homepage": "https://github.com/SoulLyoko/vixt#readme",
@@ -35,10 +35,10 @@
35
35
  "mlly": "^1.7.2",
36
36
  "pathe": "^1.1.2",
37
37
  "pkg-types": "^1.2.1",
38
- "tsx": "^4.19.1",
38
+ "tsx": "^4.19.2",
39
39
  "vite": "^5.4.10",
40
40
  "vite-plugin-checker": "^0.8.0",
41
- "vue-tsc": "2.1.6"
41
+ "vue-tsc": "2.1.10"
42
42
  },
43
43
  "scripts": {
44
44
  "build": "unbuild"