Previously I would use NPM for server side stuff and Bower for frontend. NPM would install to the node_modules/
directory and I had a .bowerrc
to install those packages to public/lib
.
Now I've begun to use Yarn instead of NPM; and since they are pretty much 1:1 compatible it has been a smooth change.. However, now I'm wondering if I can ditch Bower and just use Yarn for everything. But I do not see a way (in either NPM or Yarn) to install normal packages to node_modules, but then have a sort of separate option to put some packages in public/
... Something similar to the --dev
option but instead it would be yarn add jquery --public
. Does anything like this exist?
One option, of course, would be to install all packages to the public/
directory but I believe this is a bad practice (correct me if I'm wrong).
Another option might be to have a separate package.json
in the public/
folder and run separate Yarn commands in there for frontend packages, but it's just a bit less convenient, I think; more error prone.
The norm pretty much is something like:
yarn
gulp
, or module loader & bundler such aswebpack
to create the bundles you need.I'd suggest having a look at a kickstart project (pertaining to the stack that you're using) eg: I've used : Fountainjs in the past with success, or look into Yeoman if fountain doesnt strike your fancy (fyi. Fountain is built on top of Yeoman)
In pseudo commands: