Skip to content

fix(webpack): Adjust appComponents Env - #10401

Merged
rigor789 merged 1 commit into
NativeScript:mainfrom
azriel46d:main
Oct 9, 2023
Merged

rigor789 merged 1 commit into
NativeScript:mainfrom
azriel46d:main

Conversation

@azriel46d

@azriel46d azriel46d commented Oct 9, 2023 •

Copy link
Copy Markdown
Contributor

Documentation indicates https://beta.docs.nativescript.org/configuration/webpack#env-appcomponents where --env.appComponents=./someActivity.js can be passed.

However, when utilsing this, webpack throws an error appComponents.push is not a function when a single Activity is added.

This PR adjusts the reading of appCompnents env and if it is a single item, its wrapped inside an array

PR Checklist

What is the current behavior?

  1. Create a new app
  2. Add a CustomActivity.js
  3. ns build android --env.appComponents=./CustomActivity.js

TypeError: appComponents.push is not a function

What is the new behavior?

Build continues normally

Allows passing additional App Components for android.

For example if you have a custom activity defined in myCustomActivity.ts you can pass --env.appComponents=myCustomActivity.ts to include it in the build.

However this resolves to a string if its a single item
@cla-bot cla-bot Bot added the cla: yes label Oct 9, 2023
@rigor789
rigor789 merged commit 0b5393d into NativeScript:main Oct 9, 2023
tdermendjiev pushed a commit to tdermendjiev/NativeScript that referenced this pull request Oct 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants