Is there a way to exclude an extra `node_modules` directory from Mix?
I am using a stock npm run watch command in the root directory of my project.
Further down the directory hierarchy in resources/js I have installed Storybook, which is a Javascript component development tool. This tool created an additional node_modules folder. The tool is working perfect that I can see by way of yarn storybook.
But now npm run watch is failing because it detects problems in that part of my directory structure that I'm not interested in watching. So I would like to exclude resources/js/storybook entirely.
I googled a lot a and I note an NPM exclude directive but I have no idea of this I what I'm supposed to use, but more importantly if it could work, where to put it. My best guess is webpack.mix.js but this file is really minimalist and I tried a couple of ways but no luck.
This is what I tried:
https://laravel.com/docs/7.x/mix#custom-webpack-configuration
mix.js('resources/js/app.js', 'public/js')
.sass('resources/sass/app.scss', 'public/css');
mix.webpackConfig({
module: {
rules: [
{
exclude: [
path.resolve(__dirname, "resources/js/storybook")
],
},
]
}
});
/home/eugene/code/shop/node_modules/webpack-cli/bin/cli.js:281
throw err;
^
Please or to participate in this conversation.