Skip to content

Commit 4db3e59

Browse files
authored
Merge pull request #5091 from NativeScript/kddimitrov/exclude-scoped-theme-from-external-plugins
fix: exclude scoped theame from external plugins
2 parents 79b58a8 + 6b59f7a commit 4db3e59

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

lib/constants.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ export const NATIVESCRIPT_KEY_NAME = "nativescript";
1010
export const NODE_MODULES_FOLDER_NAME = "node_modules";
1111
export const TNS_MODULES_FOLDER_NAME = "tns_modules";
1212
export const TNS_CORE_MODULES_NAME = "tns-core-modules";
13+
export const TNS_CORE_THEME_NAME = "nativescript-theme-core";
14+
export const SCOPED_TNS_CORE_THEME_NAME = "@nativescript/theme";
1315
export const WEBPACK_PLUGIN_NAME = "nativescript-dev-webpack";
1416
export const TNS_CORE_MODULES_WIDGETS_NAME = "tns-core-modules-widgets";
1517
export const TNS_ANDROID_RUNTIME_NAME = "tns-android";

lib/services/livesync/playground/preview-app-plugins-service.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import * as util from "util";
44
import { Device } from "nativescript-preview-sdk";
55
import { PluginComparisonMessages } from "./preview-app-constants";
66
import { NODE_MODULES_DIR_NAME } from "../../../common/constants";
7-
import { PLATFORMS_DIR_NAME, PACKAGE_JSON_FILE_NAME } from "../../../constants";
7+
import { PLATFORMS_DIR_NAME, PACKAGE_JSON_FILE_NAME, TNS_CORE_THEME_NAME, SCOPED_TNS_CORE_THEME_NAME } from "../../../constants";
88

99
export class PreviewAppPluginsService implements IPreviewAppPluginsService {
1010
constructor(private $errors: IErrors,
@@ -41,10 +41,11 @@ export class PreviewAppPluginsService implements IPreviewAppPluginsService {
4141

4242
public getExternalPlugins(device: Device): string[] {
4343
const devicePlugins = this.getDevicePlugins(device);
44+
const themeNamesArray = [TNS_CORE_THEME_NAME, SCOPED_TNS_CORE_THEME_NAME];
4445
const result = _.keys(devicePlugins)
4546
// The core theme links are custom and
4647
// should be handled by webpack during build.
47-
.filter(plugin => plugin !== "nativescript-theme-core");
48+
.filter(plugin => themeNamesArray.indexOf(plugin) === -1);
4849

4950
return result;
5051
}

0 commit comments

Comments
 (0)