@tsrx/vite-plugin-preact 0.0.83 → 0.0.84

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/preact (.tsrx modules)",
4
4
  "license": "MIT",
5
5
  "author": "Dominic Gannaway",
6
- "version": "0.0.83",
6
+ "version": "0.0.84",
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/preact": "0.1.58"
23
+ "@tsrx/core": "0.1.59",
24
+ "@tsrx/preact": "0.1.59"
25
25
  },
26
26
  "peerDependencies": {
27
27
  "vite": "*"
package/src/index.js CHANGED
@@ -1,5 +1,6 @@
1
1
  /** @import { Plugin } from 'vite' */
2
2
  /** @import { DepScanTransformPlugin } from '@tsrx/core/types/vite/dep-scan' */
3
+ /** @import { RuntimeImportMode } from '@tsrx/preact' */
3
4
 
4
5
  /**
5
6
  * @typedef {{ code: string, map: unknown }} TsrxPreactTransformResult
@@ -48,6 +49,7 @@ const CSS_QUERY = '?tsrx-css&lang.css';
48
49
  * @param {{
49
50
  * jsxImportSource?: string,
50
51
  * suspenseSource?: string,
52
+ * runtimeImports?: RuntimeImportMode,
51
53
  * }} [options]
52
54
  * @returns {TsrxPreactPlugin}
53
55
  */
@@ -55,6 +57,7 @@ export function tsrxPreact(options = {}) {
55
57
  const jsxImportSource = options.jsxImportSource ?? 'preact';
56
58
  const compile_options = {
57
59
  suspenseSource: options.suspenseSource,
60
+ runtimeImports: options.runtimeImports,
58
61
  };
59
62
 
60
63
  /** @type {Map<string, string>} */
@@ -161,7 +164,7 @@ export function tsrxPreact(options = {}) {
161
164
 
162
165
  /**
163
166
  * @param {string} jsxImportSource
164
- * @param {{ suspenseSource?: string }} compile_options
167
+ * @param {{ suspenseSource?: string, runtimeImports?: RuntimeImportMode }} compile_options
165
168
  * @returns {DepScanTransformPlugin}
166
169
  */
167
170
  function create_dep_scan_plugin(jsxImportSource, compile_options) {
package/types/index.d.ts CHANGED
@@ -1,8 +1,11 @@
1
1
  import type { Plugin } from 'vite';
2
+ import type { RuntimeImportMode } from '@tsrx/preact';
2
3
 
3
4
  export interface TsrxPreactPluginOptions {
4
5
  jsxImportSource?: string;
5
6
  suspenseSource?: string;
7
+ /** Direct mode requires `@tsrx/preact-runtime` as a direct production dependency. */
8
+ runtimeImports?: RuntimeImportMode;
6
9
  }
7
10
 
8
11
  export function tsrxPreact(options?: TsrxPreactPluginOptions): Plugin;