File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ import vsixPlugin from '@codingame/monaco-vscode-rollup-vsix-plugin'
99import glob from 'fast-glob'
1010import path from 'path'
1111import pkg from './package.json' assert { type : 'json' }
12+ import { addExtension } from '@rollup/pluginutils'
1213
1314const externals = Object . keys ( pkg . dependencies )
1415
@@ -43,6 +44,20 @@ export default rollup.defineConfig({
4344 {
4445 name : 'external-resolver' ,
4546 resolveId ( id ) {
47+ // monaco-editor can safely be imported with monaco-vscode-api
48+ if ( id === 'monaco-editor/esm/vs/editor/editor.api' ) {
49+ return {
50+ id : 'monaco-editor' ,
51+ external : 'absolute'
52+ }
53+ }
54+ // Add missing .js extension to respect ESM strict mode
55+ if ( id . startsWith ( 'monaco-editor/esm' ) ) {
56+ return {
57+ id : addExtension ( id , '.js' ) ,
58+ external : 'absolute'
59+ }
60+ }
4661 if ( / \. w a s m $ / . test ( id ) || externals . some ( external => id === external || id . startsWith ( `${ external } /` ) ) ) {
4762 return {
4863 id,
You can’t perform that action at this time.
0 commit comments