diff --git a/lib/services/livesync/playground/preview-app-plugins-service.ts b/lib/services/livesync/playground/preview-app-plugins-service.ts index 24fe97202c..41a2480cfd 100644 --- a/lib/services/livesync/playground/preview-app-plugins-service.ts +++ b/lib/services/livesync/playground/preview-app-plugins-service.ts @@ -33,15 +33,10 @@ export class PreviewAppPluginsService implements IPreviewAppPluginsService { public getExternalPlugins(device: Device): string[] { const devicePlugins = this.getDevicePlugins(device); const result = _.keys(devicePlugins) - .filter(plugin => plugin.indexOf("nativescript") !== -1) - // exclude angular and vue related dependencies as they do not contain - // any native code. In this way, we will read them from the bundle - // and improve the app startup time by not reading a lot of - // files from the file system instead. Also, the core theme links - // are custom and should be handled by us build time. - .filter(plugin => !_.includes(["nativescript-angular", "nativescript-vue", "nativescript-intl", "nativescript-theme-core"], plugin)); - - result.push(...["tns-core-modules", "tns-core-modules-widgets"]); + // The core theme links are custom and + // should be handled by webpack during build. + .filter(plugin => plugin !== "nativescript-theme-core"); + return result; } diff --git a/test/services/playground/preview-app-plugins-service.ts b/test/services/playground/preview-app-plugins-service.ts index 920fc6d699..1b21282909 100644 --- a/test/services/playground/preview-app-plugins-service.ts +++ b/test/services/playground/preview-app-plugins-service.ts @@ -415,55 +415,11 @@ describe("previewAppPluginsService", () => { }); }); describe("getExternalPlugins", () => { - const testCases = [ - { - name: "should return default plugins(`tns-core-modules` and `tns-core-modules-widgets`) when no plugins are provided", - plugins: {}, - expectedPlugins: ["tns-core-modules", "tns-core-modules-widgets"] - }, - { - name: "should exclude `nativescript-vue`", - plugins: { "nativescript-vue": "1.2.3" }, - expectedPlugins: ["tns-core-modules", "tns-core-modules-widgets"] - }, - { - name: "should exclude `nativescript-intl`", - plugins: { "nativescript-intl": "4.5.6" }, - expectedPlugins: ["tns-core-modules", "tns-core-modules-widgets"] - }, - { - name: "should exclude `nativescript-angular`", - plugins: { "nativescript-angular": "7.8.9" }, - expectedPlugins: ["tns-core-modules", "tns-core-modules-widgets"] - }, - { - name: "should exclude `nativescript-theme-core`", - plugins: { "nativescript-theme-core": "1.3.5" }, - expectedPlugins: ["tns-core-modules", "tns-core-modules-widgets"] - }, - { - name: "should return plugins that contain `nativescript` in their names", - plugins: { - "nativescript-facebook": "4.5.6" - }, - expectedPlugins: ["nativescript-facebook", "tns-core-modules", "tns-core-modules-widgets"] - }, - { - name: "should not return plugins that do not contain `nativescript` in their names", - plugins: { - lodash: "4.5.6", - xmlhttprequest: "1.2.3" - }, - expectedPlugins: ["tns-core-modules", "tns-core-modules-widgets"] - } - ]; - - _.each(testCases, testCase => { - it(`${testCase.name}`, () => { - const { previewAppPluginsService, device } = setup(testCase.plugins, testCase.plugins); - const actualPlugins = previewAppPluginsService.getExternalPlugins(device); - assert.deepEqual(actualPlugins, testCase.expectedPlugins); - }); + it("should exclude `nativescript-theme-core`", () => { + const plugins = { "nativescript-theme-core": "1.3.5" }; + const { previewAppPluginsService, device } = setup(plugins, plugins); + const actualPlugins = previewAppPluginsService.getExternalPlugins(device); + assert.notInclude(actualPlugins, "nativescript-theme-core"); }); }); });