vite-plugin-kiru 0.29.4 → 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 +14 -16
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -2256,9 +2256,6 @@ var defaultSSGOptions = {
2256
2256
  maxConcurrentRenders: 100
2257
2257
  }
2258
2258
  };
2259
- var manualChunks = {
2260
- kiru: ["kiru", "kiru/router", "kiru/router/client"]
2261
- };
2262
2259
  function createPluginState(opts = {}) {
2263
2260
  let fileLinkFormatter = (path8, line) => `vscode://file/${path8}:${line}`;
2264
2261
  let dtClientPathname = "/__devtools__";
@@ -2324,13 +2321,6 @@ function createViteConfig(config, opts) {
2324
2321
  esbuild: {
2325
2322
  ...defaultEsBuildOptions,
2326
2323
  ...config.esbuild
2327
- },
2328
- build: {
2329
- rollupOptions: {
2330
- output: {
2331
- manualChunks
2332
- }
2333
- }
2334
2324
  }
2335
2325
  };
2336
2326
  }
@@ -2359,7 +2349,7 @@ function createViteConfig(config, opts) {
2359
2349
  rollupOptions: {
2360
2350
  ...rollup,
2361
2351
  output: {
2362
- manualChunks
2352
+ manualChunks: ssr ? {} : { kiru: ["kiru", "kiru/router", "kiru/router/client"] }
2363
2353
  },
2364
2354
  input
2365
2355
  }
@@ -4879,18 +4869,26 @@ function resolveUserDocument(projectRoot, ssgOptions) {
4879
4869
  if (fs5.existsSync(fp)) return fp.replace(/\\/g, "/");
4880
4870
  throw new Error(`Document not found at ${fp}`);
4881
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
+ ]);
4882
4882
  function shouldTransformFile(id, state) {
4883
- if (id.startsWith("\0") || id.startsWith("vite:") || id.includes("/node_modules/")) {
4884
- return false;
4885
- }
4886
- if (!/\.[cm]?[jt]sx?$/.test(id)) {
4883
+ if (id[0] === "\0" || id.startsWith("vite:") || id.includes("/node_modules/")) {
4887
4884
  return false;
4888
4885
  }
4889
4886
  const filePath = path6.resolve(id).replace(/\\/g, "/");
4890
4887
  const isIncludedByUser = state.includedPaths.some(
4891
4888
  (p) => filePath.startsWith(p)
4892
4889
  );
4893
- return isIncludedByUser || filePath.startsWith(state.projectRoot);
4890
+ const isWithinProject = filePath.startsWith(state.projectRoot);
4891
+ return (isWithinProject || isIncludedByUser) && TRANSFORMABLE_EXTENSIONS.has(path6.extname(filePath));
4894
4892
  }
4895
4893
 
4896
4894
  // src/index.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vite-plugin-kiru",
3
- "version": "0.29.4",
3
+ "version": "0.29.6",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",