File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -84,7 +84,7 @@ export default function monacoEditorPlugin(options: IMonacoEditorOpts = {}): Plu
84
84
} ,
85
85
transformIndexHtml ( html ) {
86
86
const works = getWorks ( options ) ;
87
- const workerPaths = getWorkPath ( works , options ) ;
87
+ const workerPaths = getWorkPath ( works , options , resolvedConfig ) ;
88
88
89
89
const globals = {
90
90
MonacoEnvironment : `(function (paths) {
Original file line number Diff line number Diff line change @@ -12,14 +12,14 @@ export function getFilenameByEntry(entry: string) {
12
12
13
13
export const cacheDir = 'node_modules/.monaco/' ;
14
14
15
- export function getWorkPath ( works : IWorkerDefinition [ ] , options : IMonacoEditorOpts ) {
15
+ export function getWorkPath ( works : IWorkerDefinition [ ] , options : IMonacoEditorOpts , config : ResolvedConfig ) {
16
16
const workerPaths = { } ;
17
17
18
18
for ( const work of works ) {
19
19
if ( isCDN ( options . publicPath ) ) {
20
20
workerPaths [ work . label ] = options . publicPath + '/' + getFilenameByEntry ( work . entry ) ;
21
21
} else {
22
- workerPaths [ work . label ] = '/' + options . publicPath + '/' + getFilenameByEntry ( work . entry ) ;
22
+ workerPaths [ work . label ] = config . base + options . publicPath + '/' + getFilenameByEntry ( work . entry ) ;
23
23
}
24
24
}
25
25
You can’t perform that action at this time.
0 commit comments