nuxt-monaco-editor 1.1.3-beta.0 → 1.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [1.1.3](https://github.com/e-chan1007/nuxt-monaco-editor/compare/v1.1.3-beta.0...v1.1.3) (2023-01-28)
6
+
7
+
8
+ ### ⚠ BREAKING CHANGES
9
+
10
+ * drop support for `nuxt@^3.0.0` ([1d4d22c](https://github.com/e-chan1007/nuxt-monaco-editor/commit/1d4d22cf094abad4b2f475151483b87c6a9b4589))
11
+
5
12
  ### [1.1.3-beta.0](https://github.com/e-chan1007/nuxt-monaco-editor/compare/v1.1.2...v1.1.3-beta.0) (2023-01-27)
6
13
 
7
14
 
package/dist/module.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "nuxt-monaco-editor",
3
3
  "configKey": "monacoEditor",
4
4
  "compatibility": {
5
- "nuxt": "^3.0.0"
5
+ "nuxt": "^3.1.0"
6
6
  },
7
- "version": "1.1.3-beta.0"
7
+ "version": "1.1.3"
8
8
  }
package/dist/module.mjs CHANGED
@@ -23,7 +23,7 @@ const module = defineNuxtModule({
23
23
  meta: {
24
24
  name: "nuxt-monaco-editor",
25
25
  configKey: "monacoEditor",
26
- compatibility: { nuxt: "^3.0.0" }
26
+ compatibility: { nuxt: "^3.1.0" }
27
27
  },
28
28
  defaults: DEFAULTS,
29
29
  setup(options, nuxt) {
@@ -31,7 +31,6 @@ const module = defineNuxtModule({
31
31
  const { resolve: resolveURL } = createResolver(nuxt.options.app.baseURL);
32
32
  const { resolve } = createResolver(runtimeDir);
33
33
  const monacoEditorLocation = resolveURL(options.dest);
34
- nuxt.options.app.head.script?.push({ src: `${monacoEditorLocation}/vs/loader.js` });
35
34
  nuxt.options.build.transpile.push(runtimeDir);
36
35
  nuxt.options.build.transpile.push(({ isClient }) => isClient ? "monaco-editor" : false);
37
36
  nuxt.options.runtimeConfig.app.__MONACO_EDITOR_LOCALE__ = options.locale;
@@ -2,19 +2,24 @@ import { defineNuxtPlugin, useRuntimeConfig } from "#app";
2
2
  import { _useMonacoState } from "./composables.mjs";
3
3
  export default defineNuxtPlugin((_nuxtApp) => new Promise((resolve) => {
4
4
  const monacoState = _useMonacoState();
5
- const { __MONACO_EDITOR_LOCALE__: locale, __MONACO_EDITOR_LOCATION__: monacoLocation } = useRuntimeConfig().app;
6
- require.config({ paths: { vs: `${monacoLocation}/vs` } });
7
- if (locale !== "en") {
8
- require.config({
9
- "vs/nls": {
10
- availableLanguages: {
11
- "*": locale
5
+ const { __MONACO_EDITOR_LOCALE__: locale, __MONACO_EDITOR_LOCATION__: monacoEditorLocation } = useRuntimeConfig().app;
6
+ const loaderScript = document.createElement("script");
7
+ loaderScript.src = `${monacoEditorLocation}/vs/loader.js`;
8
+ loaderScript.addEventListener("load", () => {
9
+ require.config({ paths: { vs: `${monacoEditorLocation}/vs` } });
10
+ if (locale !== "en") {
11
+ require.config({
12
+ "vs/nls": {
13
+ availableLanguages: {
14
+ "*": locale
15
+ }
12
16
  }
13
- }
17
+ });
18
+ }
19
+ require(["vs/editor/editor.main"], (monaco) => {
20
+ monacoState.value = monaco;
21
+ resolve();
14
22
  });
15
- }
16
- require(["vs/editor/editor.main"], (monaco) => {
17
- monacoState.value = monaco;
18
- resolve();
19
23
  });
24
+ document.body.appendChild(loaderScript);
20
25
  }));
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "type": "git",
12
12
  "url": "https://github.com/e-chan1007/nuxt-monaco-editor.git"
13
13
  },
14
- "version": "1.1.3-beta.0",
14
+ "version": "1.1.3",
15
15
  "type": "module",
16
16
  "license": "MIT",
17
17
  "exports": {