1
내 프로젝트에서 RequireJS 노드를 실행하려고 할 때마다 문제가 발생합니다. 이건 내 build.js 파일coffeescript가 필요한 JJ 최적화 도구
-root
-/src
-App.coffee
-/static
-/vendor
-/plugin
-r.js
-coffee-script.js
-/lib
-jquery.js
-main.js
-build.js
입니다 :
({
appDir : './',
baseUrl : './static/js/',
dir : '../public',
optimize : 'uglify',
exclude : ['coffee-script'],
stubModules : ['cs'],
paths: {
// Libraries
'modernizr' : 'vendor/modernizr',
'jquery' : ['//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min', 'vendor/jquery'],
'jqueryui' : 'vendor/jquery-ui',
'backbone' : 'vendor/backbone',
'underscore' : 'vendor/underscore',
// Plugins
'plugin' : 'plugin/plugin',
// RequireJS
'cs' : 'plugin/cs',
'coffee-script' : 'plugin/coffee-script'
},
shim: {
'jqueryui' : ['jquery'],
'underscore': {
exports: '_'
},
'backbone': {
deps: ['underscore', 'jquery'],
exports: 'Backbone'
}
},
modules: [{
name: "main"
}]
})
이 마지막이 내 main.js 파일입니다
require({
baseUrl : '../../src/',
paths: {
cs: '../../cs',
'coffee-script': '../../coffee-script'
}
}, ['cs!App']);
I
이 내 폴더 구조 잘못된 경로 설정과 관련하여 항상 오류가 발생하며 잘못된 위치를 파악할 수 없습니다.
감사합니다.