{"id":19281248,"url":"https://github.com/zouloux/amd-lite","last_synced_at":"2025-04-22T01:30:56.536Z","repository":{"id":57177186,"uuid":"108413373","full_name":"zouloux/amd-lite","owner":"zouloux","description":"Minimal AMD / RequireJS implementation. No plugins, no loaders, only module resolving.","archived":false,"fork":false,"pushed_at":"2017-10-26T15:10:31.000Z","size":13,"stargazers_count":3,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-01T17:53:18.821Z","etag":null,"topics":["amd","api","implementation","lite","minimal","require","requirejs","solid","solid-js","solidify","solidjs","typescript"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zouloux.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-10-26T13:12:59.000Z","updated_at":"2020-01-10T17:24:17.000Z","dependencies_parsed_at":"2022-09-14T02:21:35.670Z","dependency_job_id":null,"html_url":"https://github.com/zouloux/amd-lite","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zouloux%2Famd-lite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zouloux%2Famd-lite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zouloux%2Famd-lite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zouloux%2Famd-lite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zouloux","download_url":"https://codeload.github.com/zouloux/amd-lite/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250161939,"owners_count":21385012,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["amd","api","implementation","lite","minimal","require","requirejs","solid","solid-js","solidify","solidjs","typescript"],"created_at":"2024-11-09T21:22:07.790Z","updated_at":"2025-04-22T01:30:56.178Z","avatar_url":"https://github.com/zouloux.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AmdLite\n\nMinimal AMD / RequireJS implementation.\n**No plugins, no loaders, only module resolving.**\n\nAMD modules in the browser for less than 4KB !\n\n# Why ?\n\nAMD modules are not simple to use, RequireJS and r.js api are heavy and complex. \nAmdLite is here to offer modular JS in the browser with a minimal footprint and without configuration complexity.\n\n\n### This script is for you if : \n- You want modular JS in your browser.\n- You want to avoid loading libraries one at a time (HTTP2 push where are you?) for loading time optimization.\n- You don't want to include the huge require.js file in your javascript. \n- You have a compiler (let say Typescript) which can prepare AMD modules for you.\n- You don't need AMD plugins or RequireJS's library dynamic loading feature.\n- You want advanced resources management like code-splitting and dependency injection.\n\n\n# Usage\n\nInclude the [amdLite.js](amdLite.js) or [amdLite.min.js](amdLite.min.js) file in your bundle.\nYou can insert it at any level of your bundle because unless like RequireJS, this is not polluting global scope with require and define methods automatically.\n\nCreate a config file (here is an example : [amdLite.config.js](amdLite.config.js)).\nInclude this config file after not optimized libraries, but before optimized ones.\n\n`amdLite` will be injected into the global scope. This will be the public API if you want to use advanced features.\nTake a look at [amdLite.js](amdLite.js) to see how it works.\n\n\n# Optimization\n\nAmdLite **is only compatible** with optimized libraries.\n\nAn optimized module is a module with its path in the `define` statement :\n- Not optimized : `define(['require', 'exports', 'react'], function () {...});`\n- Optimized : `define('path/to/Module', ['require', 'exports', 'react'], function () {...});`\n\nNot optimized modules are meant to be optimized with r.js (or the simpler [grunt-amd-compile](https://github.com/zouloux/grunt-amd-compile)).\nThey also can be loaded dynamically with XHR requests but this is not possible with amtLite, on purpose.\n\n\n# Tested libraries\n\nWe tested with compiled code from Typescript for AMD modules.\nThose modules were optimised with [grunt-amd-compile](https://github.com/zouloux/grunt-amd-compile)\nTested code was using these libraries as dependencies :\n- gsap@1.20.3 (as global, mapped from 'GreenSockGlobals' to 'gsap', thanks to 'namespaces' amdLite option)\n- jquery@3.2.1 (as global)\n- pixi.js@4.5.6 (as global)\n- react@16.0.0 (not optimized, with require from global, thanks to 'globalDependencies' amdLite option)\n- react-dom@16.0.0 (not optimized, with require from global, thanks to 'globalDependencies' amdLite option)\n- three@0.87.1 (not optimized, with require from global, thanks to 'globalDependencies' amdLite option)\n\n\n# Links\n\n- Read this really good article about modular JS : https://addyosmani.com/writing-modular-js/\n- [Solid JS framework](https://github.com/solid-js/web-base) is a Typescript framework using AmdLite\n- [grunt-amd-compile](https://github.com/zouloux/grunt-amd-compile) is an ultra simple AMD optimizer, used in Solid JS \n- [Almond](https://github.com/requirejs/almond) is the main inspiration for this script.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzouloux%2Famd-lite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzouloux%2Famd-lite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzouloux%2Famd-lite/lists"}