File tree 2 files changed +15
-10
lines changed
2 files changed +15
-10
lines changed Original file line number Diff line number Diff line change 7
7
"scripts" : {
8
8
"benchmark" : " node benchmark" ,
9
9
"build" : " npm run clean && npm run build:min && npm run build:unmin" ,
10
- "build:min" : " cross-env NODE_ENV=production webpack -o dist/ html-react-parser.min.js" ,
11
- "build:unmin" : " cross-env NODE_ENV=development webpack -o dist/ html-react-parser.js" ,
10
+ "build:min" : " cross-env NODE_ENV=production webpack --output-filename html-react-parser.min.js" ,
11
+ "build:unmin" : " cross-env NODE_ENV=development webpack --output-filename html-react-parser.js" ,
12
12
"clean" : " rimraf dist" ,
13
13
"coveralls" : " nyc report --reporter=text-lcov | coveralls" ,
14
14
"lint" : " eslint --ignore-path .gitignore ." ,
Original file line number Diff line number Diff line change 1
- var path = require ( 'path' ) ;
1
+ const { resolve } = require ( 'path' ) ;
2
+ const { NODE_ENV } = process . env ;
2
3
3
- /**
4
- * Webpack configuration.
5
- */
6
- module . exports = {
7
- entry : path . resolve ( __dirname , 'index.js' ) ,
4
+ const config = {
5
+ entry : resolve ( __dirname , 'index.js' ) ,
8
6
output : {
9
7
library : 'HTMLReactParser' ,
10
- libraryTarget : 'umd'
8
+ libraryTarget : 'umd' ,
9
+ path : resolve ( __dirname , 'dist' )
11
10
} ,
12
11
externals : {
13
12
react : {
@@ -17,5 +16,11 @@ module.exports = {
17
16
root : 'React'
18
17
}
19
18
} ,
20
- mode : process . env . NODE_ENV
19
+ mode : NODE_ENV
21
20
} ;
21
+
22
+ if ( NODE_ENV === 'production' ) {
23
+ config . devtool = 'source-map' ;
24
+ }
25
+
26
+ module . exports = config ;
You can’t perform that action at this time.
0 commit comments