nuxt-maplibre-gl 2.0.1 → 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 +1 -1
- package/dist/module.d.mts +1 -1
- package/dist/module.json +1 -1
- package/dist/module.mjs +9 -3
- package/package.json +5 -5
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 —
|
|
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
|
|
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
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
|
-
|
|
28
|
-
|
|
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
|
|
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",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
},
|
|
15
15
|
"repository": {
|
|
16
16
|
"type": "git",
|
|
17
|
-
"url": "https://github.com/danh121097/vue-maplibre-gl",
|
|
17
|
+
"url": "git+https://github.com/danh121097/vue-maplibre-gl.git",
|
|
18
18
|
"directory": "nuxt"
|
|
19
19
|
},
|
|
20
20
|
"keywords": [
|
|
@@ -45,13 +45,13 @@
|
|
|
45
45
|
"scripts": {
|
|
46
46
|
"dev:prepare": "nuxt-module-build build --stub && nuxi prepare playground",
|
|
47
47
|
"dev": "nuxi dev playground",
|
|
48
|
-
"build": "nuxt-module-build build",
|
|
49
|
-
"prepack": "
|
|
48
|
+
"build": "nuxt-module-build build --stub && nuxi prepare playground && nuxt-module-build build",
|
|
49
|
+
"prepack": "npm run build"
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
52
|
"@nuxt/kit": "^3.15.0",
|
|
53
53
|
"maplibre-gl": "^5.6.1",
|
|
54
|
-
"vue3-maplibre-gl": "^6.
|
|
54
|
+
"vue3-maplibre-gl": "^6.1.0"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
57
|
"@nuxt/module-builder": "^1.0.2",
|