Closed johnpapa closed 3 years ago
I ran in to a related issue when trying to @import
or @use
an external Sass file, and looking at the code I can offer that with Sass' renderSync
method you'd need to use the file
parameter rather than data
, so as to give the compiler a file-path reference point for imports. I would imagine a similar issue will exist for other language compilers
@lunelson Out of curiosity: are you trying to import a relative URL (another Sass file within the swing) or an HTTP-based URL? I just ask since HTTP-based imports should already work, since I believe Sass just passes them through to CSS.
@lostintangent actually I was trying to @use
a Sass file (@use
is Sass 4.x syntax, replacing @import
) from outside of the codeswing. My hope was that an arrangement like this would work, so I could write swings under the ./test
directory of a Sass library that I'm developing, for example.
.
├── _utils.scss
├── utils.pug
├── utils.js
├── swing-a/
│ ├── script.js
│ ├── codeswing.json
│ ├── index.pug
│ └── style.scss
└── swing-b/
├── script.js
├── codeswing.json
├── index.pug
└── style.scss
@lunelson Thanks for confirming that! I have a fix for that scenario, that I'll ship in just a bit 👍
@lostintangent that's great news! I'll be looking out for it 😄
@lunelson This should now work in v0.0.12, which is publishing to the marketplace as we speak. Additionally, the CodeSwing tree view now allows you to add/upload/rename/delete files, so I'm going to close this as resolved, and we can open new/specific issues as appropriate. Thanks!
I see in the github repo's readme that you can add additional files. I'm thinking like the Svelte REPL where you can have multiple components.
How do you do that in CodeSwing (can you)?
I see an example in the readme but New Swing doesnt seem to do it how I thought (New Swing File?)