One of the popular package used during developing NativeScript apps is tns-platform-declarations
But should I install it as dependency or a dev-dependency?
One of the popular package used during developing NativeScript apps is tns-platform-declarations
But should I install it as dependency or a dev-dependency?
It's a dev-dependency
It's just a set of TypeScript declaration files for intellisense support.
On second thought (and after some additional research) with NativeScript 6, the webpack bundle is enabled by default. That means that all code is tree-shaken and only JavaScript files that are imported will be included in your outputted bundle (which will guarantee a smaller bundle size compared to the legacy workflow). As tns-platform-declaration
is never imported those *.d.ts files will be tree shaken and not included in the bundle.
So with NativeScript 6 and above, there is no difference if the tns-platform-declarations
will be a dependency
or a devDependency
BUT it is a good practice to differentiate the development libraries. So I would say that you should install it as a devDependency
just to be more clear.