Skip to content
This repository has been archived by the owner on Aug 7, 2021. It is now read-only.

Allow custom platform plugins to mix with NativeScript core modules #1122

Open
bundyo opened this issue Jan 29, 2020 · 0 comments
Open

Allow custom platform plugins to mix with NativeScript core modules #1122

bundyo opened this issue Jan 29, 2020 · 0 comments
Assignees
Labels

Comments

@bundyo
Copy link
Contributor

bundyo commented Jan 29, 2020

Is your feature request related to a problem? Please describe.
Currently NativeScript doesn't support other platforms than iOS and Android. In order to make this possible, we need to somehow redirect the custom platforms to external plugins.

Describe the solution you'd like
An env.platform option in dev-webpack that will allow specifying the name of the external platform and dev-webpack to load its files from there. In order for the platform to be able to access the {N} core modules, we need somehow to "mix" the plugin and the core modules files, in order for core modules to find the needed platform files.
This can be done through specifying a separate bundle-entry-points file inside the plugin in order to list less or more module entry points and the the dev-webpack file system plugin to redirect the external platform files to the external plugin. Then Webpack can be started with:

npx webpack --env.platform desktop --watch

(this means no CLI support for external platforms for now, as this calls for more extensive planning).

Describe alternatives you've considered
Adding new platforms inside core modules, but this requires core modules to be forked and updates become a bit of a problem.

Additional context
I'm planning on creating a two external platforms from the PoC projects I've created in the past - Web and Desktop.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant