@floeorg/vite-plugin 0.1.11 → 0.1.12

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,4 +1,3 @@
1
- import type { Plugin } from "vite";
2
1
  export interface FloeOptions {
3
2
  /** Path to the floe binary. Defaults to "floe". */
4
3
  compiler?: string;
@@ -19,4 +18,35 @@ export interface FloeOptions {
19
18
  * })
20
19
  * ```
21
20
  */
22
- export default function floe(options?: FloeOptions): Plugin;
21
+ export default function floe(options?: FloeOptions): {
22
+ name: string;
23
+ enforce: "pre";
24
+ config(config: {
25
+ resolve?: {
26
+ extensions?: string[];
27
+ };
28
+ }): {
29
+ resolve: {
30
+ extensions: string[];
31
+ };
32
+ esbuild: {
33
+ include: RegExp;
34
+ loader: "tsx";
35
+ };
36
+ };
37
+ transform(this: {
38
+ error(msg: string): never;
39
+ }, code: string, id: string): {
40
+ code: string;
41
+ map: string | null;
42
+ moduleType: string;
43
+ } | null;
44
+ handleHotUpdate({ file, server }: {
45
+ file: string;
46
+ server: {
47
+ moduleGraph: {
48
+ getModulesByFile(file: string): Set<any> | undefined;
49
+ };
50
+ };
51
+ }): any[] | undefined;
52
+ };
package/dist/index.js CHANGED
@@ -23,7 +23,13 @@ export default function floe(options = {}) {
23
23
  config(config) {
24
24
  const existing = config.resolve?.extensions ?? [".mjs", ".js", ".mts", ".ts", ".jsx", ".tsx", ".json"];
25
25
  const extensions = existing.includes(".fl") ? existing : [".fl", ...existing];
26
- return { resolve: { extensions } };
26
+ return {
27
+ resolve: { extensions },
28
+ esbuild: {
29
+ include: /\.(tsx?|jsx?|fl)$/,
30
+ loader: "tsx",
31
+ },
32
+ };
27
33
  },
28
34
  transform(code, id) {
29
35
  // Strip query params for extension check (Vite adds ?import, ?t=xxx, etc.)
@@ -35,6 +41,7 @@ export default function floe(options = {}) {
35
41
  return {
36
42
  code: result.code,
37
43
  map: result.map,
44
+ moduleType: "tsx",
38
45
  };
39
46
  }
40
47
  catch (error) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@floeorg/vite-plugin",
3
- "version": "0.1.11",
3
+ "version": "0.1.12",
4
4
  "description": "Vite plugin for Floe - compile .fl files to TypeScript",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",