twynejs 1.0.0 → 1.0.1

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.
package/dist/index.d.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  import type { Plugin } from "vite";
2
- export type { HtmlValue } from "./jsx-runtime.js";
3
2
  export interface PagesPluginOptions {
4
3
  /**
5
4
  * Directory containing the page modules (one `.ts`/`.tsx` file per page).
package/dist/index.js CHANGED
@@ -842,12 +842,14 @@ ${ctx.content}
842
842
  };
843
843
  },
844
844
  async transform(code, id) {
845
- if (!id.endsWith(".tsx")) {
845
+ if (!id.endsWith(".tsx") && !id.endsWith(".jsx")) {
846
846
  return null;
847
847
  }
848
+ const loader = id.endsWith(".tsx") ? "tsx" : "jsx";
848
849
  const result = await transformWithEsbuild(code, id, {
849
- loader: "tsx",
850
+ loader,
850
851
  target: "esnext",
852
+ jsx: "transform",
851
853
  jsxFactory: "jsx",
852
854
  jsxFragment: "Fragment",
853
855
  sourcemap: true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "twynejs",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "twine A Vite SSG plugin that turns .ts/.tsx pages, Markdown docs and Liquid/EJS templates into a multi-page static build with a virtual:pages module.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",