From 5c69875d8cfc9f0d0fa9ed40960403155b09d14a Mon Sep 17 00:00:00 2001 From: sis0k0 Date: Mon, 18 Jun 2018 10:37:14 +0300 Subject: [PATCH] fix: register UI modules in NG apps This is required, because there may be plugins that use the tns-core-modules builder. fixes https://github.com/NativeScript/nativescript-dev-webpack/issues/561 --- bundle-config-loader.js | 5 +++++ register-modules.js | 1 - 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/bundle-config-loader.js b/bundle-config-loader.js index fdcf668f..f17c3e2d 100644 --- a/bundle-config-loader.js +++ b/bundle-config-loader.js @@ -2,6 +2,11 @@ module.exports = function(source) { this.cacheable(); const { angular = false, loadCss = true } = this.query; + source = ` + require("tns-core-modules/bundle-entry-points"); + ${source} + `; + if (!angular) { source = ` require("nativescript-dev-webpack/register-modules"); diff --git a/register-modules.js b/register-modules.js index e96e409e..d6fccab1 100644 --- a/register-modules.js +++ b/register-modules.js @@ -1,4 +1,3 @@ -require("tns-core-modules/bundle-entry-points"); const context = require.context("~/", true, /(root|page)\.(xml|css|js|ts|scss)$/); global.registerWebpackModules(context);