Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/382.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在Laravel Mix中使用每个文件的不同编译设置编译多个JavaScript文件_Javascript_Laravel_Webpack_Laravel Mix - Fatal编程技术网

如何在Laravel Mix中使用每个文件的不同编译设置编译多个JavaScript文件

如何在Laravel Mix中使用每个文件的不同编译设置编译多个JavaScript文件,javascript,laravel,webpack,laravel-mix,Javascript,Laravel,Webpack,Laravel Mix,我有一个为应用程序API提供可下载JavaScript集成脚本的应用程序。我希望能够使用与主应用程序前端不同的设置编译此集成文件 webpack.mix.js // Compile js integration mix.js('resources/js/integrations/FilterIntegration', 'integrations/filter.js'); // Compile the main application mix.js('resources/js/layout/Ro

我有一个为应用程序API提供可下载JavaScript集成脚本的应用程序。我希望能够使用与主应用程序前端不同的设置编译此集成文件

webpack.mix.js

// Compile js integration
mix.js('resources/js/integrations/FilterIntegration', 'integrations/filter.js');

// Compile the main application
mix.js('resources/js/layout/Root.js', 'public/js/app.js')
    .sass('resources/sass/app.scss', 'public/css')
    .extract(['react', 'react-router-dom', 'lodash']);
我的问题是,此设置实际上将以下所有链接命令应用于每个编译文件。这意味着我编译的集成文件还必须使用vendor.jsmanifest.js文件,这些文件是通过extract命令为主应用程序创建的,它还包括一个sass import语句,尽管很明显,集成与样式无关简单地说,它是一个JavaScript库

因此,我的问题如下:如何设置我的Laravel Mix编译,使我可以方便地使用与主应用程序分离的设置编译集成库