Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Less-Loader, we need the "relativeUrls" option ! #118

Closed
damienfa opened this issue Jul 29, 2017 · 2 comments · Fixed by #134
Closed

Less-Loader, we need the "relativeUrls" option ! #118

damienfa opened this issue Jul 29, 2017 · 2 comments · Fixed by #134
Labels
Feature New Feature

Comments

@damienfa
Copy link

damienfa commented Jul 29, 2017

The Less-loader has the option 'relativeUrls'.
I need to use it to be able to use a library where assets (fonts, images...) are not relative.
to make it work, I can modify your file 'lib/loaders/less.js' and add relativeUrls: false,.
Example :

...cssLoader.getLoaders(webpackConfig, ignorePostCssLoader),
            {
                loader: 'less-loader',
                options: {
                    relativeUrls: false,
                    sourceMap: webpackConfig.useSourceMaps
                }
            },

I would be nice if that option could be an option of your 'enableLessLoader' function !
Example :

.enableSassLoader(function(sassOptions) {}, {
        relativeUrls: false
    })
@weaverryan
Copy link
Member

+1 we just need to make a PR to add this! It's not missing on purpose, just needs to be added!

@weaverryan weaverryan added the Feature New Feature label Aug 5, 2017
weaverryan added a commit that referenced this issue Aug 9, 2017
This PR was merged into the master branch.

Discussion
----------

Add options callback to Encore.enableLessLoader()

This PR allows to add a callback as the first argument of `Encore.enableLessLoader()` (fixes #118).
I didn't notice that one was missing too when working on #130.

Example :

```js
Encore.enableLessLoader((options) => {
    options.relativeUrls = false;
});
```

Commits
-------

fdf72da Add options callback to Encore.enableLessLoader()
@damienfa
Copy link
Author

I've tried a :

.enableLessLoader(function(lessOptions) {
        lessOptions.relativeUrls = false;
    })

and it works like a charm !
Thanks !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature New Feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants