requirejs-npm
v0.0.2
Published
default use https://unpkg.com
Downloads
2
Readme
requirejs-npm
useage
default use https://unpkg.com
<!DOCTYPE html>
<html lang="zh-Hans">
<body>
<div id="app">{{hello}}</div>
<script src="https://unpkg.com/requirejs"></script>
<script>
requirejs.config({
paths:{
npm:"https://unpkg.com/requirejs-npm/dist/requirejs-npm.js"
}
});
require(["npm!vue"],function(Vue){
new Vue({
el:"#app",
data(){
return {
hello:'hello world!'
}
}
});
})
</script>
</body>
</html>
use jsdelivr.com
<!DOCTYPE html>
<html lang="zh-Hans">
<body>
<div id="app">{{hello}}</div>
<script src="https://unpkg.com/requirejs"></script>
<script>
requirejs.config({
paths:{
npm:"https://unpkg.com/requirejs-npm/dist/requirejs-npm.js"
},
config:{
npm:{
host:"https://cdn.jsdelivr.net"
}
}
});
require(["npm!vue/latest"],function(Vue){
new Vue({
el:"#app",
data(){
return {
hello:'hello world!'
}
}
});
})
</script>
</body>
</html>