This section of your
package.json file is your
“start”: “node ./node_modules/webpack-dev-server/bin/webpack-dev-server.js”,
“test”: “mocha — compilers js:babel-core/register — require ./test/test_helper.js — recursive ./test”,
“test:watch”: “npm run test — — watch”
You have 3 scripts,
test , and
test:watch . These are what is known as aliases, or shortcut commands that you can run in your terminal. The are preceded with the
npm start is just a shortcut for
node ./node_modules/webpack-dev-server/bin/webpack-dev-server.js .
Something that jumps out at me right away is your
startscript. If you look at the webpack-dev-server docs on GitHub, you’ll see a quick way to get it up and running:
Compare that with your command:
See the difference?
Also, before I continue I just want to show you a cool little bit of info:
package.json you don’t need to specify absolute paths in
npm scripts . Instead of:
You can just write:
package.json localizes your
node_modules for you.
So, before you go any further try to switch up your
npm start script to look like this:
Also, you are saying that you are fairly knew to this. I wouldn’t recommend jumping into a boilerplate, especially a heavy one with many dependencies, when you are just starting out. Start with one piece of technology at a time and use it until it makes sense. Don’t add anything else unless you absolutely need to.
create-react-app is so awesome because it abstracts away all of the unnecessary boilerplate and lets you work with pure React with no configuration necessary.
Let me know if you have any more questions! :)