Skip to content

Commit aef250c

Browse files
Update README
1 parent 1e78de2 commit aef250c

File tree

1 file changed

+7
-56
lines changed

1 file changed

+7
-56
lines changed

README.md

Lines changed: 7 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -58,66 +58,17 @@ Use `on:raw-EventName` and `oncapture:RawEvent-Name` to register event handlers
5858

5959
To enable capture and bubble phase of an event, please refer to this [doc](https://github.com/SudoMaker/DOMiNATIVE#tweakabledefineeventoptioneventname-string-option-eventoption)
6060

61-
### Patching `package.json` of `solid-js`
61+
### Manually aliasing `solid-js`
6262

63-
You have to patch the `exports` key in the `package.json` form `node_modules/solid-js`. It is recommended to use [patch-package](https://www.npmjs.com/package/patch-package) for patching.
63+
You have to manually aliasing `solid-js` to the browser version in `webpack.config.js`, otherwise it will use the server version.
6464

6565
For example:
6666

67-
```patch
68-
diff --git a/node_modules/solid-js/package.json b/node_modules/solid-js/package.json
69-
index b4c3656..47e362f 100644
70-
--- a/node_modules/solid-js/package.json
71-
+++ b/node_modules/solid-js/package.json
72-
@@ -44,48 +44,6 @@
73-
],
74-
"exports": {
75-
".": {
76-
- "browser": {
77-
- "development": {
78-
- "import": {
79-
- "types": "./types/index.d.ts",
80-
- "default": "./dist/dev.js"
81-
- },
82-
- "require": "./dist/dev.cjs"
83-
- },
84-
- "import": {
85-
- "types": "./types/index.d.ts",
86-
- "default": "./dist/solid.js"
87-
- },
88-
- "require": "./dist/solid.cjs"
89-
- },
90-
- "deno": {
91-
- "import": {
92-
- "types": "./types/index.d.ts",
93-
- "default": "./dist/server.js"
94-
- },
95-
- "require": "./dist/server.cjs"
96-
- },
97-
- "worker": {
98-
- "import": {
99-
- "types": "./types/index.d.ts",
100-
- "default": "./dist/server.js"
101-
- },
102-
- "require": "./dist/server.cjs"
103-
- },
104-
- "node": {
105-
- "import": {
106-
- "types": "./types/index.d.ts",
107-
- "default": "./dist/server.js"
108-
- },
109-
- "require": "./dist/server.cjs"
110-
- },
111-
- "development": {
112-
- "import": {
113-
- "types": "./types/index.d.ts",
114-
- "default": "./dist/dev.js"
115-
- },
116-
- "require": "./dist/dev.cjs"
117-
- },
118-
"import": {
119-
"types": "./types/index.d.ts",
120-
"default": "./dist/solid.js"
67+
```js
68+
// Please keep this order of setting aliases
69+
config.resolve.alias
70+
.set("solid-js/universal", path.resolve(__dirname, `node_modules/solid-js/universal/dist/${env.production ? 'universal' : 'dev'}.js`))
71+
.set("solid-js", path.resolve(__dirname, `node_modules/solid-js/dist/${env.production ? 'solid' : 'dev'}.js`))
12172
```
12273

12374
## License

0 commit comments

Comments
 (0)