excubo-ag / WebCompiler

Apache License 2.0
148 stars 29 forks source link

Import with tilde #45

Closed Bertie2011 closed 3 years ago

Bertie2011 commented 3 years ago

Is there any support for imports with tildes? If so, where/how would I configure the root of it? E.g: import '~@progress/kendo-theme-default/scss/core/functions/_index.scss'

Ah, this might be better placed in the LibSassHost repository...

stefanloerwald commented 3 years ago

Hi @Bertie2011,

I don't have experience with this feature at all, but I think you can set this through the config json:

Set the CompilerSettings.Sass.IncludePath property to your root:

{
  ...
  "CompilerSettings": {
    "Sass": {
      "IncludePath": "root/goes/here",
      ...
    }
  },
 ...
}

BR Stefan

Bertie2011 commented 3 years ago

I created an isolated project with the most simple case of using the tilde, but it simply seems to not recognize the character. Only when I literally put the ~ in the file name it works. Any more help is appreciated, but feel free to close this issue as it's probably related to LibSass.

stefanloerwald commented 3 years ago

I would first update to the preview version of webcompiler, as libsass is deprecated. The preview version uses dartsass, and things work much better with that.

Bertie2011 commented 3 years ago

Hmmm, the npm package of kendo-theme has all imports made relative (using a build shell script that replaces all occurances of ~@), soooo copying those lines into another shell script gets the job done. Which means I'll probably abandon this issue, because I don't really feel like updating to a preview version and start debugging/hunting until it works.

Thanks for your quick response and time anyways =)

stefanloerwald commented 3 years ago

It's only in preview, because so far DartSassHost is in preview. It's stable, as far as I can tell. The earlier you abandon libsass, the better, I'd say.

Good luck!

Bertie2011 commented 3 years ago

Thank you!