survivejs / webpack-book

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

"watch" script throwing an error #347

Closed duty-bound closed 3 years ago

duty-bound commented 3 years ago

I am currently on Chapter 3: Composing Configuration.

When running the below script I get an error:

"watch": "nodemon --watch webpack.* --exec \"npm run start\"",

Error: chp3

If I rename "webpack.parts.js" to "parts.js" (and obviously update the respective 'require' statement in 'webpack.config.js) everything works fine; however "parts.js" will no longer be watched for changes.

Is it me doing something wrong or does this script need to be amended please?

Code available in this repo here.

bebraw commented 3 years ago

Hi,

Can you change to "watch": "nodemon --watch \"./webpack.*\" --exec \"npm run start\"",? Note the escaping I added.

I'll have to change this in the book as well so please don't close the issue until I do so. 👍

duty-bound commented 3 years ago

Thanks for your solution :)

rjvim commented 2 years ago

For some reason above one doesn't work for me:

I have to change to:

    "watch": "nodemon --watch \"./webpack.*.*\" --exec \"npm start\"",

Notice: webpack.*.*, even changing to webpack.config.js works, but not just webpack.*

bebraw commented 2 years ago

@rjvim Thanks for the heads up. It's possible nodemon is more strict about * now so I adjusted the book accordingly.