Skip to content

Commit 02bd787

Browse files
committed
chore: add faq
1 parent cf37e05 commit 02bd787

File tree

1 file changed

+49
-17
lines changed

1 file changed

+49
-17
lines changed

README.md

Lines changed: 49 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
Use `single-spa` `systemjs` in your `create-react-app`.
44

5-
> Quickly adapt `react-scripts` as a submodule of single-spa !!!
5+
> Quickly adapt `react-scripts` as a submodule of single-spa !!!
66
> Support `react-scripts@4.x` `react-scripts@5.x` version.
77
88
## Features
99

10-
- Support `react-scripts@5.x` compatible with common configuration migrations
10+
- Support `react-scripts@5.x` compatible with common configuration migrations
1111
- Output `systemjs` library auto add `SystemJSPublicPathPlugin`
1212
- Support `ReactFastRefresh` hot refresh
1313

@@ -58,52 +58,84 @@ module.exports = {
5858
## Options
5959

6060
### orgName
61-
Type: `string`
61+
62+
Type: `string`
6263
The name of the organization this application is written for.
6364

6465
### projectName
65-
Type: `string`
66+
67+
Type: `string`
6668
The name of the current project. This usually matches the git repo's name.
6769

6870
### entry
69-
Type: `string`
70-
Default: `src/{orgName}-{projectName}.{js|jsx|ts|tsx}` `src/index.{js|jsx|ts|tsx}`
71+
72+
Type: `string`
73+
Default: `src/{orgName}-{projectName}.{js|jsx|ts|tsx}` `src/index.{js|jsx|ts|tsx}`
7174
The entry file.
7275

7376
### outputFilename
74-
Type: `string`
75-
Default:
76-
- development `{orgName}-{projectName}.[contenthash:8].js`
77-
- production `{orgName}-{projectName}.js`
77+
78+
Type: `string`
79+
Default:
80+
81+
- development `{orgName}-{projectName}.[contenthash:8].js`
82+
- production `{orgName}-{projectName}.js`
7883

7984
### rootDirectoryLevel
80-
Type: `number`
85+
86+
Type: `number`
8187
This is the rootDirectoryLevel that is passed to https://github.com/joeldenning/systemjs-webpack-interop.
8288

8389
### reactPackagesAsExternal
90+
8491
Type: `boolean`
8592
This will `react` `react-dom` as webpack externals or not.
8693

8794
### orgPackagesAsExternal
88-
Type: `boolean`
95+
96+
Type: `boolean`
8997
This changes whether package names that start with @your-org-name are treated as webpack externals or not.
9098

9199
### peerDepsAsExternal
100+
92101
Type: `boolean`
93102
This will package.json `peerDependencies` as webpack externals or not.
94103

95104
## FQA
96105

97106
### FastRefresh invalid
98-
- If `react` `react-dom` is external, `react-dev-tool` must be installed to refresh automatically.
99-
For details, please see https://github.com/facebook/react/issues/17552
107+
108+
- If `react` `react-dom` is external, `react-dev-tool` must be installed to refresh automatically.
109+
For details, please see https://github.com/facebook/react/issues/17552
100110
- Check whether the ws connection is normal, you can set in `.env` file
101111
- `WDS_SOCKET_PORT` "2002"
102112
- `WDS_SOCKET_HOST` "localhost"
103113
- `WDS_SOCKET_PATH` "/projectName" **Please start with "/"**
104-
> The default hotreload client uses the relative website protocol,
105-
which is the protocol of the main base. It can use the localhost
106-
protocol and the local development port.
114+
> The default hotreload client uses the relative website protocol,
115+
> which is the protocol of the main base. It can use the localhost
116+
> protocol and the local development port.
117+
118+
### webpack < 5 used to include polyfills for node.js core modules by default
119+
120+
The following packages have been integrated by default, and the specified dependencies can be installed directly in the project.
121+
122+
```json
123+
{
124+
"url": "url",
125+
"fs": "fs",
126+
"assert": "assert",
127+
"crypto": "crypto-browserify",
128+
"http": "stream-http",
129+
"https": "https-browserify",
130+
"os": "os-browserify/browser",
131+
"buffer": "buffer",
132+
"stream": "stream-browserify"
133+
}
134+
```
135+
136+
### You attempted to import XXXXXXXX which falls outside of the project src/ directory
137+
138+
You can use `customize-cra` `removeModuleScopePlugin()`
107139

108140
## License
109141

0 commit comments

Comments
 (0)