📜 ⬆️ ⬇️

In jQuery since version 1.8, you can exclude some modules

In particular, ajax, css, dimensions, effects, offset modules. The news has already appeared long ago. A commit with the announcement of this opportunity on github-e appeared even on June 7.
Not so often, but I met a dispute about the size and unnecessary functionality, and I myself would have liked to exclude modules for some projects. I hope the opportunity to exclude modules will appear on the popular CDN. How it can be collected - under the cut or on github-e .

Installation


git clone git://github.com/jquery/jquery.git cd jquery && npm install 

Grunt is checked like this:
 node_modules/grunt/bin/grunt -version 

and not like on the official manual:
 grunt -version 

Build


For convenience, a special alias custom has been added, although you can also use build :
 node_modules/grunt/bin/grunt custom:<modules> 

 node_modules/grunt/bin/grunt build:*:*:<modules> 

Exclude the ajax module:
 node_modules/grunt/bin/grunt custom:-ajax 

Exclude the css module:
 node_modules/grunt/bin/grunt custom:-css 

Exclude all valid modules:
 node_modules/grunt/bin/grunt custom:-ajax,-css,-dimensions,-effects,-offset 

True, it was not possible to build jquery without any modules available to exclude to compare file sizes. Through custom it does not build at all, but through build it writes “Excluding”, but it collects completely with all modules. Or maybe I did not succeed.

')

Source: https://habr.com/ru/post/145810/


All Articles