@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 +1 -1
- package/dist/index.js +3 -2
- package/package.json +1 -1
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.
|
|
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 =
|
|
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) =>
|
|
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,
|