3
SystemJSでjQueryをプロジェクトにインポートする方法を理解できません。 のindex.html:SystemJSでjqueryをインポートできません
...
<script>
System.import('app').catch(function(err){ console.error(err); });
System.import('jquery').catch(function(err){ console.error(err); });
System.import('bootstrap').catch(function(err){ console.error(err); });
</script>
...
エラー:
(インデックス):26エラー:(SystemJS)ブートストラップのJavaScriptは、jQueryの エラーが必要です。ブートストラップのJavaScriptはevalを
systemjs.configでのjQuery が必要です。 js
(function (global) {
System.config({
paths: {
// paths serve as alias
'npm:': 'node_modules/'
},
// map tells the System loader where to look for things
map: {
// our app is within the app folder
app: 'app',
// angular bundles
...
'jquery': "npm:jquery/dist/jquery.min.js",
'bootstrap': "npm:bootstrap/dist/js/bootstrap.min.js",
// other libraries
'rxjs': 'npm:rxjs'
},
// packages tells the System loader how to load when no filename and/or no extension
packages: {
app: {
main: './main.js',
defaultExtension: 'js'
},
rxjs: {
defaultExtension: 'js'
}
}
});
})(this);
SystemJSを使用している場合は、JSPMにも行く必要があります。手動でSystemJSファイルを設定することは避けます... –