question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to add custom options for sass compilation

See original GitHub issue

When trying to use foundation I ran in to problem where I have to add custom include paths. Adding them as options is not working as only resolve_url_loader is a valid option.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:3
  • Comments:11 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
weaverryancommented, Jun 26, 2017

To me, it made more sense to separate encore options from pass-through options used for the loaders.

Hmm @DaRamirezSoto, then what about an option that’s very similar to your option III:

.enableSassLoader(function(options) {
    // add or set custom options
    options.includePaths: ["absolute/path/a", "absolute/path/b"];
}, { resolve_url_loader: false });

I’ve just reversed the first and second argument for consistency with other loaders, where we would consistently have an options callback as the first argument (and sometimes we would have a second argument for Encore-specific stuff when needed - so far, this is only for the sass-loader).

With childlike solutions that use everything in callbacks without a good reason to do so

Please try to keep things positive and respectful 😃. I do appreciate your help and thoughts, but I don’t want anyone in the Symfony community (myself included) to feel insulted for their ideas.

@davidmpaz About your example with the happyPackConfig - I haven’t looked into it too far, but HappyPack would likely have its own configuration/enabling method, since it’s not really specific to any one loader (e.g. enableHappyPack(function(config) {});.

2reactions
d4r5c0d3commented, Jun 26, 2017

@weaverryan I am really confused now. I thought encore where going to make things easier and now we are just proxying Webpack with callbacks that have more switches and values you can set. I have no idea how you can call this easier.

There is going to be some confusing in regards to the file name used. People seeing webpack.config.js but having to deal with some weird proxy API that has bad naming convention never seen before in Nodejs landscape. With childlike solutions that use everything in callbacks without a good reason to do so. It is not like we using promises at which point the heavy use of callbacks would make sense.

The solution change the file name to encore.config.js?

I understand that there is a need for a webpack.config.js generator that helps people who don’t spend much time dealing with NodeJS (or don’t want), but that is not what this is becoming. I already pointed this out and you validated but insisted that reinventing the wheel is what we were going for.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't compile Sass file into CSS with Live Sass Compiler
Click on Live Sass Compiler once it appears and again click on Edit in Settings.json link and add following json:
Read more >
Upgrade SASS / SCSS to Use Latest CSS - YouTube
If your live sass compiler not working in vscode, or you want to use latest SASS / SCSS and CSS properties, it is...
Read more >
Options | JS API - Sass
Custom importers that control how Sass resolves loads from rules like @use and @import . Loads are resolved by trying, in order: The...
Read more >
Sass, SCSS, and Less | WebStorm Documentation - JetBrains
To use a compiler in WebStorm, you need to configure it as a File Watcher ... Custom settings: the output is stored in...
Read more >
sass-loader - npm
The implementation options either accepts sass ( Dart Sass ) or node-sass as a module. object. For example, to use Dart Sass, you'd...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found