Skip to content

add watch capability #22

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

Closed
wants to merge 1 commit into from

Conversation

PeterStaev
Copy link

First of all thanks for this plugin! Have been using it in a new project, and noticed some slow-up/problems with the new tns run that does automatic watch. This patch addresses the following:

  • Adds watch capability, thus compiling and transferring only the changed css file!
  • Fixes path resolution (Fix for path resolution #21). Currently the plugin always looks @import files to be at the app root. Instead it should be able to use relative paths. So if I have app/view/login.scss and I want to @import a file from the app folder i should be using ../../ in the path.
  • Fixes LiveSync issues with dev-sass #20. At least with this implementation I do not experience the problem anymore.

The code rewrite was greatly inspired by the nativescript-dev-typescript plugin 😄

@toddanglin
Copy link
Contributor

Thanks for the impressive contrib, Peter!

I didn't notice this PR before doing some refactoring for the upcoming 3.0 release, BUT I think your fixes will solve other issues people are having with 2.5.x. Let me try to resolve the conflicts and merge this weekend. Should make the plugin robust and ready for all versions of {N} CLI.

@toddanglin
Copy link
Contributor

Worked on merging your contributions over the weekend. GREAT refactoring. Thanks again for taking the time to make it.

Through my testing, with these changes, SASS LiveSync works as expected in {N} 2.5.x and 3.0.0-rc.

In {N} 2.4.x, however, LiveSync changes to SASS files trigger a relaunch of the app (versus doing a faster, in-place update of the styles).

SO...this new approach improves the LiveSync experience for 2.5.x and higher, but (seems to) degrade slightly for 2.4 and lower. I'm wondering if that's okay and we should just guide people to use the current version of the plugin if they're on {N} 2.4 or earlier. What do you think?

@PeterStaev
Copy link
Author

Glad it works with 3.0-rc as well!

As for older version - I think it should be fine as long as we have some note in the readme that if you are using version pre-2.5 you should specifically install version ~0.4. And if you are using version 2.5+ to use the new version.

toddanglin added a commit that referenced this pull request Apr 4, 2017
Now running node sass in separate process and using built-in watch capability to transpile SASS and SCSS files on change
@toddanglin toddanglin mentioned this pull request Apr 4, 2017
@toddanglin
Copy link
Contributor

Changes integrated via #25

@toddanglin toddanglin closed this Apr 4, 2017
@PeterStaev PeterStaev deleted the enhance-watch branch April 5, 2017 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants