2017-09-18 9 views
0

bower가 설치된 시스템을 설치했습니다. 내 웹 사이트에 성공적으로로드했지만 system-config.js에서 SystemJS가 정의되지 않은 실수를하게됩니다. 왜?bower_components에서 시스템을로드하십시오.

<script src="./bower_components/systemjs/build/system.min.js"></script> 
<script src="./scripts/system-config.js"></script> 

SystemJS.config({ 
    transpiler: 'plugin-babel', 
    map: { 
     //system transpiler 
     'plugin-babel': './bower_components/systemjs-plugin-babel/plugin-babel.js', 
     'systemjs-babel-build': './bower_components/systemjs-plugin-babel/systemjs-babel-browser.js', 

     //app scripts 
     'main': './scripts/main.js', 
     'requester': './scripts/requester.js', 
     'templates': './scripts/templates.js', 
     'data': './scripts/data.js', 

     //controllers 
     'home': '../controllers/home.js', 
     'login-form': '../controllers/login-form.js', 

     //js libraries 
     'jquery': './bower_components/jquery/dist/jquery.js', 
     'navigo': './bower_components/navigo/lib/navigo.min.js', 
     'handlebars': './bower_components/handlebars/dist/handlebars.js', 
    } 
}); 

SystemJS.import('./scripts/main.js').then(x => console.log(x), x => console.log(x)); 
+0

은 system-config.js를로드하는 태그 아래 또는 위에 게시 한 스크립트 태그입니까? –

+0

이 스크립트는 systemjs –

+0

을로드하고 system-config.js를 어디에서로드합니까? –

답변

1

오류를 재현 할 때도 같은 실수를했을 가능성이 큽니다. 이것은 당신이 찾고있는 라이브러리가 아닌

bower install systemjs 

:

당신은 명령을 SystemJS를 설치했습니다.

https://bower.io/search/으로 이동하여 systemjs를 검색하십시오. 첫 번째 패키지는 사용자의 시스템 정보를 가지고

JavaScript 개체를 찾을 수 있습니다.

실제 패키지는 설치 명령에 점을 추가 system.js하지 systemjs

솔루션

지정됩니다.

bower install system.js 
+1

감사합니다. 작동합니다. –