Skip to content

Commit 8644c1c

Browse files
Create webpack.config.js
Follow standard config: https://webpack.github.io/docs/configuration.html Export to `./dist/html-react-parser.min.js` Specify `react` in "externals": https://github.com/webpack/webpack/tree/master/examples/externals
1 parent f1e3c2a commit 8644c1c

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

webpack.config.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
'use strict';
2+
3+
/**
4+
* Export webpack configuration.
5+
*/
6+
module.exports = {
7+
entry: './index',
8+
output: {
9+
filename: './dist/html-to-react.min.js',
10+
library: 'HTMLReactParser',
11+
libraryTarget: 'umd'
12+
},
13+
externals: {
14+
'react': {
15+
root: 'React',
16+
commonjs2: 'react',
17+
commonjs: 'react',
18+
amd: 'react'
19+
}
20+
}
21+
};

0 commit comments

Comments
 (0)