fix: handle appComponents (closes #9126)

This commit is contained in:
Igor Randjelovic
2021-03-02 20:11:47 +01:00
parent 43dc99784a
commit 73e97116d5
8 changed files with 39 additions and 14 deletions

View File

@ -259,7 +259,9 @@ exports[`angular configuration for android 1`] = `
entry: {
bundle: [
'@nativescript/core/globals/index.js',
'__jest__/src/app.js'
'__jest__/src/app.js',
'@nativescript/core/ui/frame',
'@nativescript/core/ui/frame/activity'
]
}
}"
@ -526,7 +528,7 @@ exports[`angular configuration for ios 1`] = `
'@nativescript/core/globals/index.js',
'__jest__/src/app.js'
],
'tns_modules/@nativescript/core/inspector_modules': [
'tns_modules/inspector_modules': [
'@nativescript/core/inspector_modules'
]
}

View File

@ -247,7 +247,9 @@ exports[`base configuration for android 1`] = `
entry: {
bundle: [
'@nativescript/core/globals/index.js',
'__jest__/src/app.js'
'__jest__/src/app.js',
'@nativescript/core/ui/frame',
'@nativescript/core/ui/frame/activity'
]
}
}"
@ -502,7 +504,7 @@ exports[`base configuration for ios 1`] = `
'@nativescript/core/globals/index.js',
'__jest__/src/app.js'
],
'tns_modules/@nativescript/core/inspector_modules': [
'tns_modules/inspector_modules': [
'@nativescript/core/inspector_modules'
]
}

View File

@ -269,6 +269,8 @@ exports[`javascript configuration for android 1`] = `
bundle: [
'@nativescript/core/globals/index.js',
'__jest__/src/app.js',
'@nativescript/core/ui/frame',
'@nativescript/core/ui/frame/activity',
'__jest__/src/__virtual_entry__.js'
]
}
@ -546,7 +548,7 @@ exports[`javascript configuration for ios 1`] = `
'__jest__/src/app.js',
'__jest__/src/__virtual_entry__.js'
],
'tns_modules/@nativescript/core/inspector_modules': [
'tns_modules/inspector_modules': [
'@nativescript/core/inspector_modules'
]
}

View File

@ -275,7 +275,9 @@ exports[`react configuration > android > adds ReactRefreshWebpackPlugin when HMR
entry: {
bundle: [
'@nativescript/core/globals/index.js',
'__jest__/src/app.js'
'__jest__/src/app.js',
'@nativescript/core/ui/frame',
'@nativescript/core/ui/frame/activity'
]
}
}"
@ -534,7 +536,9 @@ exports[`react configuration > android > base config 1`] = `
entry: {
bundle: [
'@nativescript/core/globals/index.js',
'__jest__/src/app.js'
'__jest__/src/app.js',
'@nativescript/core/ui/frame',
'@nativescript/core/ui/frame/activity'
]
}
}"
@ -817,7 +821,7 @@ exports[`react configuration > ios > adds ReactRefreshWebpackPlugin when HMR ena
'@nativescript/core/globals/index.js',
'__jest__/src/app.js'
],
'tns_modules/@nativescript/core/inspector_modules': [
'tns_modules/inspector_modules': [
'@nativescript/core/inspector_modules'
]
}
@ -1079,7 +1083,7 @@ exports[`react configuration > ios > base config 1`] = `
'@nativescript/core/globals/index.js',
'__jest__/src/app.js'
],
'tns_modules/@nativescript/core/inspector_modules': [
'tns_modules/inspector_modules': [
'@nativescript/core/inspector_modules'
]
}

View File

@ -272,7 +272,9 @@ exports[`svelte configuration for android 1`] = `
entry: {
bundle: [
'@nativescript/core/globals/index.js',
'__jest__/src/app.js'
'__jest__/src/app.js',
'@nativescript/core/ui/frame',
'@nativescript/core/ui/frame/activity'
]
}
}"
@ -552,7 +554,7 @@ exports[`svelte configuration for ios 1`] = `
'@nativescript/core/globals/index.js',
'__jest__/src/app.js'
],
'tns_modules/@nativescript/core/inspector_modules': [
'tns_modules/inspector_modules': [
'@nativescript/core/inspector_modules'
]
}

View File

@ -279,7 +279,9 @@ exports[`vue configuration for android 1`] = `
entry: {
bundle: [
'@nativescript/core/globals/index.js',
'__jest__/src/app.js'
'__jest__/src/app.js',
'@nativescript/core/ui/frame',
'@nativescript/core/ui/frame/activity'
]
}
}"
@ -566,7 +568,7 @@ exports[`vue configuration for ios 1`] = `
'@nativescript/core/globals/index.js',
'__jest__/src/app.js'
],
'tns_modules/@nativescript/core/inspector_modules': [
'tns_modules/inspector_modules': [
'@nativescript/core/inspector_modules'
]
}

View File

@ -54,10 +54,20 @@ export default function (config: Config, env: IWebpackEnv = _env): Config {
.add('@nativescript/core/globals/index.js')
.add(entryPath);
// Add android app components to the bundle to SBG can generate the java classes
if (platform === 'android') {
const appComponents = env.appComponents || [];
appComponents.push('@nativescript/core/ui/frame');
appComponents.push('@nativescript/core/ui/frame/activity');
appComponents.map((component) => {
config.entry('bundle').add(component);
});
}
// inspector_modules
config.when(shouldIncludeInspectorModules(), (config) => {
config
.entry('tns_modules/@nativescript/core/inspector_modules')
.entry('tns_modules/inspector_modules')
.add('@nativescript/core/inspector_modules');
});

View File

@ -16,6 +16,7 @@ export interface IWebpackEnv {
appPath?: string;
appResourcesPath?: string;
appComponents?: string[];
nativescriptLibPath?: string;