简体   繁体   中英

How does jQuery's gruntfile concatenate amd modules

I have been looking at gruntfiles and had some great success. I wanted to see how the likes of jQuery use grunt to build their dist code base.

After picking apart the code here https://github.com/jquery/jquery/blob/master/Gruntfile.js

I can see they have many different tasks, most of which I am not too interested in, However I am interested in how they concatenate and remove the amd define rules. I can sort of see this is where the build/tasks come in with a lot of regex.

Basically my question is, is there a blog post or a well annotated source or something that can shed some light on their build process?

The jquery build is quite complicated and custom however I managed to follow and figure it out for the most part.

Firstly the main Gruntfile.js sets up a bunch of build tasks in seperate directory here: build/tasks/

By going through these you can see the steps it takes in removing each modules AMD modules and concatenating together.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM