vite-plugin-react-native-web 2.1.1 → 2.2.1

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
@@ -1,38 +1,38 @@
1
- # vite-plugin-react-native-web
2
-
3
- [![npm](https://img.shields.io/npm/v/vite-plugin-react-native-web?style=flat-square)](https://www.npmjs.com/package/vite-plugin-react-native-web)
4
-
5
- Add React Native Web support to Vite by removing Flow types, aliasing `react-native` to `react-native-web` and transforming .js files as .jsx files using ESBuild.
6
-
7
- ## Installation
8
-
9
- Just install it:
10
-
11
- ```bash
12
- npm i vite-plugin-react-native-web -D
13
- ```
14
-
15
- ## Usage
16
-
17
- ```typescript
18
- import reactNativeWeb from "vite-plugin-react-native-web";
19
-
20
- export default defineConfig({
21
- plugins: [
22
- reactNativeWeb()
23
- ]
24
- });
25
- ```
26
-
27
- If you are getting errors please report them in the issues section.
28
-
29
- The following variables are defined in the transformed files: (inferred during Vite's build process)
30
- - `global` as `self`
31
- - `__DEV__` as `process.env.NODE_ENV === 'development'`
32
- - `process.env.NODE_ENV` as `process.env.NODE_ENV`
33
-
34
- ## Contributing
35
- Please feel free to contribute to this project. Just fork it and submit a PR.
36
-
37
- ## License
38
- MIT
1
+ # vite-plugin-react-native-web
2
+
3
+ [![npm](https://img.shields.io/npm/v/vite-plugin-react-native-web?style=flat-square)](https://www.npmjs.com/package/vite-plugin-react-native-web)
4
+
5
+ Add React Native Web support to Vite by removing Flow types, aliasing `react-native` to `react-native-web` and transforming .js files as .jsx files using ESBuild.
6
+
7
+ ## Installation
8
+
9
+ Just install it:
10
+
11
+ ```bash
12
+ npm i vite-plugin-react-native-web -D
13
+ ```
14
+
15
+ ## Usage
16
+
17
+ ```typescript
18
+ import reactNativeWeb from "vite-plugin-react-native-web";
19
+
20
+ export default defineConfig({
21
+ plugins: [
22
+ reactNativeWeb()
23
+ ]
24
+ });
25
+ ```
26
+
27
+ If you are getting errors please report them in the issues section.
28
+
29
+ The following variables are defined in the transformed files: (inferred during Vite's build process)
30
+ - `global` as `self`
31
+ - `__DEV__` as `process.env.NODE_ENV === 'development'`
32
+ - `process.env.NODE_ENV` as `process.env.NODE_ENV`
33
+
34
+ ## Contributing
35
+ Please feel free to contribute to this project. Just fork it and submit a PR.
36
+
37
+ ## License
38
+ MIT
package/dist/cjs/index.js CHANGED
@@ -70,6 +70,11 @@ const reactNativeWeb = ( /*options: ViteReactNativeWebOptions = {}*/) => ({
70
70
  __DEV__: JSON.stringify(development),
71
71
  'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV),
72
72
  },
73
+ build: {
74
+ commonjsOptions: {
75
+ transformMixedEsModules: true,
76
+ },
77
+ },
73
78
  resolve: {
74
79
  extensions,
75
80
  alias: [{ find: 'react-native', replacement: 'react-native-web' }],
package/dist/es/index.js CHANGED
@@ -66,6 +66,11 @@ const reactNativeWeb = ( /*options: ViteReactNativeWebOptions = {}*/) => ({
66
66
  __DEV__: JSON.stringify(development),
67
67
  'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV),
68
68
  },
69
+ build: {
70
+ commonjsOptions: {
71
+ transformMixedEsModules: true,
72
+ },
73
+ },
69
74
  resolve: {
70
75
  extensions,
71
76
  alias: [{ find: 'react-native', replacement: 'react-native-web' }],
package/package.json CHANGED
@@ -1,57 +1,57 @@
1
- {
2
- "name": "vite-plugin-react-native-web",
3
- "version": "2.1.1",
4
- "publishConfig": {
5
- "access": "public"
6
- },
7
- "description": "React Native Web support for Vite",
8
- "license": "MIT",
9
- "repository": {
10
- "url": "git+https://github.com/Bram-dc/vite-plugin-react-native-web.git"
11
- },
12
- "author": "Bram del Canho",
13
- "homepage": "https://github.com/Bram-dc/vite-plugin-react-native-web#readme",
14
- "bugs": "https://github.com/Bram-dc/vite-plugin-react-native-web/issues",
15
- "main": "./dist/cjs/index.js",
16
- "module": "./dist/es/index.js",
17
- "exports": {
18
- "types": "./types/index.d.ts",
19
- "import": "./dist/es/index.js",
20
- "default": "./dist/cjs/index.js"
21
- },
22
- "engines": {
23
- "node": ">=14.0.0"
24
- },
25
- "scripts": {
26
- "build": "rollup -c",
27
- "lint": "biome check --write ./src ./types ./biome.json ./tsconfig.json ./rollup.config.mjs",
28
- "prerelease": "npm run build",
29
- "release": "npm publish"
30
- },
31
- "files": [
32
- "dist",
33
- "!dist/**/*.map",
34
- "types",
35
- "README.md"
36
- ],
37
- "keywords": [
38
- "vite",
39
- "vite-plugin",
40
- "plugin",
41
- "react-native",
42
- "react-native-web"
43
- ],
44
- "dependencies": {
45
- "flow-remove-types": "^2.259.1"
46
- },
47
- "devDependencies": {
48
- "@biomejs/biome": "^1.9.4",
49
- "@rollup/plugin-typescript": "^12.1.2",
50
- "@types/node": "^22.10.10",
51
- "rollup": "^4.32.0",
52
- "tslib": "^2.8.1",
53
- "typescript": "^5.7.3",
54
- "vite": "^6.0.11"
55
- },
56
- "types": "./types/index.d.ts"
57
- }
1
+ {
2
+ "name": "vite-plugin-react-native-web",
3
+ "version": "2.2.1",
4
+ "publishConfig": {
5
+ "access": "public"
6
+ },
7
+ "description": "React Native Web support for Vite",
8
+ "license": "MIT",
9
+ "repository": {
10
+ "url": "git+https://github.com/Bram-dc/vite-plugin-react-native-web.git"
11
+ },
12
+ "author": "Bram del Canho",
13
+ "homepage": "https://github.com/Bram-dc/vite-plugin-react-native-web#readme",
14
+ "bugs": "https://github.com/Bram-dc/vite-plugin-react-native-web/issues",
15
+ "main": "./dist/cjs/index.js",
16
+ "module": "./dist/es/index.js",
17
+ "exports": {
18
+ "types": "./types/index.d.ts",
19
+ "import": "./dist/es/index.js",
20
+ "default": "./dist/cjs/index.js"
21
+ },
22
+ "engines": {
23
+ "node": ">=14.0.0"
24
+ },
25
+ "scripts": {
26
+ "build": "rollup -c",
27
+ "lint": "biome check --write ./src ./types ./biome.json ./tsconfig.json ./rollup.config.mjs",
28
+ "prerelease": "npm run build",
29
+ "release": "npm publish"
30
+ },
31
+ "files": [
32
+ "dist",
33
+ "!dist/**/*.map",
34
+ "types",
35
+ "README.md"
36
+ ],
37
+ "keywords": [
38
+ "vite",
39
+ "vite-plugin",
40
+ "plugin",
41
+ "react-native",
42
+ "react-native-web"
43
+ ],
44
+ "dependencies": {
45
+ "flow-remove-types": "^2.275.0"
46
+ },
47
+ "devDependencies": {
48
+ "@biomejs/biome": "^2.1.1",
49
+ "@rollup/plugin-typescript": "^12.1.4",
50
+ "@types/node": "^24.0.14",
51
+ "rollup": "^4.45.1",
52
+ "tslib": "^2.8.1",
53
+ "typescript": "^5.8.3",
54
+ "vite": "^7.0.4"
55
+ },
56
+ "types": "./types/index.d.ts"
57
+ }