Skip to content

fix: remove all .ts files when building in release #4008

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 10, 2018

Conversation

rosen-vladimirov
Copy link
Contributor

When building application in release mode, the .ts files of all plugins should be removed from the final application. Currently this is happening only for tns-core-modules. Do this for all the plugins.
Remove logic that deletes the node_modules directory of the tns-core-modules when it is copied to platforms. This is not required anymore and it breaks use-case when linking tns-core-modules.

PR Checklist

What is the current behavior?

Applications built in release have .ts files inside them.
Also you are unable to use a linked copy of tns-core-modules.

What is the new behavior?

Applications built in release does NOT have .ts files inside them.
You can use symlink for tns-core-modules.

Fixes issue #4007

When building application in release mode, the `.ts` files of all plugins should be removed from the final application. Currently this is happening only for `tns-core-modules`. Do this for all the plugins.
Remove logic that deletes the `node_modules` directory of the `tns-core-modules` when it is copied to `platforms`. This is not required anymore and it breaks use-case when linking tns-core-modules.
@rosen-vladimirov rosen-vladimirov added this to the 5.0.0 milestone Oct 10, 2018
@rosen-vladimirov rosen-vladimirov self-assigned this Oct 10, 2018
for (const entry in dependencies) {
const dependency = dependencies[entry];
public copyModules(opts: { dependencies: IDependencyData[], release: boolean }): void {
const filePatternsToDelete = opts.release ? "**/*.ts" : "**/*.d.ts";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we exclude .scss files here as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking the same, but it is not a common practice to publish packages with .scss ,while all plugins have .d.ts. We need a more generic way to handle this and let the user decides what to exclude.

@rosen-vladimirov rosen-vladimirov merged commit 2e60b34 into master Oct 10, 2018
@rosen-vladimirov rosen-vladimirov deleted the vladimirov/link-tns-core-modules branch October 10, 2018 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants