While requirejs
is capable of using npm-installed modules, how do I use requirejs
in first place if itself is installed via npm install requirejs
?
I have read examples of using requirejs
listed in the example-section. They all seems to assume require.js
is downloaded into a specific location. Since the documentation specifically said
do not do something like require("./node_modules/foo/foo").
I guess it is not right to put in index.html
something like:
<html>
<head>
<script data-main="scripts" src="node_modules/requirejs/require.js"></script>
</head>
<body>
<h1>Hello World</h1>
</body>
</html>
What is the recommended way to use requirejs if it is npm-installed? If I missed something from the documentation please let me know. Thank you
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…