I am using the ngx-monaco-editor component together with Angular 5. The monaco-editor is loading fine on localhost, but not on my dev-server.
Loading failed for the script with source “https://se-dnexec.cic.muc/assets/monaco/vs/loader.js”.
This is my webpack.common configuration (under plugins):
new WriteFilePlugin(),
new CopyWebpackPlugin([
{
from: 'src/assets',
to: 'assets'
},
{
from: 'src/meta'
},
{
from: 'node_modules/ngx-monaco-editor/assets/monaco',
to: 'assets/monaco/',
}
],
isProd ? {
ignore: ['mock-data/**/*']
} : undefined
),
In webpack.dev I am using the configuration from webpack.common.
When I run the application from localhost under assets I can see this.
But when running from dev-server I see that the monaco folder is missing:
I am using:
- copy-webpack-plugin: "^4.5.1",
- write-file-webpack-plugin: "^4.2.0"
- webpack: "^3.11.0",
- webpack-dev-server: "~2.7.1",
I would expect that when I run the dev-server that under assets folder the monaco folder is also copied, but for some reason that is not the case. Maybe someone experienced the same problem and can help me. (If further info is needed I can provide it).
I tried the following solution: Does not copy files to actual output folder when webpack-dev-server is used