Skip to content

Commit 2ca5465

Browse files
docs(readme): add webpack workaround for mjs in FAQ
Closes #238
1 parent 5ef579c commit 2ca5465

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ parse('<p>Hello, World!</p>'); // React.createElement('p', {}, 'Hello, World!')
5555
- [Don't change case of tags](#dont-change-case-of-tags)
5656
- [TS Error: Property 'attribs' does not exist on type 'DOMNode'](#ts-error-property-attribs-does-not-exist-on-type-domnode)
5757
- [Can I enable `trim` for certain elements?](#can-i-enable-trim-for-certain-elements)
58+
- [Webpack build warnings](#webpack-build-warnings)
5859
- [Performance](#performance)
5960
- [Contributors](#contributors)
6061
- [Code Contributors](#code-contributors)
@@ -461,6 +462,28 @@ The TypeScript error occurs because `DOMNode` needs be an instance of domhandler
461462
462463
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).
463464
465+
### Webpack build warnings
466+
467+
If you see the Webpack build warning:
468+
469+
```
470+
export 'default' (imported as 'parse') was not found in 'html-react-parser'
471+
```
472+
473+
Then update your Webpack config to:
474+
475+
```js
476+
// webpack.config.js
477+
module.exports = {
478+
// ...
479+
resolve: {
480+
mainFields: ['browser', 'main', 'module'],
481+
},
482+
};
483+
```
484+
485+
See [#238](https://github.com/remarkablemark/html-react-parser/issues/238) and [#213](https://github.com/remarkablemark/html-react-parser/issues/213).
486+
464487
## Performance
465488

466489
Run benchmark:

0 commit comments

Comments
 (0)