christianalfoni / webpack-express-boilerplate

A boilerplate for running a Webpack workflow in Node express
MIT License
1.39k stars 291 forks source link

Error: ENOENT, stat dist/index.html #8

Closed Guria closed 8 years ago

Guria commented 9 years ago

Sometimes console logs out Error: ENOENT, stat '/home/ubuntu/workspace/dist/index.html'

brandondurham commented 9 years ago

Having the same issue.

risto1913 commented 9 years ago

Same issue here.

Love the Boilerplate. Thanx

leomelin commented 9 years ago

You should propably run "webpack" once in project directory to create dist/index.html

jenil commented 8 years ago

Has anyone figured this out?

the-watchmaker commented 8 years ago

Hello? Anybody?

leomelin commented 8 years ago
  1. in project directory run "webpack" to generate /dist/ directory with files
  2. change output filename in webpack config file to "bundle.js" instead of "[name].js", like this:
output: {
    path: path.join(__dirname, '/dist/'),
    filename: 'bundle.js',
    publicPath: '/'
  }
  1. npm start and it should work
jenil commented 8 years ago

:+1: yes, just run a webpack to create the files in the dist/ and then you should be good to go.

leomelin commented 8 years ago

@jgog I noticed that at least for me, I had to change the webpack config filename too for hot loading to work - just running webpack made the ENOENT error message to disappear but made further changes to files not to hotload. Did you notice anything similar?

jenil commented 8 years ago

I left the config as it is, ran webpack and then ran npm run start but with that the reloading did not work. So I went into the dist/ and deleted the main.js and the reloading also started to work.

christianalfoni commented 8 years ago

Hi guys,

What is the status here now? Should we change something in the boilerplate to avoid this confusion? I have not met the issue myself.

jenil commented 8 years ago

I don't think any change is required in the boilerplate.

christianalfoni commented 8 years ago

cool :-)