현재 재미있는 프로젝트를 위해 require.js를 사용하고 있습니다. prism.js라는 코드 구문 하이라이팅 플러그인을 제외한 모든 것이 올바르게 작동하고 있습니다. 플러그인이 네트워크 탭을 통해 Chrome에서 가져 왔지만 플러그인이 초기화되지 않고 있음을 알 수 있습니다.require.js로 비 amd 모듈로드하기
문제가 있거나 플러그인이 문제인지 궁금한 점이 있으시면 도움을받을 수 있는지 궁금합니다.
이require.config({
// 3rd party script alias names
paths: {
// Core Libraries
modernizr: "libs/modernizr",
jquery: "libs/jquery",
underscore: "libs/lodash",
backbone: "libs/backbone",
handlebars: "libs/handlebars",
text: "libs/text",
prism: "plugins/prism",
templates: "../templates"
},
// Sets the configuration for your third party scripts that are not AMD compatible
shim: {
"backbone": {
"deps": ["underscore", "jquery", "handlebars"],
"exports": "Backbone" //attaches "Backbone" to the window object
}
}
});
// Include Specific JavaScript
require(['prism', 'modernizr', 'jquery', 'backbone', 'routers/router', 'views/AppVIew' ],
function(Prism, Modernizr, $, Backbone, Router, App) {
this.router = new Router();
this.App = new App();
}
);
"shimmed"가되면 어떻게 사용할 수 있습니까? –
다른 모듈과 마찬가지로 :'require ('prism');'또는'define'에 대한 인수에 의존성을 포함시킵니다. –