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

Commit

Permalink
feat(xml-namespace-loader): add ignore option (#605)
Browse files Browse the repository at this point in the history
With the ignore option user can exclude any local fragments and register them either manually or by using the registerModules regex option for the bundle-config-loader

Closes #558.
  • Loading branch information
PeterStaev authored and sis0k0 committed Jul 23, 2018
1 parent bfecb8c commit b509bb3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion xml-namespace-loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const { convertSlashesInPath } = require("./projectHelpers");

module.exports = function (source) {
this.value = source;
const { ignore } = this.query;

const { XmlParser } = require("tns-core-modules/xml");

Expand All @@ -14,7 +15,8 @@ module.exports = function (source) {
if (
namespace &&
!namespace.startsWith("http") &&
!namespaces.some(n => n.name === moduleName)
!namespaces.some(n => n.name === moduleName) &&
(!ignore || !moduleName.match(ignore))
) {
const localNamespacePath = join(this.rootContext, namespace);
const localModulePath = join(localNamespacePath, elementName);
Expand Down

0 comments on commit b509bb3

Please sign in to comment.