Closed Crisfole closed 1 year ago
Hey @Crisfole thank you for the pull request. I intentionally use the local package installs for every project. It make my brain cool to see every dependencies in it's own container :grinning: . And the thing is this repo is being used as the reference of the article I wrote about webpack starter guide. And there I mentioned the reason of this setup. I think, I might not want to change this section since this repo is being used by the developers entering the webpack world recently. But thanks for the catch. Have a good day!
@postNirjhor Yeah! I'm totally on board with using local package installs. Just webpack
does use the local package install. I don't have any global npm packages installed except npm itself, but using webpack
in scripts still works becuase it's installed in node_modules
. (Good example: https://stackoverflow.com/a/49222220/456188)
Here. Better example 😀
cd ~
mkdir crisfoles_example
cd crisfoles_example
npm init -y
# Install an npm package you *don't* have installed globally here that includes a binary in `.bin`
npm install -D rollup
# MANUAL STEP: Add `"rollup": "rollup -v"` to the scripts.
npm run rollup
It still works, because it targets your local bin folder
Good catch!
Your article is fantastic, just wanted to simplify for new users!
Thank you so much @Crisfole ! I'll add your suggestion on the next update while I'll migrate that article from webpack 3 to 4. I'll definitely add your suggestion. And I'm so glad that you liked it. :)
I'm clearing out my open PRs. Closing this. The branch still exists, obvoiusly.
scripts default to the
.bin
folder innode_modules
before global installs. You can test this by:This is important because it means one less binary installed on your PATH. (YAY!)