Browserify relative template paths#35
Browserify relative template paths#35michaelknoch wants to merge 2 commits intoionic-team:masterfrom
Conversation
| .plugin(tsify, options.tsifyOptions) | ||
| .transform(function (file) { | ||
| return through(function (buf, enc, next) { | ||
| ng2TemplateParser({contents: buf, path: file}, { |
There was a problem hiding this comment.
Maybe you can inherit options? That way ng2TemplateParser can use target or we can change base options
|
After having tested it there's one problem, watching the html to run the build doesn't work correctly, the build is done but the transform isn't applied, so we don't see any changes, the only thing that work is to reload the build. |
|
yes, you are right @Yimiprod. |
|
Tried something that "almost" work: var b = browserify(options.src, options.browserifyOptions)
.plugin(tsify, options.tsifyOptions);
if (options.watch) {
watchify(b, options.watchifyOptions);
b.on('update', bundle);
b.on('log', options.onLog);
}
b.transform(function(file) {
return through(function (buf, enc, next) {
ng2TemplateParser({contents: buf, path: file}, options.browserifyOptions)((err, result) => {
this.push(result);
process.nextTick(next);
});
});
});That way, if we change the template, it not trigger rebuild BUT if we change the controller who call that template, the build is correctly done. |
Implement relative url to inline html transformation in browserify gulp task.
This adds the possibility to use relative template urls.