0.30.1 • Published 2 years ago

monaco-editor-es v0.30.1

Weekly downloads
6
License
MIT
Repository
github
Last release
2 years ago

Installation

npm i monaco-editor-es

Usage

Step 1 - Import the script

import '../node_modules/monaco-editor-es/editor.main.js'

Step 2 - Define where the workers are located

const workersDir = new URL('../node_modules/monaco-editor-es/workers/', import.meta.url)
self.MonacoEnvironment = {
  getWorkerUrl: function (moduleId, label) {
    switch(label) {
      case 'json':
        return `${workersDir}json.worker.js`
      case 'css':
        return `${workersDir}css.worker.js`
      case 'html':
        return `${workersDir}html.worker.js`
      case 'typescript':
      case 'javascript':
        return `${workersDir}ts.worker.js`
      default:
        return `${workersDir}editor.worker.js`
    }
  }
}

Step 3 - Create the MonacoEditor

monaco.editor.create(document.getElementById('#editor'), {
  language: 'javascript,
  theme: 'vs-dark'
})

For more info on Monaco Editor see the Official Documentation

0.30.1

2 years ago

0.30.0

2 years ago

0.29.0

2 years ago

0.27.0

2 years ago

0.25.2

2 years ago

0.25.1

2 years ago

0.25.0

2 years ago

0.29.1

2 years ago

0.28.0

2 years ago

0.26.1

2 years ago

0.26.0

2 years ago

0.24.0

2 years ago

0.22.3

3 years ago

0.23.1

3 years ago

0.22.2

3 years ago

0.21.3

3 years ago

0.23.0

3 years ago

0.22.1

3 years ago

0.22.0

3 years ago

0.21.2

4 years ago

0.21.0

4 years ago

0.21.1

4 years ago

0.20.0

4 years ago

0.19.3

4 years ago

0.19.1

4 years ago

0.19.2

4 years ago

0.19.0

4 years ago

0.18.1

4 years ago

0.17.0

4 years ago

0.18.0

4 years ago

0.17.1

4 years ago

0.16.2

4 years ago

0.16.1

4 years ago

0.15.5

4 years ago

0.15.6

4 years ago

0.16.0

4 years ago

0.15.4

4 years ago

0.15.3

4 years ago

0.15.2

4 years ago

0.15.1

4 years ago

0.14.2

4 years ago

0.14.3

4 years ago

0.14.1

4 years ago

0.14.0

4 years ago

0.13.1

4 years ago

0.13.0

4 years ago

0.11.0-alpha1

4 years ago

0.11.0

4 years ago

0.12.0

4 years ago

0.11.1

4 years ago

0.11.0-pre0

4 years ago