
Security News
CVE Volume Surges Past 48,000 in 2025 as WordPress Plugin Ecosystem Drives Growth
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.
grunt-amd-wrap
Advanced tools
Grunt task to wrap CommonJS files in `define(function (require, exports, module) { ... })`.
This is a Grunt plugin to wrap your CommonJS modules into the simplified CommonJS wrapper format, i.e.:
define(function (require, exports, module) {
// your CommonJS code here
});
It's based on amd-wrap, if you want this functionality outside of a Grunt plugin.
It doesn't take any options. You just configure it to map each source file to a destination file, and you end up with some wrapped-up-as-AMD modules. I'll give a few examples here, each under a different build target:
grunt.loadNpmTasks("grunt-amd-wrap");
grunt.initConfig({
amdwrap: {
onlyOneFile: {
{ src: "lib/my-module.js", dest: "artifacts/amd/my-module.js" }
},
aFewFilesManually: {
{ src: "lib/my-module.js", dest: "artifacts/amd/my-module.js" },
{ src: "lib/helper-module.js", dest: "artifacts/amd/helper-module.js" }
},
usingDynamicExpansion: {
expand: true,
cwd: "lib/",
src: ["*.js"],
dest: "artifacts/amd/"
}
}
});
You'll probably want to use the last pattern most of the time. It's based on Grunt's dynamic mapping expansion feature.
FAQs
Grunt task to wrap CommonJS files in `define(function (require, exports, module) { ... })`.
We found that grunt-amd-wrap demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.

Security News
Socket CEO Feross Aboukhadijeh joins Insecure Agents to discuss CVE remediation and why supply chain attacks require a different security approach.

Security News
Tailwind Labs laid off 75% of its engineering team after revenue dropped 80%, as LLMs redirect traffic away from documentation where developers discover paid products.