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
{{ message }}
Repository navigation
[Proposal] Packing should produce dist folder and not pollute src folder with .js files #154
Please, provide the following version numbers that your issue occurs with:
CLI: (run tns --version to fetch it) 6.0.0
Cross-platform modules: (check the 'version' attribute in the 6.0.0 node_modules/tns-core-modules/package.json file in your project)
Runtime(s): 6.0.0
Please, tell us how to recreate the issue in as much detail as possible.
Currently the seed structure has npm scripts that will trigger 'tsc' inside the src folder which will produce JavaScript files in it. With NativeScript 6.0.0 any symlinked plugin should not contain both TypeScript and JavaScript files because this can make webpack work unexpectedly.
Reacted by Daniel Leal, Dimitar Tachev, Nedim Erkocevic and Peter Staev
changed the title [-]Packing should produce `dist` folder and not pollute `src` folder with .js files[/-][+][Proposal] Packing should produce `dist` folder and not pollute `src` folder with .js files[/+]on Jul 11, 2019
The only thing I've noticed is that watch & HMR only apply the first change, not the later ones. Even tho it detects them and reports that they have been synced.
This one major drawback of the seed. And this is why I use grunt to build my plugins TS to JS, having gazzilions copy scripts in the package.json is not that appealing...
Set the tsconfig.json to output the compiled JS in dist folder
Change package.json file to point the main entry to dist/<your-plugin-name
Add a script to run tsc in watch mode for the src folder.
This way when you make a change the watch will replace the files in the dist folder. And since the main points to that file it triggers HMR to update the app.
Activity
[-]Packing should produce `dist` folder and not pollute `src` folder with .js files[/-][+][Proposal] Packing should produce `dist` folder and not pollute `src` folder with .js files[/+]manijak commentedon Jul 21, 2019
You can do this already today. Just need to add a few npm scripts to your package.json.
Take a look on how I did it for my Carousel plugin: https://github.com/manijak/nativescript-carousel/blob/master/src/package.json
The only thing I've noticed is that watch & HMR only apply the first change, not the later ones. Even tho it detects them and reports that they have been synced.
PeterStaev commentedon Aug 15, 2019
This one major drawback of the seed. And this is why I use grunt to build my plugins TS to JS, having gazzilions copy scripts in the
package.jsonis not that appealing...PeterStaev commentedon Aug 18, 2019
I think I made this work w/o those copy scripts:
tsconfig.jsonto output the compiled JS indistfolderpackage.jsonfile to point themainentry todist/<your-plugin-nametscin watch mode for thesrcfolder.This way when you make a change the watch will replace the files in the
distfolder. And since themainpoints to that file it triggers HMR to update the app.