{"_id":"@akrc/vite-plugin-monaco-editor","_rev":"2-71ca7b655ce06e92fb35b9ac0fc75cd6","name":"@akrc/vite-plugin-monaco-editor","dist-tags":{"latest":"3.0.0"},"versions":{"2.0.0":{"name":"@akrc/vite-plugin-monaco-editor","version":"2.0.0","description":"A vite plugin for the Monaco Editor","type":"module","author":{"name":"china-bin && akarachen"},"license":"MIT","keywords":["vite-plugin","monaco","editor"],"repository":{"type":"git","url":"git+https://github.com/akarachen/vite-plugin-monaco-editor.git"},"publishConfig":{"registry":"https://registry.npmjs.org"},"devDependencies":{"@okikio/sharedworker":"^1.0.3","@types/fs-extra":"^9.0.13","@types/node":"^16.4.13","@vitejs/plugin-vue":"^1.4.0","@vue/compiler-sfc":"^3.1.5","fs-extra":"^10.0.0","http-server":"^13.0.2","monaco-editor":"^0.33.0","monaco-graphql":"^0.4.4","typescript":"^4.9.5","vite":"^2.9.16","vue":"^3.1.5","vue-router":"^4.0.12"},"peerDependencies":{"monaco-editor":">=0.33.0"},"module":"./dist/index.js","types":"dist/index.d.ts","scripts":{"build":"tsc","prepublish":"npm run copy:cdn","test:build":"npm run build && vite build --config test/vite.config.js","test:dev":"npm run build && vite --config test/vite.config.js","test:preview":"vite preview --config test/vite.config.js","simulator:cdn":"http-server cdn/ --port 8888","copy:cdn":"node script/updateCDN.js"},"bugs":{"url":"https://github.com/akarachen/vite-plugin-monaco-editor/issues"},"homepage":"https://github.com/akarachen/vite-plugin-monaco-editor#readme","_id":"@akrc/vite-plugin-monaco-editor@2.0.0","_integrity":"sha512-UUjGRNHBDk26SX4hkKzRKmaNZ5n2hHIEHw/kSJoh81IgW5xSR+0uePh/yn7gt//AxHHC6TTP3FbuVEiExJPUvw==","_resolved":"/private/var/folders/4_/lqz91lx14tv_4ln6g68fz4200000gn/T/a2be504f0058887ed5df7f1c6463a955/akrc-vite-plugin-monaco-editor-2.0.0.tgz","_from":"file:akrc-vite-plugin-monaco-editor-2.0.0.tgz","_nodeVersion":"21.1.0","_npmVersion":"10.2.0","dist":{"integrity":"sha512-UUjGRNHBDk26SX4hkKzRKmaNZ5n2hHIEHw/kSJoh81IgW5xSR+0uePh/yn7gt//AxHHC6TTP3FbuVEiExJPUvw==","shasum":"a6aeb826bef3208284872b8311d2c0feac613296","tarball":"https://registry.npmjs.org/@akrc/vite-plugin-monaco-editor/-/vite-plugin-monaco-editor-2.0.0.tgz","fileCount":16,"unpackedSize":12773026,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCthQJffCyboti0i4kyguCdqlCffnyOaDJ4yy2drXVhPQIgV8o/eZG/orZ9jgJ1DL47ArEIONSlWmdmxwpJtIqtpF8="}]},"_npmUser":{"name":"akarachen","email":"akarachen@outlook.com"},"directories":{},"maintainers":[{"name":"akarachen","email":"akarachen@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vite-plugin-monaco-editor_2.0.0_1701835257829_0.06336248185782112"},"_hasShrinkwrap":false},"2.0.1":{"name":"@akrc/vite-plugin-monaco-editor","version":"2.0.1","description":"A vite plugin for the Monaco Editor","type":"module","author":{"name":"china-bin && akarachen"},"license":"MIT","keywords":["vite-plugin","monaco","editor"],"repository":{"type":"git","url":"git+https://github.com/akarachen/vite-plugin-monaco-editor.git"},"publishConfig":{"registry":"https://registry.npmjs.org"},"devDependencies":{"@okikio/sharedworker":"^1.0.3","@types/fs-extra":"^9.0.13","@types/node":"^16.4.13","@vitejs/plugin-vue":"^1.4.0","@vue/compiler-sfc":"^3.1.5","fs-extra":"^10.0.0","http-server":"^13.0.2","monaco-editor":"^0.33.0","monaco-graphql":"^0.4.4","typescript":"^4.9.5","vite":"^2.9.16","vue":"^3.1.5","vue-router":"^4.0.12"},"peerDependencies":{"monaco-editor":">=0.33.0"},"exports":{".":{"import":"./dist/index.js","types":"./dist/index.d.ts"}},"scripts":{"build":"tsc","prepublish":"npm run copy:cdn","test:build":"npm run build && vite build --config test/vite.config.js","test:dev":"npm run build && vite --config test/vite.config.js","test:preview":"vite preview --config test/vite.config.js","simulator:cdn":"http-server cdn/ --port 8888","copy:cdn":"node script/updateCDN.js"},"bugs":{"url":"https://github.com/akarachen/vite-plugin-monaco-editor/issues"},"homepage":"https://github.com/akarachen/vite-plugin-monaco-editor#readme","_id":"@akrc/vite-plugin-monaco-editor@2.0.1","_integrity":"sha512-U6AjXDkO1cz+f9RCNTi/db9kYb0p1AU8EnSOGFgoEOOtdPJDWyhY/pX8PLOkZiib8/CEQ6DrW2L6LKVMyMfE5A==","_resolved":"/private/var/folders/4_/lqz91lx14tv_4ln6g68fz4200000gn/T/9329809a41a7de0877cc1a6c73ad2be2/akrc-vite-plugin-monaco-editor-2.0.1.tgz","_from":"file:akrc-vite-plugin-monaco-editor-2.0.1.tgz","_nodeVersion":"21.1.0","_npmVersion":"10.2.0","dist":{"integrity":"sha512-U6AjXDkO1cz+f9RCNTi/db9kYb0p1AU8EnSOGFgoEOOtdPJDWyhY/pX8PLOkZiib8/CEQ6DrW2L6LKVMyMfE5A==","shasum":"9291bffc09fe38f380d96df05efa6b1608601bdd","tarball":"https://registry.npmjs.org/@akrc/vite-plugin-monaco-editor/-/vite-plugin-monaco-editor-2.0.1.tgz","fileCount":16,"unpackedSize":12773072,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGM0JAhtqm9+Ebi3VPsOTIJ487Nl7R3UOkYgWPQZ1w0WAiEA9sSZhPFQvA64UOsQ9YDFNUUGWrGzHbTrLvxQbqR6Ng0="}]},"_npmUser":{"name":"akarachen","email":"akarachen@outlook.com"},"directories":{},"maintainers":[{"name":"akarachen","email":"akarachen@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vite-plugin-monaco-editor_2.0.1_1701836275417_0.7556017577726635"},"_hasShrinkwrap":false},"3.0.0":{"name":"@akrc/vite-plugin-monaco-editor","version":"3.0.0","description":"A vite plugin for the Monaco Editor","type":"module","scripts":{"build":"tsc","prepublish":"npm run copy:cdn","test:build":"npm run build && vite build --config test/vite.config.js","test:dev":"npm run build && vite --config test/vite.config.js","test:preview":"vite preview --config test/vite.config.js","simulator:cdn":"http-server cdn/ --port 8888","copy:cdn":"node script/updateCDN.js"},"author":{"name":"china-bin && akarachen"},"license":"MIT","keywords":["vite-plugin","monaco","editor"],"repository":{"type":"git","url":"git+https://github.com/akarachen/vite-plugin-monaco-editor.git"},"publishConfig":{"registry":"https://registry.npmjs.org"},"devDependencies":{"@okikio/sharedworker":"^1.0.3","@types/fs-extra":"^9.0.13","@types/node":"^16.4.13","@vitejs/plugin-vue":"^1.4.0","@vue/compiler-sfc":"^3.1.5","fs-extra":"^10.0.0","http-server":"^13.0.2","monaco-editor":"^0.33.0","monaco-graphql":"^0.4.4","typescript":"^4.9.5","vite":"^2.9.16","vue":"^3.1.5","vue-router":"^4.0.12"},"peerDependencies":{"monaco-editor":">=0.33.0"},"exports":{".":{"import":"./dist/index.js","types":"./dist/index.d.ts"}},"dependencies":{"esbuild":"^0.20.2"},"_id":"@akrc/vite-plugin-monaco-editor@3.0.0","gitHead":"7a6032b760fdb670c070de8993a599ee61e76ae2","bugs":{"url":"https://github.com/akarachen/vite-plugin-monaco-editor/issues"},"homepage":"https://github.com/akarachen/vite-plugin-monaco-editor#readme","_nodeVersion":"21.1.0","_npmVersion":"10.2.0","dist":{"integrity":"sha512-bh75oRIq3Yj/mz1WmZU0np1TC21Uj3yA5moeLoIjnEE77xa8I6g0aY3ziKIplr+PPnp8H4Cj5yl5tmfS2lMIyw==","shasum":"3b8cfa61a90a4babbb94cc342407c66c301be175","tarball":"https://registry.npmjs.org/@akrc/vite-plugin-monaco-editor/-/vite-plugin-monaco-editor-3.0.0.tgz","fileCount":16,"unpackedSize":12882443,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC3Hme6y3+25HVJfXgvSzsuEHECPaaXN3yTXcSEjM8CiwIgLw15vOP5+jpeK3YPn27IGvl9+CUYV0KJGYBpmumP97s="}]},"_npmUser":{"name":"akarachen","email":"akarachen@outlook.com"},"directories":{},"maintainers":[{"name":"akarachen","email":"akarachen@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vite-plugin-monaco-editor_3.0.0_1714964804996_0.3710089760453621"},"_hasShrinkwrap":false}},"time":{"created":"2023-12-06T04:00:57.748Z","2.0.0":"2023-12-06T04:00:58.105Z","modified":"2024-05-06T03:06:45.347Z","2.0.1":"2023-12-06T04:17:55.627Z","3.0.0":"2024-05-06T03:06:45.171Z"},"maintainers":[{"name":"akarachen","email":"akarachen@outlook.com"}],"description":"A vite plugin for the Monaco Editor","homepage":"https://github.com/akarachen/vite-plugin-monaco-editor#readme","keywords":["vite-plugin","monaco","editor"],"repository":{"type":"git","url":"git+https://github.com/akarachen/vite-plugin-monaco-editor.git"},"author":{"name":"china-bin && akarachen"},"bugs":{"url":"https://github.com/akarachen/vite-plugin-monaco-editor/issues"},"license":"MIT","readme":"# Vite Plugin Monaco Editor\n\nA plugin to simplify loading the [Monaco Editor](https://github.com/Microsoft/monaco-editor) with [vite](https://vitejs.dev/).\n\n- It uses Vite specific plugin hooks: configResolved, configureServer, transformIndexHtml.\n- It uses esbuild to bundle worker in the `node_modules/.monaco` directory, via the `server.middlewares` proxy http server for the bundle worker.\n\n## Installing\n\n```ts\n// make sure you have it installed monaco-editor.\n\nyarn add vite-plugin-monaco-editor -D\n\n// or\nnpm install --save-dev vite-plugin-monaco-editor\n```\n\n## Using\n\n- `vite.config.ts`:\n\n```ts\nimport { defineConfig } from 'vite';\nimport monacoEditorPlugin from 'vite-plugin-monaco-editor';\n\nexport default defineConfig({\n  plugins: [monacoEditorPlugin()],\n});\n```\n\n### Import all monaco functions\n\n- `index.ts`:\n\n```ts\nimport * as monaco from 'monaco-editor';\n\nmonaco.editor.create(document.getElementById('container'), {\n  value: 'console.log(\"Hello, world\")',\n  language: 'javascript',\n});\n```\n\n### Import part of monaco functions\n\nThe `import * as monaco from 'monaco-editor'` is import all features and languages of the Monaco Editor. Assume you only need part of the features and languages:\n\n- `customMonaco.ts`\n\n```ts\nimport 'monaco-editor/esm/vs/editor/editor.all.js';\nimport 'monaco-editor/esm/vs/editor/standalone/browser/accessibilityHelp/accessibilityHelp.js';\n\nimport * as monaco from 'monaco-editor/esm/vs/editor/editor.api';\n\nexport { monaco };\n```\n\nThe Complete list of imports: [customMonaco.ts](test/src/mona/customMonaco.ts)\n\n- `index.ts`\n\n```ts\nimport { monaco } from './customMonaco.ts';\nmonaco.editor.create(document.getElementById('container'), {\n  value: 'console.log(\"Hello, world\")',\n  language: 'javascript',\n});\n```\n\n## Options\n\n- `languageWorkers` (`string[]`) - include only a subset of the languageWorkers supported.\n\n  - default value: ['editorWorkerService', 'css', 'html', 'json', 'typescript'].\n  - Assuming only use css worker(editorWorkerService is must include base worker), you can set ['editorWorkerService', 'css']\n\n- `customWorkers` (`IWorkerDefinition[]`) - include your custom worker.\n\n  - default value: []\n  - example value: `[{label: \"graphql\", entry: \"monaco-graphql/esm/graphql.worker\"}]`, The `entry` is relative path in the node_modules Or you can set absolute path.\n\n- `publicPath` (`string`) - custom public path for worker scripts, overrides the public path from which files generated by this plugin will be served. Or you can set CDN e.g `https://unpkg.com/vite-plugin-monaco-editor@1.0.5/cdn`\n\n  - default value: `monacoeditorwork`\n\n- `globalAPI` (`boolean`) - specifies whether the editor API should be exposed through a global `monaco` object or not. This option is applicable to `0.22.0` and newer version of `monaco-editor`. Since `0.22.0`, the ESM version of the monaco editor does no longer define a global `monaco` object unless `global.MonacoEnvironment = { globalAPI: true }` is set ([change log](https://github.com/microsoft/monaco-editor/blob/main/CHANGELOG.md#0220-29012021)).\n  - default value: `false`.\n- `customDistPath` (`(root: string, buildOutDir: string, base: string) => string`) - Custom callback returns the worker path\n- `forceBuildCDN` (`boolean`) - If you use CDN, the build is skipped by default. Set to true if you want to generate woker\n  - default value: `false`\n\nSome languages share the same web worker. If one of the following languages is included, you must also include the language responsible for instantiating their shared worker:\n\n| Language   | Instantiator |\n| ---------- | ------------ |\n| javascript | typescript   |\n| handlebars | html         |\n| scss, less | css          |\n","readmeFilename":"README.md"}