Hacker News new | past | comments | ask | show | jobs | submit login

Npm can be pretty nice if you know what you need (which might not be the case always; the modern web stack can get pretty deep).

But I still like:

https://www.keithcirkel.co.uk/how-to-use-npm-as-a-build-tool...

And the accompanying example repo:

https://github.com/keithamus/npm-scripts-example

I'm not eniterly clear on what parcel/webpack does better/simpler - maybe windows support?

I certainly see how one might prefer yarn over npm for dependency management, though - so maybe npm isn't as nice a build tool anymore?




I haven't used Bootstrap in a while, but all I was saying above is that it rebuilds itself with a simple "npm run dist", which under the covers is a call to node-sass. That compiles sass files, but it's still not what I consider a build tool. (Attempting to override bootstrap with a css file is DOING IT WRONG.) For build tools, people used to use Grunt and Gulp. Now they use Webpack. Parcel is better than any of those, because does the right thing automatically. That could include calling node-sass, if you want.


> Parcel is better than any of those, because does the right thing automatically.

Parcel does seem nice, because it does do a lot of things automatically. But I'm not sure that can always be "the right thing". For example it seems a bit surprising that plain js will always be compiled, to support ie11, while typescript will not.

Neither option is "always the right thing".

And as far as I could figure out, there's no easy way to target deploying to separate cdns?

Not trying to move the goal posts here, it's just that some configuration is to expected in the complex reality of the modern web stack.

And a benefit of npm is that that'll pretty much always be part of the stack anyway.

Did come across this, which (if it isn't outdated) fills in some information that wasn't obvious from the official documentation:

https://golb.hplar.ch/2018/01/Bundling-web-applications-with...


That's a nice link that points to some details I haven't had to consider before. I'm not sure what's going on with the "public-url" flag, because I've never needed to use that and when I look up the default [0] it says "/" which is what one would expect. Maybe this is just out of date?

I don't care much about typescript or ie11, but if there are specific improvements that could be made you could open a PR.

I don't think parcel concerns itself with deploying to separate CDNs. You can do that in npm! Does anything need to be built differently to support that? Maybe just keep files bound for different CDNs in different directories?

[0] https://parceljs.org/cli.html#set-the-public-url-to-serve-on




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: