-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmixed.html
75 lines (70 loc) · 4 KB
/
mixed.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, shrink-to-fit=no, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<title>RequireJS</title>
</head>
<body>
<div id="wrapper">
<!-- Sidebar -->
<div id="sidebar-wrapper"></div>
<!-- /#sidebar-wrapper -->
<!-- Page Content -->
<div id="page-content-wrapper">
<div class="container-fluid">
<div class="row">
<div class="col-lg-12">
<h1>Simple + Free Style + Lazy Load</h1>
<p>This page contains the files that have mixed AMD definition types which are loaded on demand</p>
<div class="module-container"></div>
<h3>Configuration:</h3>
<pre><code class="language-javascript">
requirejs.config({
paths: {
"Block": 'mixed/block',
"jquery": "../../node_modules/jquery/dist/jquery",
"bootstrap": "../../node_modules/bootstrap/dist/js/bootstrap",
"prism": "../../node_modules/prismjs/prism",
"prism-remove-whitespace": "../../node_modules/prismjs/plugins/normalize-whitespace/prism-normalize-whitespace"
},
// map is equivalent to resolve.alias and resolveLoader.alias of Webpack
// if can map original and alias names for specific/all modules/packages/files.
map: {
// '*' imiplies all modules/packages
// Hence these can be placed in paths as well
// This was is just for showcasing
'*': {
"text": "/node_modules/text/text.js", // npm install requirejs/text --save,
"css": "/node_modules/require-css/css.js", // npm install require-css --save,
}
},
});
require([
// 'bootstrap', // Just for testing. Any module can call it before using
"prism",
"prism-remove-whitespace",
"css!/node_modules/prismjs/themes/prism-coy",
"css!../stylesheets/simple-sidebar", // better load CSS in traditional way to avoid FOUC (Flash of Unstyled Content)
"css!/node_modules/bootstrap/dist/css/bootstrap.min",
'mixed/child',
'mixed/sidebar/initSidebar',
], function() {
// Known bug for prism: https://github.com/PrismJS/prism/issues/903
Prism.highlightAll();
});
</code></pre>
<a href="#menu-toggle" class="btn btn-default" id="menu-toggle">Toggle Menu</a>
</div>
</div>
</div>
</div>
<!-- /#page-content-wrapper -->
</div>
<!-- /#wrapper -->
<script src="node_modules/requirejs/require.js" data-main="public/app/app-mixed"></script>
</body>
</html>