Skip to content
This repository was archived by the owner on Aug 7, 2021. It is now read-only.

fix: run tns-xml-loader before @ngtools loader #66

Merged
merged 1 commit into from
Feb 8, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion tns-xml-loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,10 @@ function getTemplateSource(path, source) {
return source;
} else if (isComponent(path)) {
const templateMatcher = /template\s*:\s*([`'"])((.|\n)*?)\1/;
return templateMatcher.test(source) ? source.replace(templateMatcher, "$2") : "";
let match = templateMatcher.exec(source);

return match ? match[2] : "";

} else {
throw new Error(`The NativeScript XML loader must be used with HTML, XML or TypeScript files`);
}
Expand Down
2 changes: 1 addition & 1 deletion webpack.common.js.angular.template
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,9 @@ module.exports = function (platform, destinationApp) {
{
test: /\.ts$/,
loaders: [
"nativescript-dev-webpack/tns-xml-loader",
"nativescript-dev-webpack/tns-aot-loader",
"@ngtools/webpack",
"nativescript-dev-webpack/tns-xml-loader",
]
},
// SASS support
Expand Down