Skip to content

Commit

Permalink
feat(webpack): allow passing env.appComponents and env.entries (#8898)
Browse files Browse the repository at this point in the history
  • Loading branch information
mapo80 committed Jan 29, 2021
1 parent 5fe2742 commit 90d208c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/webpack/templates/webpack.angular.js
Expand Up @@ -56,6 +56,8 @@ module.exports = (env) => {
snapshotInDocker, // --env.snapshotInDocker
skipSnapshotTools, // --env.skipSnapshotTools
compileSnapshot, // --env.compileSnapshot
appComponents = [],
entries = {}
} = env;

const { fileReplacements, copyReplacements } = parseWorkspaceConfig(platform, configuration, projectName);
Expand Down Expand Up @@ -83,7 +85,7 @@ module.exports = (env) => {
}
const entryModule = `${nsWebpack.getEntryModule(appFullPath, platform)}.ts`;
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);
if (platform === 'ios' && !areCoreModulesExternal && !testing) {
entries['tns_modules/@nativescript/core/inspector_modules'] = 'inspector_modules';
Expand Down Expand Up @@ -141,6 +143,9 @@ module.exports = (env) => {
}

const noEmitOnErrorFromTSConfig = getNoEmitOnErrorFromTSConfig(tsConfigName);

appComponents.push("@nativescript/core/ui/frame",
"@nativescript/core/ui/frame/activity");

nsWebpack.processAppComponents(appComponents, platform);
const config = {
Expand Down

0 comments on commit 90d208c

Please sign in to comment.