SlexAxton / require-handlebars-plugin

A plugin for handlebars in require.js (both in dev and build)
803 stars 202 forks source link

r.js build fails when multiple modules are defined in app.build.js #100

Open adrianpcap opened 11 years ago

adrianpcap commented 11 years ago

I just updated require-handlebars to commit d008b94087290e3b2fd8d9d and it works fine when using client-side require. But when I try to optimize using r.js with the following config:

({ // scripts dir that needs to be optimized baseUrl: "../scripts" // location of scripts dir to be copied after optimization , dir: "../bin/scripts" //JS file configuration to be read for the build , mainConfigFile: '../scripts/require_config.js' , modules: [ { name: 'main' } , { name: 'mainEnrollment' } , { name: 'advisorModule' , exclude:[ 'jquery' , 'underscore' , 'backbone' , 'services' , 'hbs' ] } , { name: 'mainPFA' } ] // remove files that have been combined during optimization , removeCombined: true , optimizeCss: 'none' , waitSeconds: 30 //to exclude the compiler code during the save phase. , pragmasOnSave : { //removes Handlebars.Parser code (used to compile template strings) set //it to false if you need to parse template strings even after build excludeHbsParser: true // kills the entire plugin set once it's built. , excludeHbs: true //remove the i18n compile, underscore and json2 , excludeAfterBuild: true } })

I get the following error:

Tracing dependencies for: main

Tracing dependencies for: mainEnrollment Error: ENOENT, no such file or directory '../bin/scripts/templates/emailForm.html' In module tree: mainEnrollment routers/routerEnrollment views/modules/enrollment views/modal-windows/emailFormEnrollment hbs

Error: ENOENT, no such file or directory '../bin/scripts/templates/emailForm.html' In module tree: mainEnrollment routers/routerEnrollment views/modules/enrollment views/modal-windows/emailFormEnrollment hbs

at Object.fs.openSync (fs.js:338:18)

If I only compile one module it works fine.

pchea commented 11 years ago

try removeCombined: false. r.js might be delete files that are combined in one module but was used by another module.