svelte-preprocess icon indicating copy to clipboard operation
svelte-preprocess copied to clipboard

prependData, but @import's paths in it to files relative to them

Open MarkTanashchuk opened this issue 3 years ago • 2 comments

In my project, I have mobile.scss next to each component and this kind of file structure:

+Component(folder)
++Component.svelte
++mobile.scss

+Component2(folder)
++Component2.svelte
++mobile.scss

I would like to have @import "./mobile.scss" in each component and each component take its own mobile.scss

Is it possible?

MarkTanashchuk avatar Nov 13 '20 14:11 MarkTanashchuk

Hey @MarkTanashchuk 👋 Not right now, no. However, I was thinking of making it accept a method that receives the filename and returns the string that will be prepended. I've also wanted to deprecate it in favor of something akin to the additionalData from sass-loader (https://webpack.js.org/loaders/sass-loader/#additionaldata).

kaisermann avatar Nov 13 '20 14:11 kaisermann

I will be happy if this function is implemented

Have a successful development =)

MarkTanashchuk avatar Nov 13 '20 16:11 MarkTanashchuk