S
S
SomeHuman22021-12-24 16:40:10
webpack
SomeHuman2, 2021-12-24 16:40:10

How to use loader on variable in js?

Hello, I have a line

let str = "/*some scss code that should be compiled to css*/";

and I need to get css line from it using sass-loader.
In the case of require, I could turn the scss file into a css line,
require('!sass-loader?{"sassOptions":{"indentWidth": "0"}}!..myScssFile.scss')

But what about a variable instead of a file?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question