Skip to content
This repository was archived by the owner on Sep 11, 2025. It is now read-only.

Commit a726e1a

Browse files
committed
v0.1.0 - Add AMD format.
1 parent 01d0d46 commit a726e1a

16 files changed

+312
-74
lines changed

.npmignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
/dist/t*
44
/node_modules/
55
/sources/t*
6+
/test/
67
/.gitignore
78
/.npmignore
89
/tsconfig.json

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,11 @@ Simple browser module loader.
1616

1717
## Features
1818

19+
- [x] The configuration is simple and lightweight.
1920
- [x] No intrusion and does not affect the script label.
2021
- [x] Node modules that support the CommonJS format.
21-
- [x] The configuration is simple and lightweight.
22+
- [x] Modules that support AMD format.
23+
- [x] The fetch function is automatically supported without additional loading.
2224

2325
## Installation
2426

@@ -60,11 +62,13 @@ Here's a general how to use it:
6062

6163
```javascript
6264
// Adding a map does not require a "js" extension.
63-
loader.setModulePaths({
65+
loader.setPaths({
6466
"module": "https://xxx/xxx/index",
6567
"module2": "../abc/in"
6668
});
67-
loader.addModulePath("module3", "./en");
69+
loader.addPath("module3", "./en");
70+
// You can append strings after a file, for example, to prevent caching.
71+
loader.setAfter("?" + Math.random());
6872
// All actions are written in the "ready" callback.
6973
loader.ready(function() {
7074
loader.require(["../dist/tmodule", "module2"], function(t1, t2) {

dist/index.js

Lines changed: 104 additions & 24 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)