nuxt-maplibre-gl 2.0.2 → 2.1.0

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/README.md CHANGED
@@ -8,7 +8,7 @@
8
8
 
9
9
  - Auto-imports all 10 map components (Maplibre, GeoJsonSource, FillLayer, etc.)
10
10
  - Auto-imports all 38 composables (useFlyTo, useMapEventListener, etc.)
11
- - Auto-imports CSS — both `maplibre-gl/dist/maplibre-gl.css` and `vue3-maplibre-gl/dist/style.css`
11
+ - Auto-imports CSS — `vue3-maplibre-gl/dist/style-with-maplibre.css`, which is MapLibre's own stylesheet plus the library's container rules
12
12
  - SSR-safe — components register client-only, `maplibre-gl` is kept out of the server bundle
13
13
  - Zero configuration required
14
14
 
package/dist/module.d.mts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as _nuxt_schema from '@nuxt/schema';
2
2
 
3
3
  interface ModuleOptions {
4
- /** Auto-import the MapLibre GL and vue3-maplibre-gl stylesheets (default: true) */
4
+ /** Auto-import the combined MapLibre GL + vue3-maplibre-gl stylesheet (default: true) */
5
5
  css?: boolean;
6
6
  /** Prefix for auto-imported composables (default: none) */
7
7
  prefix?: string;
package/dist/module.json CHANGED
@@ -10,7 +10,7 @@
10
10
  "compatibility": {
11
11
  "nuxt": ">=3.0.0"
12
12
  },
13
- "version": "2.0.2",
13
+ "version": "2.1.0",
14
14
  "builder": {
15
15
  "@nuxt/module-builder": "1.0.2",
16
16
  "unbuild": "3.6.1"
package/dist/module.mjs CHANGED
@@ -1,4 +1,5 @@
1
1
  import { defineNuxtModule, createResolver, addPlugin, addImports } from '@nuxt/kit';
2
+ import { existsSync } from 'node:fs';
2
3
 
3
4
  const module$1 = defineNuxtModule({
4
5
  meta: {
@@ -24,10 +25,15 @@ const module$1 = defineNuxtModule({
24
25
  async setup(options, nuxt) {
25
26
  const { resolve, resolvePath } = createResolver(import.meta.url);
26
27
  if (options.css) {
27
- nuxt.options.css.push(
28
- await resolvePath("maplibre-gl/dist/maplibre-gl.css"),
29
- await resolvePath("vue3-maplibre-gl/dist/style.css")
28
+ const stylesheet = await resolvePath(
29
+ "vue3-maplibre-gl/dist/style-with-maplibre.css"
30
30
  );
31
+ if (!existsSync(stylesheet)) {
32
+ throw new Error(
33
+ "nuxt-maplibre-gl could not find vue3-maplibre-gl/dist/style-with-maplibre.css. That file ships from vue3-maplibre-gl 6.1.0 onwards \u2014 upgrade it, or set `maplibre: { css: false }` and import the stylesheets yourself."
34
+ );
35
+ }
36
+ nuxt.options.css.push(stylesheet);
31
37
  }
32
38
  nuxt.options.build.transpile.push("vue3-maplibre-gl");
33
39
  nuxt.options.vite.optimizeDeps ??= {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nuxt-maplibre-gl",
3
- "version": "2.0.2",
3
+ "version": "2.1.0",
4
4
  "description": "Nuxt module for vue3-maplibre-gl — auto-import components, composables, CSS, and SSR configuration",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -51,7 +51,7 @@
51
51
  "dependencies": {
52
52
  "@nuxt/kit": "^3.15.0",
53
53
  "maplibre-gl": "^5.6.1",
54
- "vue3-maplibre-gl": "^6.0.0"
54
+ "vue3-maplibre-gl": "^6.1.0"
55
55
  },
56
56
  "devDependencies": {
57
57
  "@nuxt/module-builder": "^1.0.2",