When I use the same file for output as one of the input file, output has duplicated content.
mix.styles([
'node_modules/bs-stepper/dist/css/bs-stepper.min.css',
'node_modules/select2/dist/css/select2.min.css',
'public/css/study-form.css' // different file
], 'public/css/study-form_test.css'); // different file
or
mix.styles([
'node_modules/bs-stepper/dist/css/bs-stepper.min.css',
'node_modules/select2/dist/css/select2.min.css',
'public/css/study-form.css' // same file
], 'public/css/study-form.css'); // same file
Why? How should I handle this? I mean, I dont want one redundant file there. Thanks
Why wouldn't you output them all to a new single file? If you think about what you're asking, the behavior is logical. Take content of file A and append to end of file A. Of course you'd get duplicate?
That's basically what it's doing - cutting contents of one file and pasting in another. Don't have them (source and destination) be the same file.
mix.styles([
'node_modules/bs-stepper/dist/css/bs-stepper.min.css',
'node_modules/select2/dist/css/select2.min.css',
'public/css/study-form.css'
], 'public/css/some-unique-filename.css'); // new file containing all
@CRONIX - That's what I wanted to avoid. If I create a new unique file, the previous file that I've tried to concat will become redundant in a project.
Well, I don't use any minified source files. I use the mix().version() command to do the minification on the final output file. The only file I serve (in the example I posted) would be the single file from the output.
Maybe you want to just use combine() instead of styles().
I have one sass file, and I want it to compile, and that compiled file combine with node modules styles. After that, that previously compiled sass file is useless in project.