Skip to content

Support for loader parameters being Objects in styleLoaders #421

Description

@nsunga

Hello!

Technologies being used:

  • bootstrap-loader v3
  • sass-loader v10

I think the documentation is incorrect: https://github.com/shakacode/bootstrap-loader#styleloaders

styleLoaders:
  - style-loader
  - css-loader
  - sass-loader

# You can apply loader params here:
  - sass-loader?outputStyle=expanded

notice how sass-loader is passed in outputStyle=expanded, but sass-loader only accepts that key-value under a parent key called sassOptions: https://github.com/webpack-contrib/sass-loader#sassoptions

what I tried is the following:

  1. ... - sass-loader?sassOptions={outputStyle:'expanded'}

This will throw a Validation Error

ValidationError: Invalid options object. Sass Loader has been initialized using an options object that does not match the API schema.
 - options.sassOptions should be one of these:
   object { … } | function

What ends up being passed to sass-loader is this object: { sassOptions: "{outputStyle:'expanded'}", sourceMap: true }

Notice how sassOptions is tied to a string.

Does the later versions of bootstrap-loader support object params? If not, is there a plan for support?

sass-loader?outputStyle=expanded still throws the same Validation Error as well

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions