Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

grunt-amdwrap

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

grunt-amdwrap

A Grunt plugin for wrapping JS-modules written in AMD style

  • 0.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

grunt-amdwrap

A Grunt plugin for wrapping JS-modules written in AMD style

Wrap your AMD modules before concat with RequireJS

Wrapped AMD modules will have ids by local "define" wrappers

Getting Started

Install this grunt plugin next to your project's grunt.js gruntfile with: npm install grunt-amdwrap

Then add this line to your project's grunt.js gruntfile:

grunt.loadNpmTasks('grunt-amdwrap');

Documentation

grunt.initConfig({
    amdwrap: {
        libs: {
            options: { dir: 'libs' },
            files: [
                {
                    expand: true,
                    cwd: 'scripts/libs/',
                    src: [ '**/*.js' ],
                    dest: 'scripts/build/wrap/libs/',
                },
            ],
        },
        src: {
            files: [
                {
                    expand: true,
                    cwd: 'scripts/src/',
                    src: [ '**/*.js' ],
                    dest: 'scripts/build/wrap/',
                },
            ],
        },
    },
});

Wrapper code

;(function isolate() {

    function define() {
        var args = Array.prototype.slice.call(arguments, 0);
        if (typeof args[0] !== 'string') {
            args.unshift('%MODULE_ID%');
        }
        window.define.apply(this, args);
    }
    define.amd = { jQuery: true };

    // module contents

})();

Author

Viacheslav Lotsmanov

License

GNU/GPLv3 by Free Software Foundation

Keywords

FAQs

Package last updated on 29 Mar 2014

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc