DeloitteDigitalUK / react-redux-starter-app

Starter app with React, Redux, Webpack, CSS Modules, API calls etc.
MIT License
16 stars 0 forks source link

npm run deploy adds fully qualified paths #41

Open mattdell opened 7 years ago

mattdell commented 7 years ago

Expected behaviour

When I run npm run deploy I expect an index.html to be generated with relative paths to my assets.

Actual behaviour

When I run npm run deploy my index.html file contains a fully qualified path to a resource on my local machine, such as

<script type="text/javascript" src="http://172.16.199.68:3000/app.5bbf68ac4faed546b575.js">

I would expect the following

<script type="text/javascript" src="app.5bbf68ac4faed546b575.js">

Because of this, I cannot deploy the resulting files.

mattdell commented 7 years ago

Seems the cause is from

webpackConfig.output = {
  filename: `[name].[${config.compiler_hash_type}].js`,
  path: paths.dist(),
  publicPath: config.compiler_public_path,
};

The publicPath entry is what does it. Removing it seems to fix the issue and continues to run locally running npm start. Is that setting needed for something that I'm not seeing?