Angular workspace with multiple Angular + Nativescript Code sharing projects and a resusable library

前提是你 提交于 2019-12-22 10:46:52

问题


Environment

'tns info' √ Getting NativeScript components versions information... ‼ Update available for component nativescript. Your current version is 5.1.0 and the latest available version is 5.1.1. ‼ Update available for component tns-core-modules. Your current version is 5.1.1 and the latest available version is 5.1.2. √ Component tns-android has 5.1.0 version and is up to date. × Component tns-ios is not installed.

  • CLI: @angular/cli@7.1.4
  • Cross-platform modules: N/A
  • Android Runtime: latest
  • iOS Runtime: N/A
  • Plugin(s): N/A .

In my workspace I have two nativescript + angular code sharing projects. In my actual projects in a workspace I have an nsconfig.file that points to the files as well as overridden in webpack.config.js for testing as I am not fully sure if the nsconfig is working as expected

When generating a new platform it can never find the Android Manifest in a project, (which is expected) I assume on build It will override these values anyways. However Near the end of running 'tns run android --bundle' it seems to try to direct to a default folder of 'app/' which I cannot see even in a new code sharing project by itself so I am led to believe this is some sort of default path.

Error as as follows:

...
[./package.json] 129 bytes {bundle} [optional] [built]
    + 382 hidden modules
Webpack compilation complete. Watching for file changes.
Webpack build done!
Could not find folder: C:\Users\userNameHere\Desktop\projects\myProjects\AngularWorkSpace\app
Unable to apply changes on device: emulator-5554. Error is: ENOENT: no such file or directory, stat 'C:\Users\userNameHere\Desktop\projects\myProjects\AngularWorkSpace\app\App_Resources\Android'.

All project specific files would be in workspace/projects/applicationOne not workspace/app which I believe is some sort of default path if nothing is found.

Showing Angular workspace with 2 projects and a feature library:

To Reproduce

Create a new empty workspace Add 2 nativescript Angular code sharing projects Add a library (possibly not neccessary) Set up similar structure for reusable platform and webpack.

Update nsconfig inside project 1 and 2
{
  "appResourcesPath": "projects/applicationOne/App_Resources",
  "appPath": "projects/applicationOne/src",
  "nsext": ".tns",
  "webext": "",
  "shared": true
}

Expected behavior

Should be able to have an Angular workspace with multiple applications projects added. 1 webpack.config.js for handling building. An nsconfig.js per application in the projects folder for paths. To build per application.

Additional context

I believe I have everything set up correctly. I think the only issue is Could not find folder: C:\Users\userNameHere\Desktop\projects\myProjects\AngularWorkSpace**\app** The \app i think is the default when a path is not specific or found. it should be pointing to AngularWorkspace/projects/applicationOne

Update:

When I do not override the values for appPath and appResourcesPath in the webpack.config.js file I notce the paths will faile back all of them to workspace/app. This leads me to believe the build is using appPath somewhere else outside of webpack and that I am not overriding it soon enough.

I have read about updating webpack variables such as appPath from the command line, I think the reason is the application is not picking up from the nsconfig from projects/applicationOne and therefor defaults. I think if I can update this value as well as appResourcesPath from the command line then the builds should work.

来源:https://stackoverflow.com/questions/54424974/angular-workspace-with-multiple-angular-nativescript-code-sharing-projects-and

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!