Skip to content

Commit

Permalink
docs(readme): add webpack workaround for mjs in FAQ
Browse files Browse the repository at this point in the history
Closes #238
  • Loading branch information
remarkablemark committed Apr 21, 2021
1 parent 5ef579c commit 2ca5465
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ parse('<p>Hello, World!</p>'); // React.createElement('p', {}, 'Hello, World!')
- [Don't change case of tags](#dont-change-case-of-tags)
- [TS Error: Property 'attribs' does not exist on type 'DOMNode'](#ts-error-property-attribs-does-not-exist-on-type-domnode)
- [Can I enable `trim` for certain elements?](#can-i-enable-trim-for-certain-elements)
- [Webpack build warnings](#webpack-build-warnings)
- [Performance](#performance)
- [Contributors](#contributors)
- [Code Contributors](#code-contributors)
Expand Down Expand Up @@ -461,6 +462,28 @@ The TypeScript error occurs because `DOMNode` needs be an instance of domhandler

Yes, you can enable or disable [`trim`](#trim) for certain elements using the [`replace`](#replace) option. See [#205](https://github.com/remarkablemark/html-react-parser/issues/205).

### Webpack build warnings

If you see the Webpack build warning:

```
export 'default' (imported as 'parse') was not found in 'html-react-parser'
```

Then update your Webpack config to:

```js
// webpack.config.js
module.exports = {
// ...
resolve: {
mainFields: ['browser', 'main', 'module'],
},
};
```

See [#238](https://github.com/remarkablemark/html-react-parser/issues/238) and [#213](https://github.com/remarkablemark/html-react-parser/issues/213).

## Performance

Run benchmark:
Expand Down

0 comments on commit 2ca5465

Please sign in to comment.