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

Commit 325cb90

Browse files
authored
fix: run tns-xml-loader before @ngtools loader (#66)
This is needed due to changes in the behaviour of `@ngtools/webpack` v1.2.4 fixes #64
1 parent 8426b33 commit 325cb90

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

Diff for: tns-xml-loader.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,10 @@ function getTemplateSource(path, source) {
6161
return source;
6262
} else if (isComponent(path)) {
6363
const templateMatcher = /template\s*:\s*([`'"])((.|\n)*?)\1/;
64-
return templateMatcher.test(source) ? source.replace(templateMatcher, "$2") : "";
64+
let match = templateMatcher.exec(source);
65+
66+
return match ? match[2] : "";
67+
6568
} else {
6669
throw new Error(`The NativeScript XML loader must be used with HTML, XML or TypeScript files`);
6770
}

Diff for: webpack.common.js.angular.template

+1-1
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,9 @@ module.exports = function (platform, destinationApp) {
135135
{
136136
test: /\.ts$/,
137137
loaders: [
138-
"nativescript-dev-webpack/tns-xml-loader",
139138
"nativescript-dev-webpack/tns-aot-loader",
140139
"@ngtools/webpack",
140+
"nativescript-dev-webpack/tns-xml-loader",
141141
]
142142
},
143143
// SASS support

0 commit comments

Comments
 (0)