-
Notifications
You must be signed in to change notification settings - Fork 809
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
Imposible compile 2 scss files with a same name but in different location #222
Comments
Are you using your own webback.config.js or the one in |
Nothing else was changed.
|
In node_modules directory I see this function like so: if (Mix.cssPreprocessor) {
Mix[Mix.cssPreprocessor].forEach(toCompile => {
let extractPlugin = new plugins.ExtractTextPlugin(
Mix.cssOutput(toCompile)
);
module.exports.module.rules.push({
test: new RegExp(toCompile.src.fileWithDir.replace(/\\/g, '\\\\') + '$'),
loader: extractPlugin.extract({
fallbackLoader: 'style-loader',
loader: [
'css-loader',
'postcss-loader',
'resolve-url-loader',
(Mix.cssPreprocessor == 'sass') ? 'sass-loader?sourceMap&precision=8' : 'less-loader'
]
})
});
module.exports.plugins = (module.exports.plugins || []).concat(extractPlugin);
});
} |
Yeah later it got changed, but it should still work the same. I can't seem to reproduce it. Does it also happen on a fresh install? Do you get any error output or does it fail silently? |
📝 It crashes with npm error with no clear error message.
|
Hmm, looks similiar to this one: #165 (comment). I'm not sure what's going on either. |
It looks like toCompile.src.fileWithDir only contains the file's immediate parent directory, not it's full path. So if you have something like the following, the files will clash as "sass/app.scss" (this is my situation). mix
.sass('resources/cms/assets/sass/app.scss', 'public/cms/css')
.sass('resources/frontend/assets/sass/app.scss', 'public/css'); I've tried changing the code back to how it was after commit be433ff and that does fix it but based on subsequent commits I guess there was a reason for the change. |
@edjeavons Yeah that's the issue. It uses a Windows Users: I could use some help testing out a fix. We'll probably need to use a full file path instead, to prevent issues like this from popping up (as rare as it may be). If you can help, please do:
Next, open test: new RegExp(toCompile.src.fileWithDir.replace(/\\/g, '\\\\') + '$'), The test: new RegExp(toCompile.src.path.replace(/\\/g, '\\\\') + '$'), Can you test that out ( var mix = require('laravel-mix');
mix.sass('Modules/Admin/Resources/assets/sass/app.scss', 'public/modules/admin/css')
.sass('resources/assets/sass/app.scss', 'public/css'); You'll know it works if you see both |
Worked fine on my end as well. |
Thanks! |
laravel-mix version "0.5.16"
It works with javascript but not with scss. Works if I rename app.scss to something like app2.scss
The text was updated successfully, but these errors were encountered: