chore: post publish docs & examples changes (#9217)
This commit is contained in:
@@ -64,14 +64,20 @@ We've transitioned from `UMD` to `ESM` bundle format. Our new `dist` bundles ins
|
||||
│ └── types/
|
||||
```
|
||||
|
||||
##### JavaScript: required `"type": "module"` in package.json
|
||||
|
||||
Make sure that your JavaScript environment supports ES modules, as it might be required to define `"type": "module"` in your `package.json` file or as part of the `<script type="module" />` attribute.
|
||||
Make sure that your JavaScript environment supports ES modules. You _may_ need to define `"type": "module"` in your `package.json` file or as part of the `<script type="module" />` attribute.
|
||||
|
||||
##### Typescript: deprecated "moduleResolution": `"node"` or `"node10"`
|
||||
|
||||
Since `"node"` and `"node10"` do not support `package.json` `"exports"` fields, having these values in your `tsconfig.json` will not work. Instead, use `"bundler"`, `"node16"` or `"nodenext"` values. For more information, see [Typescript's documentation](https://www.typescriptlang.org/tsconfig/#moduleResolution).
|
||||
|
||||
##### ESM strict resolution
|
||||
|
||||
Due to ESM strict resolution, if you're using Webpack or other bundler that expects import paths to be fully specified, you'll need to explicitly disable this feature.
|
||||
|
||||
For example in Webpack, you should set [`resolve.fullySpecified`](https://webpack.js.org/configuration/resolve/#resolvefullyspecified) to `false`.
|
||||
|
||||
For this reason, CRA will no longer work unless you eject or use a workaround such as [craco](https://stackoverflow.com/a/75109686).
|
||||
|
||||
##### New structure of the imports
|
||||
|
||||
Dependening on the environment, this is how imports should look like with the `ESM`:
|
||||
|
||||
Reference in New Issue
Block a user