shakacode / shakacode/bootstrap-loader

Support for loader parameters being Objects in styleLoaders

Open
#421 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
JavaScript
Stars
1k
Forks
469
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the styleLoaders documentation and reproduce the reported sass-loader v10 configuration using bootstrap-loader v3. Trace how styleLoaders parameters are parsed and passed to the loader, then verify that nested object parameters are accepted without the shown validation error and that the documentation matches the supported syntax.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, webpack
Domain
build-system
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.