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

Commit

Permalink
fix: run tns-xml-loader before @ngtools loader (#66)
Browse files Browse the repository at this point in the history
This is needed due to changes in the behaviour of `@ngtools/webpack` v1.2.4

fixes #64
  • Loading branch information
sis0k0 authored Feb 8, 2017
1 parent 8426b33 commit 325cb90
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
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

0 comments on commit 325cb90

Please sign in to comment.