I am trying to adjust the processName but get three leading dots after applying declare.processNameByPath:
gulp.src(['../Packages/Application/Acme.Ui/Resources/Private/Scripts/Ember/Templates/**/*.hbs'])
.pipe(handlebars({ handlebars: require('ember-handlebars') }))
.pipe(wrap('Ember.Handlebars.template(<%= contents %>)'))
.pipe(declare({
namespace: 'Ember.TEMPLATES',
noRedeclare: true,
processName: function(filePath) {
// filePath is ``/Users/afoeder/PhpstormProjects/acme/Distribution/Packages/Application/Acme.Ui/Resources/Private/Scripts/Ember/Templates/Login.js``
// declare.processNameByPath(filePath) is ``...Packages.Application.Wishbase.Ui.Resources.Private.Scripts.Ember.Templates.Login.``
return declare.processNameByPath(filePath.replace('Packages/Application/Wishbase.Ui/Resources/Private/Scripts/Ember/Templates/', ''));
// this, however, will still return ``...Login``
}
}))
The location of the gulpfile is at /Users/afoeder/PhpstormProjects/acme/Distribution/Build/, is this maybe the reason why some relative path determinition doesn't work well?
Hey @afoeder, I agree declare.processNameByPath() should handle this case. In the mean time, you can remove the ../ from the path in your replace() and things should behave as expected.
I am trying to adjust the
processName
but get three leading dots after applyingdeclare.processNameByPath
:The location of the gulpfile is at
/Users/afoeder/PhpstormProjects/acme/Distribution/Build/
, is this maybe the reason why some relative path determinition doesn't work well?Thanks for your support!