mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-16 11:42:04 +08:00
feat(webpack): allow passing env.appComponents and env.entries (#8898)
This commit is contained in:
@ -56,6 +56,8 @@ module.exports = (env) => {
|
|||||||
snapshotInDocker, // --env.snapshotInDocker
|
snapshotInDocker, // --env.snapshotInDocker
|
||||||
skipSnapshotTools, // --env.skipSnapshotTools
|
skipSnapshotTools, // --env.skipSnapshotTools
|
||||||
compileSnapshot, // --env.compileSnapshot
|
compileSnapshot, // --env.compileSnapshot
|
||||||
|
appComponents = [],
|
||||||
|
entries = {}
|
||||||
} = env;
|
} = env;
|
||||||
|
|
||||||
const { fileReplacements, copyReplacements } = parseWorkspaceConfig(platform, configuration, projectName);
|
const { fileReplacements, copyReplacements } = parseWorkspaceConfig(platform, configuration, projectName);
|
||||||
@ -83,7 +85,7 @@ module.exports = (env) => {
|
|||||||
}
|
}
|
||||||
const entryModule = `${nsWebpack.getEntryModule(appFullPath, platform)}.ts`;
|
const entryModule = `${nsWebpack.getEntryModule(appFullPath, platform)}.ts`;
|
||||||
const entryPath = `.${sep}${entryModule}`;
|
const entryPath = `.${sep}${entryModule}`;
|
||||||
const entries = { bundle: entryPath };
|
Object.assign(entries, { bundle: entryPath }, entries);
|
||||||
const areCoreModulesExternal = Array.isArray(env.externals) && env.externals.some((e) => e.indexOf('@nativescript') > -1);
|
const areCoreModulesExternal = Array.isArray(env.externals) && env.externals.some((e) => e.indexOf('@nativescript') > -1);
|
||||||
if (platform === 'ios' && !areCoreModulesExternal && !testing) {
|
if (platform === 'ios' && !areCoreModulesExternal && !testing) {
|
||||||
entries['tns_modules/@nativescript/core/inspector_modules'] = 'inspector_modules';
|
entries['tns_modules/@nativescript/core/inspector_modules'] = 'inspector_modules';
|
||||||
@ -142,6 +144,9 @@ module.exports = (env) => {
|
|||||||
|
|
||||||
const noEmitOnErrorFromTSConfig = getNoEmitOnErrorFromTSConfig(tsConfigName);
|
const noEmitOnErrorFromTSConfig = getNoEmitOnErrorFromTSConfig(tsConfigName);
|
||||||
|
|
||||||
|
appComponents.push("@nativescript/core/ui/frame",
|
||||||
|
"@nativescript/core/ui/frame/activity");
|
||||||
|
|
||||||
nsWebpack.processAppComponents(appComponents, platform);
|
nsWebpack.processAppComponents(appComponents, platform);
|
||||||
const config = {
|
const config = {
|
||||||
mode: production ? 'production' : 'development',
|
mode: production ? 'production' : 'development',
|
||||||
|
Reference in New Issue
Block a user