Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Development Tools Understanding webpack.config.js

Is the order of dependencies important?

Or can we list them in any random order?

2 Answers

Ari Misha
Ari Misha
19,323 Points

Hiya there! If you're talking about order of plugins in Dependencies and DevDependencies in package.json file, then not really but if you really think it through, maybe it is teeny tiny important. Say you've a .babelrc.json file , and you have installed all dependencies and DevDependencies before installing babel-core plugin. So yeah whenever you'll run your file, it wont simply work, right? So yeah just its all about priorities, like some plugins needs to be installed before others. Thats the only thing i can think of. Its more like a common sense than the order of all dependencies.

~ Ari

Gabbie Metheny
Gabbie Metheny
33,778 Points

I believe package.json just lists dependencies in alphabetical order by default, so I don't think it matters. You usually won't be manually adding the dependencies to your file, rather you'll be instructing npm to save packages as dependencies when you install them.

npm install jquery --save
// will add jquery to your dependencies
npm install webpack --save-dev
// will add webpack to your devDependencies