File tree 2 files changed +4
-2
lines changed
samples/browser-esm-webpack-monaco-plugin
webpack-plugin/src/loaders 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change 1
- import * as monaco from 'monaco-editor/esm/vs/editor/editor.api ' ;
1
+ import * as monaco from 'monaco-editor' ;
2
2
3
3
( function ( ) {
4
4
// create div to avoid needing a HtmlWebpackPlugin template
Original file line number Diff line number Diff line change @@ -26,12 +26,14 @@ export const pitch: PitchLoaderDefinitionFunction<ILoaderOptions> = function pit
26
26
return loaderUtils . stringifyRequest ( this , request ) ;
27
27
} ;
28
28
29
+ // editor.main.js contains all features and languages, replace it with requested features, languages and editor.api.js
30
+ const apiRequest = remainingRequest . replace ( / e d i t o r \. m a i n \. j s $ / , 'editor.api.js' ) ;
29
31
return [
30
32
...( globals
31
33
? Object . keys ( globals ) . map ( ( key ) => `self[${ JSON . stringify ( key ) } ] = ${ globals [ key ] } ;` )
32
34
: [ ] ) ,
33
35
...pre . map ( ( include : any ) => `require(${ stringifyRequest ( include ) } );` ) ,
34
- `module.exports = require(${ stringifyRequest ( `!!${ remainingRequest } ` ) } );` ,
36
+ `module.exports = require(${ stringifyRequest ( `!!${ apiRequest } ` ) } );` ,
35
37
...post . map ( ( include : any ) => `require(${ stringifyRequest ( include ) } );` )
36
38
] . join ( '\n' ) ;
37
39
} ;
You can’t perform that action at this time.
0 commit comments