-
-
Notifications
You must be signed in to change notification settings - Fork 188
Closed
Description
I placed this issue webpack/sass-loader#155 on sass-loader but maybe it is more appropriate there. I'm trying to figure out how to stringify an object to be parsed by loader-utils. I tried using json5 directly with no luck, and tried encodeURIComponent on the stringified object but when it is parsed it is a string not an object. Is there some way to accomplish this?
let functions = {
'image-url($filename)': function(filename) {
var imageUrl = process.env.NODE_ENV === 'development' ?
'' :
'';//enter CDN path here
var fileName = filename.getValue();
var imagePath = 'url("' + imageUrl + '/' + fileName + '")';
/*eslint-disable */
return new sass.types.String(imagePath);
/*eslint-enable */
}
}
`sass-loader?functions=${somehowStringify(functions))}`Update: got passing object as query param to work, but still found no way to do this programmatically by stringifying a series of objects
Metadata
Metadata
Assignees
Labels
No labels
