survivejs / webpack-book

From apprentice to master (CC BY-NC-ND)
https://survivejs.com/webpack/
2.42k stars 319 forks source link

chapter Techniques/testing: Configuration file found but no entry configured. #279

Closed aladdin-add closed 7 years ago

aladdin-add commented 7 years ago

thanks for the amazing work! it helped me a a lot!

in Techniques => testing => Configuring Webpack, when running npm run test:mocha:watch, I got an error:

> webpack-starter@0.0.0 test:mocha:watch C:\repo\webpack-starter
> webpack-dev-server --hot --config webpack.mocha.js

Configuration file found but no entry configured.
bebraw commented 7 years ago

Hi,

Can you link to a repository for me to study?

aladdin-add commented 7 years ago

commit: https://github.com/Aladdin-ADD/webpack-starter/commit/816b96d7752f2aa15c54feeba198d2dd18635b99

branch: https://github.com/Aladdin-ADD/webpack-starter/tree/bug-repro

bebraw commented 7 years ago

I think I got it... webpack-dev-server expects an entry in webpack configuration (stated in the message :) ). If you want watch mode for Mocha, you could try npm run test:mocha -- --watch. That works for me. You can push that behind test:mocha:watch if you want.

Sorry for the delay, it has been busy times for me.

aladdin-add commented 7 years ago

it works for me! thanks~

aladdin-add commented 7 years ago

But I got confused by test:mocha:watch, how can I run this script? and I didn't see its value..😕

bebraw commented 7 years ago

@Aladdin-ADD I see the real problem now. See here and compare to mine. I inject entry to the configuration there. This was the real issue.

Mentioning --watch option could be worthwhile so let's leave this open till I have time to fix that.

aladdin-add commented 7 years ago

hmm...seems like it's because I missed this step04_multiple_pages.md#adjusting-configuration.

thanks so much!!!❤️