vite-plugin-kiru 0.29.5 → 0.29.6

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.js +13 -5
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -4869,18 +4869,26 @@ function resolveUserDocument(projectRoot, ssgOptions) {
4869
4869
  if (fs5.existsSync(fp)) return fp.replace(/\\/g, "/");
4870
4870
  throw new Error(`Document not found at ${fp}`);
4871
4871
  }
4872
+ var TRANSFORMABLE_EXTENSIONS = /* @__PURE__ */ new Set([
4873
+ ".tsx",
4874
+ ".jsx",
4875
+ ".ts",
4876
+ ".js",
4877
+ ".mjs",
4878
+ ".mts",
4879
+ ".md",
4880
+ ".mdx"
4881
+ ]);
4872
4882
  function shouldTransformFile(id, state) {
4873
- if (id.startsWith("\0") || id.startsWith("vite:") || id.includes("/node_modules/")) {
4874
- return false;
4875
- }
4876
- if (!/\.[cm]?[jt]sx?$/.test(id)) {
4883
+ if (id[0] === "\0" || id.startsWith("vite:") || id.includes("/node_modules/")) {
4877
4884
  return false;
4878
4885
  }
4879
4886
  const filePath = path6.resolve(id).replace(/\\/g, "/");
4880
4887
  const isIncludedByUser = state.includedPaths.some(
4881
4888
  (p) => filePath.startsWith(p)
4882
4889
  );
4883
- return isIncludedByUser || filePath.startsWith(state.projectRoot);
4890
+ const isWithinProject = filePath.startsWith(state.projectRoot);
4891
+ return (isWithinProject || isIncludedByUser) && TRANSFORMABLE_EXTENSIONS.has(path6.extname(filePath));
4884
4892
  }
4885
4893
 
4886
4894
  // src/index.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vite-plugin-kiru",
3
- "version": "0.29.5",
3
+ "version": "0.29.6",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
@@ -17,8 +17,8 @@
17
17
  "rollup": "^4.46.2",
18
18
  "tsx": "^4.20.3",
19
19
  "typescript": "^5.9.2",
20
- "kiru-devtools-host": "^1.0.0",
21
- "kiru-devtools-client": "^0.0.0"
20
+ "kiru-devtools-client": "^0.0.0",
21
+ "kiru-devtools-host": "^1.0.0"
22
22
  },
23
23
  "dependencies": {
24
24
  "magic-string": "^0.30.17",