@tsrx/vite-plugin-solid 0.0.88 → 0.0.89

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/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Vite plugin for @tsrx/solid (.tsrx modules) targeting Solid 2.0",
4
4
  "license": "MIT",
5
5
  "author": "Dominic Gannaway",
6
- "version": "0.0.88",
6
+ "version": "0.0.89",
7
7
  "type": "module",
8
8
  "publishConfig": {
9
9
  "access": "public"
@@ -20,8 +20,8 @@
20
20
  }
21
21
  },
22
22
  "dependencies": {
23
- "@tsrx/core": "0.1.58",
24
- "@tsrx/solid": "0.1.58"
23
+ "@tsrx/solid": "0.1.59",
24
+ "@tsrx/core": "0.1.59"
25
25
  },
26
26
  "peerDependencies": {
27
27
  "vite": "*"
package/src/index.js CHANGED
@@ -28,6 +28,7 @@ export function tsrxSolid(options = {}) {
28
28
  let root_dir = process.cwd();
29
29
 
30
30
  const include_pattern = options.include ?? DEFAULT_TSRX_PATTERN;
31
+ const compile_options = { runtimeImports: options.runtimeImports };
31
32
 
32
33
  /**
33
34
  * Decide whether a real (on-disk) path should be treated as a tsrx
@@ -92,7 +93,7 @@ export function tsrxSolid(options = {}) {
92
93
  name: '@tsrx/vite-plugin-solid:dep-scan',
93
94
  isVirtual: is_virtual,
94
95
  toRealPath: to_real_path,
95
- compile,
96
+ compile: (code, id) => compile(code, id, compile_options),
96
97
  }),
97
98
  ],
98
99
  },
@@ -145,7 +146,7 @@ export function tsrxSolid(options = {}) {
145
146
 
146
147
  const real_path = to_real_path(id.split('?')[0]);
147
148
  const source = await readFile(real_path, 'utf-8');
148
- let { code, css, map } = compile(source, real_path);
149
+ let { code, css, map } = compile(source, real_path, compile_options);
149
150
 
150
151
  if (css) {
151
152
  css_cache.set(real_path, css);
package/types/index.d.ts CHANGED
@@ -1,6 +1,9 @@
1
1
  import type { Plugin } from 'vite';
2
+ import type { RuntimeImportMode } from '@tsrx/solid';
2
3
 
3
4
  export interface TsrxSolidOptions {
5
+ /** Direct mode requires `@tsrx/solid-runtime` as a direct production dependency. */
6
+ runtimeImports?: RuntimeImportMode;
4
7
  /**
5
8
  * Regular expression matched against file paths to decide which modules
6
9
  * the plugin should compile as tsrx sources. Defaults to `/\.tsrx$/`,