@porotkin/vite-plugin-react-kotlinjs 1.0.2 → 1.0.3

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/README.md CHANGED
@@ -10,7 +10,7 @@ This plugin is inspired by the original
10
10
  Add the following dependency to your `build.gradle.kts`:
11
11
  ```kotlin
12
12
  dependencies {
13
- jsMainImplementation(devNpm("@porotkin/vite-plugin-react-kotlinjs", "^1.0.2"))
13
+ jsMainImplementation(devNpm("@porotkin/vite-plugin-react-kotlinjs", "^1.0.3"))
14
14
  }
15
15
  ```
16
16
 
package/dist/index.js CHANGED
@@ -1,10 +1,11 @@
1
1
  //#region src/index.ts
2
- const REACT_PLUGIN_ENABLER = `const $$$___$$$___$$$ = "react/jsx-dev-runtime"\n`;
2
+ const REACT_PLUGIN_ENABLER = `\nconst $$$___$$$___$$$ = "react/jsx-dev-runtime"\n`;
3
3
  var src_default = (options) => {
4
- const { isReactFC = (code) => code.includes("kotlin-react-core/react/ChildrenBuilder.mjs"), getComponentName = (code) => /^function get_([A-Za-z]+)\(\) {$/m.exec(code)?.[1] } = options ?? {};
4
+ const { isReactFC = (code) => code.includes("kotlin-react-core/react/ChildrenBuilder.mjs"), getComponentName = (code) => /export {(?:.|\s)*get_([A-Za-z]+) as get_(?:.|\s)*}/.exec(code)?.[1] } = options ?? {};
5
5
  return {
6
6
  name: "vite:react-plugin-kotlinjs",
7
7
  enforce: "pre",
8
+ apply: "serve",
8
9
  transform(code) {
9
10
  if (!isReactFC(code)) return {
10
11
  code,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@porotkin/vite-plugin-react-kotlinjs",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "Support React fast refresh in Kotlin/JS",
5
5
  "license": "MIT",
6
6
  "author": "Mikhail Porotkin",