Socket
Socket
Sign inDemoInstall

grunt-amd-namer

Package Overview
Dependencies
2
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    grunt-amd-namer

Name anonymous AMD modules using AST parsing


Version published
Weekly downloads
1
decreased by-66.67%
Maintainers
1
Install size
351 kB
Created
Weekly downloads
 

Readme

Source

grunt-amd-namer

Name anonymous AMD modules using AST parsing

Common Usage

This task is useful if you're using an AMD loader that requires modules to have explicit names (e.g. almond). This is especially useful if you're handling bundling yourself, as opposed to using r.js.

Output Example

input my-file.js

define(['a', 'b', 'c'], function(a, b, c) {
  console.log(a + b + c);
});

output my-file.js

define('my-file', ['a', 'b', 'c'], function(a, b, c) {
  console.log(a + b + c);
});

Getting Started

This plugin requires Grunt.

If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

npm install grunt-amd-namer --save-dev

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

grunt.loadNpmTasks('grunt-amd-namer');

The "amd_namer" Task

grunt.initConfig({
  amd_namer: {
    options: {
      baseUrl: 'dist/javascript'    
    },
    files: [
      {
        expand: true,
        cwd: 'src/javascript',
        src: ['**/*.js'],
        dest: 'dist/javascript'
      }
    ],
  },
})

Contributing

Feel free to open issues and send pull-requests.

Release History

  • 2015-09-07   v1.0.0   Must pass baseUrl option

License

Copyright (c) 2015 cowchimp. Licensed under the MIT license.

Keywords

FAQs

Last updated on 06 Sep 2015

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc