Initial commit

This commit is contained in:
Alexander Zinn
2025-10-11 22:05:40 -03:00
commit 4182ab5ec0
8 changed files with 2206 additions and 0 deletions

3
.gitignore vendored Normal file
View File

@@ -0,0 +1,3 @@
.DS_Store
node_modules/

16
README.md Normal file
View File

@@ -0,0 +1,16 @@
# Basic RequireJS frontend demo
To run
```js
```
```
```
```
```
```js
npx http-server
```
```
```
```
```

15
index.html Normal file
View File

@@ -0,0 +1,15 @@
<!DOCTYPE html>
<html>
<header>
<title>demo-requirejs</title>
<!--
Placing the requirejs script load here will block rendering it can also be placed at the end of the
body with the 'async' attribute
-->
<script data-main="scripts/main" src="scripts/requirejs.js"></script>
</header>
<body>
<h1>RequireJS Frontend DEMO</h1>
</body>
</html>

7
scripts/app/Messages.js Normal file
View File

@@ -0,0 +1,7 @@
define(function() {
return {
getMessage: function() {
return 'Hello World';
}
};
});

5
scripts/app/main.js Normal file
View File

@@ -0,0 +1,5 @@
define(function(require) {
const messages = require('./Messages');
console.log(messages.getMessage());
});

6
scripts/main.js Normal file
View File

@@ -0,0 +1,6 @@
requirejs.config({
baseUrl: '../scripts/'
});
requirejs(["app/main"]);

2146
scripts/requirejs.js Normal file

File diff suppressed because it is too large Load Diff

8
scripts/utils/Names.js Normal file
View File

@@ -0,0 +1,8 @@
define(function() {
console.log('[Names] loaded');
return {
formatName: function (first, last) {
return `${first} ${last}`;
}
};
})