Hey,
I'm using the jQuery Validation plugin via npm. After running npm install jquery-validation the minified JavaScript code is not downloaded to node_modules/jquery-validation/dist. Would you consider adding it?
Best,
C膬t膬lin
Shouldnt your build process take care of minifying and combining the overall projects javascript sources? I see no point in shiping a pre-minified version in npm
Of course we can do that but it's not what I expected. I asume a package contents are identical regardless the package is downloaded as zip, hotlinked from a CDN or installed via a package manager.
In this case I use npm to manage project dependencies, including jQuery Validation. The build process takes care of the project sources indeed, but only ours. Vendored assets are simply copied from the node_modules directory, then linked to a CDN (if any available) with local fallback. See an example:
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-validate/1.15.0/jquery.validate.min.js"></script>
<script>window.jQuery.fn.validate || document.write('<script src="{{ site.baseurl }}/assets/vendor/jquery-validation/jquery.validate.min.js"><\/script>')</script>
I try to avoid manually downloading and adding any packages to a repository especially if they are provided via a package manager.
A few more packages used: dotdotdot, jquery, jquery.scrollto, slick-carousel. All of them provide a full distribution via npm - allowing us to access wanted resources with ease. That's how a dependency should work, you plug it in and it works, right?
I agree this is more of a request than an issue but would help us (and others too) making use of npm packages more consistent. What do you think? Does it make any sense to you?
Here are five important reasons why shipping the minified version is a good thing:
thx for the detailed writeup. I merged your PR.
Much obliged sir!
@staabm, @RehanSaeed great, thanks for fixing this!
hopefully I can have a look at some of the open issues/PRs this friday and release a 1.15.2.
@staabm sounds good, thanks for your efforts!!
Most helpful comment
Of course we can do that but it's not what I expected. I asume a package contents are identical regardless the package is downloaded as zip, hotlinked from a CDN or installed via a package manager.
In this case I use npm to manage project dependencies, including jQuery Validation. The build process takes care of the project sources indeed, but only ours. Vendored assets are simply copied from the
node_modulesdirectory, then linked to a CDN (if any available) with local fallback. See an example:I try to avoid manually downloading and adding any packages to a repository especially if they are provided via a package manager.
A few more packages used:
dotdotdot,jquery,jquery.scrollto,slick-carousel. All of them provide a full distribution via npm - allowing us to access wanted resources with ease. That's how a dependency should work, you plug it in and it works, right?I agree this is more of a request than an issue but would help us (and others too) making use of npm packages more consistent. What do you think? Does it make any sense to you?