Skip to content

Fix for path resolution #21

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
Apr 1, 2017
Merged

Conversation

DickSmith
Copy link

Currently a _*.scss file could not be found and imported unless it was in the app/ directory or it had been found before the importing file (and the importing file would need to reference it as just it’s name and couldn’t include actual path info which would then throw off the code completion of the IDE).

This change adds to the sassImportPaths as it globs the sassFiles if that files path is not yet present in the sassImportPaths.

This allows for a more flexible file structure.

Currently a _*.scss file could not be found and imported unless it was in the app/ directory or it had been found before the importing file (and the importing file would need to reference it as just it’s name and couldn’t include actual path info which would then throw off the code completion of the IDE).

This change adds to the sassImportPaths as it globs the sassFiles if that files path is not yet present in the sassImportPaths.

This allows for a more flexible file structure.
@PeterStaev PeterStaev mentioned this pull request Mar 24, 2017
@toddanglin toddanglin merged commit aab1bfc into NativeScript:master Apr 1, 2017
@toddanglin
Copy link
Contributor

Thanks for the contribution, @DickSmith!

If you don't mind, it would be great to also extend the demo in the repo to show an example of a *.scss file that takes advantage of this new support. That will not only help others see that this is now supported, but serve as a crude "regression test" for future updates.

@toddanglin
Copy link
Contributor

This issue should be fixed in the latest published RC. Give it a try with this command:

$ npm install nativescript-dev-sass@rc --save-dev

The latest RC is a pretty big refactoring contributed by @PeterStaev. The plugin now runs node-sass in a separate process and uses the CLI for configuration. As a result, much more of the transpile behavior runs as expected:

  • Relative paths for @import
  • Support for .sass and .scss files/syntax
  • Improve LiveSync/watch support

Only caveat is that it is working best with NativeScript 2.5 and higher. If you're still using 2.4.x, let me know. In that case, it may make sense to re-apply this PR and produce a 0.4.3 patch.

@DickSmith
Copy link
Author

Everything's working well and I've actually jumped ahead and am using 1.1.0 of this plugin with NS 3.0-rc.

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