File tree Expand file tree Collapse file tree 2 files changed +15
-10
lines changed Expand file tree Collapse file tree 2 files changed +15
-10
lines changed Original file line number Diff line number Diff line change 77 "scripts" : {
88 "benchmark" : " node benchmark" ,
99 "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" ,
1212 "clean" : " rimraf dist" ,
1313 "coveralls" : " nyc report --reporter=text-lcov | coveralls" ,
1414 "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 ;
23
3- /**
4- * Webpack configuration.
5- */
6- module . exports = {
7- entry : path . resolve ( __dirname , 'index.js' ) ,
4+ const config = {
5+ entry : resolve ( __dirname , 'index.js' ) ,
86 output : {
97 library : 'HTMLReactParser' ,
10- libraryTarget : 'umd'
8+ libraryTarget : 'umd' ,
9+ path : resolve ( __dirname , 'dist' )
1110 } ,
1211 externals : {
1312 react : {
@@ -17,5 +16,11 @@ module.exports = {
1716 root : 'React'
1817 }
1918 } ,
20- mode : process . env . NODE_ENV
19+ mode : NODE_ENV
2120} ;
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