Hi,
I created a stache helper to import dinamically componentes. It works perfect in development, but it fails in production. The console displays this message:
Error loading “baker@0.0.0#quotation/quotation.stache!can@2.3.27#view/stache/system” from “baker@0.0.0#quotation/quotation” at file:/home/goyo/Documents/Clientes/Prana/Baker/development/baker/src/quotation/quotation.js
addBundles is not a function
The file calling this function is can/view/stache/system.js:
function translate(load) {
var intermediateAndImports = getIntermediateAndImports(load.source);
// Add bundle configuration for these dynamic imports
return addBundles(intermediateAndImports.dynamicImports, load.name).then(function(){
intermediateAndImports.imports.unshift("can/view/stache/mustache_core");
intermediateAndImports.imports.unshift("can/view/stache/stache");
intermediateAndImports.imports.unshift("module");
return template(intermediateAndImports.imports,
intermediateAndImports.intermediate);
});
}
Thats my helper (component hardcoded just for the example):
stache.registerHelper("importComponent", function(options){
var template =
"<can-import from='baker/quotation/' can-tag='baker-loading'>" +
"<baker-quotation/>" +
"</can-import>";
return stache(template)(this, options.helpers, options.nodeList);
});
And in the stache file im calling:
{{{importComponent}}}
In development mode everything works fine, but fails in production. The build process is completed succesfully, without error or warnings messages.
Have no idea why its failing. Any help would be really appreciated, thanks!