'How to exclude spe.js files from mix.js()

I currently have this:

mix.js("./enterpath/**/*.js", "../../path/to/build/build.js");

We recently started to introduce tests in those folders for each js file test.spec.js

But now those files are also being compiled with the normal JS.

How do I tell mix to mix all *.js files except *.spec.js?



Solution 1:[1]

Well, this is not the best solution as it still compiles it, but at least I can choose not to include that file. This fixed my issue, but this shouldn't be the long-term solution:

mix.js("./enterpath/**/*.js", "../../path/to/build/build.js").extract(["spec"]);

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Philll_t