Open jscharett opened 8 years ago
Currently all dependencies are required immediately in the main define
function of the hbs
module. The plugin configuration is not accessible there yet. That's why the config.hbs.handlebarsPath
setting, which gets applied during the build later in the module, affects only the compile phase.
Workarounds:
require.config()
.load
method of the plugin gets called. You will have access to config.hbs.handlebarsPath
then.completely new to this package and trying to upgrade the existing legacy code with below config,
require.config({ baseUrl: "./js", paths: { hbs: 'libraries/hbs/hbs', ...... }, hbs: { // optional helpers: true, // default: true i18n: false, // default: false templateExtension: 'tmpl', // default: 'hbs' partialsUrl: '', // default: '' },shim: { mxG: { exports: 'mxGraph', deps: ['mxGConfig', 'override'] }, jqueryactual: { exports: 'jqueryactual', deps: ['jquery-external'] }, uniform: { deps: ['jquery-external'] }, datatables: { deps: ['jquery-external'] }, toolbarRenderer: { deps: ['uniform'] }, menuManager: { deps: ['menu', 'menuItem'] }, renderManager: { deps: ['promise', 'canvasToBlob'] }, html2canvas: { exports: 'html2canvas' }, graphRenderer: { deps: ['jqueryactual'] }, canvg: { exports: 'canvg' }, filesaver: { exports: 'saveAs' }, handlebars: { exports: 'Handlebars' } }
and I need to upgrade the current hbs/hbs/handlebars.js -> v1.3.0 to v4.7.6
no luck with this approach, need your help for the same
Thanks in advance
Looking at the doc, it states that you can use 'handlebarsPath' to specify the path to a different version of handlebars. However, looking at the hbs plugin, it requires 'hbs/handlebars'. It only seems to use the handlebarsPath when compiling the templates. In order for me to truly use a different version of handlebars, I need to set of a path in my require.config to point to the new version. Would be nice if the plugin could handle this for me in some fashion, so I don't need to specify 2 paths to handlebars in my config.