jpsierens / webpack-react-redux

A boilerplate for playing around with react, redux and react-router with the help of webpack.
MIT License
599 stars 196 forks source link

yarn build #24

Closed dmpx closed 6 years ago

dmpx commented 7 years ago

main.min.js

{"undefined"!=typeof REACT_HOT_LOADER&&(REACT_HOT_LOADER.register(a,"About","C:/Users/win/Desktop/wrr/app/components/About.js"),REACT_HOT_LOADER.register(u,"default","C:/Users/win/Desktop/wrr/app/components/About.js"))})()},

can remove REACT_HOT_LOADER?

helb commented 7 years ago

Yes, just pass NODE_ENV=production to webpack:

  "scripts": {
    …
    "build": "rimraf dist && cross-env NODE_ENV=production webpack --config ./webpack.production.config.js --progress --profile --colors",
    …  
},

(cross-env is often needed to make it work on Windows)

# counting HOT_LOADER occurrences in the production build:

$ # without NODE_ENV=production:
$ grep -o HOT_LOADER dist/* | wc -l 
$ 36

$ # with NODE_ENV=production:
$ grep -o HOT_LOADER dist/* | wc -l 
$ 0  # nothing :)
jpsierens commented 6 years ago

Thanks @helb !