Let's start by saying I'm not very proficient with Webpack, so, it might be a trivial question.
I'm trying to use Monaco in a Laravel project through the monaco-editor-webpack-plugin. Since the plugin needs modifications to webpack.config.js and Laravel uses webpack.mix.js, by fiddling around I managed to come up with the following configuration:
/* eslint-disable import/no-extraneous-dependencies */
const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin');
const mix = require('laravel-mix');
/*
|--------------------------------------------------------------------------
| Mix Asset Management
|--------------------------------------------------------------------------
|
| Mix provides a clean, fluent API for defining some Webpack build steps
| for your Laravel applications. By default, we are compiling the CSS
| file for the application as well as bundling up all the JS files.
|
*/
mix.js('resources/js/app.js', 'public/js')
.sass('resources/scss/app.scss', 'public/css')
.webpackConfig({
plugins: [
new MonacoWebpackPlugin({
languages: ['css', 'html', 'javascript', 'json', 'scss', 'typescript'],
}),
],
});
Now, everything works fine, files get compiled and the editor works as expected. The Issue I'm having is that the editor's compiled files are being generated in the /public directory. E.g: /public/editor.worker.js, /public/0.js, etc.
I would really like to avoid this and have those files compiled in /public/js/vendor/monaco instead. I tried to change the output config to /public/js/vendor/monaco but it compiles everything (css, fonts, etc) into that directory.
Is there a way to say "Hey, I want those Monaco files here while leaving everything else as is?".