reactjs - HTML doesn't load webpack-built files -


my build on webpack-dev-server works fine, when compile node_env=production webpack --config html file outputs blank page.

in dev-server html load files way

<script src="http://localhost:8000/build/vendor.js"></script> <link rel="stylesheet" type="text/css" href="http://localhost:8000/build/main.css" media="screen" /> <script src="http://localhost:8000/build/main.js"></script> 

and in production html (resides in /build/):

<script type="text/javascript" src="vendor.js"></script> <link rel="stylesheet" type="text/css" href="main.css" media="screen"/> <script type="text/javascript" src="main.js"></script> 

configs differ in following:

  1. production env removes react-hot style-loader css-loader less-loader loaders, entries 'webpack/hot/dev-server' 'webpack-dev-server/client?http://0.0.0.0:8000', hotmodulereplacementplugin(), #eval devtool
  2. production env adds: style css less loaders, optimize.occurenceorderplugin(), optimize.uglifyjsplugin({comments: /a^/, compress: {warnings: false}}, sourcemap devtool

thanks help!


Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -