-
-
Notifications
You must be signed in to change notification settings - Fork 198
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
How to exclude dirs from sass loader? #534
Comments
Hi @pohlaniacz, I think that's related to this issue: #428 Setting the There is however no easy way to that right now... you have to change the config manually: const config = Encore.getWebpackConfig();
for (const rule of config.module.rules) {
if (rule.test && rule.test.toString() === '/\\.s[ac]ss$/') {
for (const use of rule.oneOf.map(oneOf => oneOf.use)) {
for (const loader of use) {
if (loader.loader === 'resolve-url-loader') {
loader.options.attempts = 1;
}
}
}
}
}
module.exports = config; Or after #509 is released: Encore.configureLoaderRule('sass', rule => {
for (const use of rule.oneOf.map(oneOf => oneOf.use)) {
for (const loader of use) {
if (loader.loader === 'resolve-url-loader') {
loader.options.attempts = 1;
}
}
}
}) |
damn, thanks, works like a charm! FYI, on intel with 12 cores from E5-1650, 4x16gb ram and 2 ssd disk it took more than 15 minutes (I've stopped it after that, so don't know how long should I wait). After your fix it take ~5 seconds ;) Very strange that I can't easily include/exclude dirs or your fix isn't an option. Thanks again! |
Wow, I didn't think the difference would be that big, you must have a lot of files. The loader doesn't provide an include/exclude mechanisme, how it behaves in that version is a bit weird and you can only limit the amount of folders it'll process (through the
As for the fix given in my previous answer, it isn't an option simply because we don't have something like |
what do you mean? I think I have the latest version of webpack-encore and only way to "fix" this is |
What I meant is that Encore is using a dependency called This version does some dirty things behind the scene to generate the right paths in your CSS files as described in #428. There is a more recent 3.x version that uses a cleaner algorithm to determine those paths. So, instead of adding |
ah, ok, now it's clear. Anyway, thanks again for help! Best wishes. |
…Plugin (Lyrkan) This PR was merged into the master branch. Discussion ---------- Update various dependencies and remove the LoaderOptionsPlugin This PR updates various dependencies that were either really outdated or subject to security issues. Since most of those packages are listed in our dev dependencies it shouldn't have a big impact on most users, but the following changes could be an issue for some of them: * The `css-loader` was updated from `^1.0.0` to `^2.1.1` ([breaking changes](https://github.com/webpack-contrib/css-loader/blob/master/CHANGELOG.md#200-2018-12-07)) * The `resolve-url-loader` was updated from `^2.3.0` to `^3.0.1` ([breaking changes](https://github.com/bholloway/resolve-url-loader/tree/master/packages/resolve-url-loader#version-3), closes #428 and closes #534) * The minimum version of NodeJS was bumped from 6 to 8 (needed to update `zombie`, and v6's end-of-life happening in less than a month anyway) * The [`LoaderOptionsPlugin`](https://webpack.js.org/plugins/loader-options-plugin/) was removed since it should not be needed anymore and caused a *really annoying* bug when used with the latest version of the `resolve-url-loader` (see #428 (comment)) Commits ------- aeea89b Update various dependencies and remove the LoaderOptionsPlugin
Hi. I have dir like /uploads/ where user store their photos. When running webpack with enableSassLoader() it makes stat through all this files (which take long time). The only solution for now is to set "resolveUrlLoader: false" but I want to use it for simplier paths. So is there any solution to disable /uploads/ dir?
The text was updated successfully, but these errors were encountered: