How to convert BpmnViewer custom bower to BpmnModeler so we can use element template?

index.js

var BpmnViewer = require('bpmn-js/lib/Modeler');

var camundaModdleDescriptor = require('camunda-bpmn-moddle/resources/camunda');

var additionalModules = [
  require('bpmn-js-properties-panel'),

  // 1. require camunda provider instead of the bpmn one (!)
  require('bpmn-js-properties-panel/lib/provider/camunda')
];

BpmnViewer.prototype._modules = BpmnViewer.prototype._modules.concat(additionalModules);

// 2. include camunda moddle descriptor
BpmnViewer.prototype._moddleExtensions = { camunda: camundaModdleDescriptor }

module.exports = BpmnViewer;

Duplicate of this topic? Please do not double post. Refine your original question instead.