You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As of NativeScript 1.1.1 I can now keep my npm modules in the root folder of my NativeScript project, which is awesome. After I got that working I wanted to remove the package.json within my project's app folder, as that file didn't seem to have any purpose anymore. But when I do that I get an error, as the CLI seems to be using the app/package.json file's "main". So I had to keep around a basic package.json for my app to work:
{
"main": "app.js"
}
Is there any chance this configuration can move to the root package.json or just go away entirely—aka why can't we just default the app's main file to be app.js so a project only needs to have one package.json?
Thanks.
The text was updated successfully, but these errors were encountered:
Personally, I'm mostly peeved that I have to shove stuff into an app folder at all. It'd be nice if the root of the project was used for the source. In that case, the package.json at the root could be the main package.json, and the tns_modules and node_modules could just be in the root as well.
The problem with this is that the runtimes fail to resolve which is your main. The current workflow is like this:
if (exists(package.json) && package.json.contains(main))
load(package.json.main)
else if (exists(index.js))
load(index.js)
else if (exists(bootstrap.js))
load(bootstrap.js)
We have been discussing that we can provide a fallback for app.js as well. Alternatively we can just prepare the root package.json into the correct place. I will circle this around and will update you here what we can do to improve this.
With 1.6.0 we have introduced --template option for project creation that uses npm packages for project templates. This yields that the package.json in the app folder will stay if we do not want to artificially delete it after template expansion.
As of NativeScript 1.1.1 I can now keep my npm modules in the root folder of my NativeScript project, which is awesome. After I got that working I wanted to remove the
package.json
within my project'sapp
folder, as that file didn't seem to have any purpose anymore. But when I do that I get an error, as the CLI seems to be using theapp/package.json
file's"main"
. So I had to keep around a basicpackage.json
for my app to work:Is there any chance this configuration can move to the root
package.json
or just go away entirely—aka why can't we just default the app's main file to beapp.js
so a project only needs to have onepackage.json
?Thanks.
The text was updated successfully, but these errors were encountered: