Demystifying JS: RequireJS & JS Components
Create RequireJS Aliases with map and paths
Free Preview
The "*" after map makes this alias available to all JavaScript components.

The format for aliases is:
"alias": "Namespace_Module/js/filename"

>> maps to >>

Paths can be used for non-AMD JavaScript modules & external files.

Be sure to not include the ".js" extension in any of these usages.
var config = {
    "map": {
        "*": {
            "fadeInElement": "Macademy_JsFun/js/fade-in-element"
    "paths": {
        "vue": ""
// After defining an alias, it can then be used when requiring dependencies.
require(['jquery', 'fadeInElement'], function($, fadeInElement) {
    'use strict'

    $(function() {
Want to learn more?

Visit to learn much more about Magento, Laravel, PHP, Javascript, & Docker. logo