├── .gitignore ├── CHANGELOG.md ├── LICENSE ├── README.md ├── example └── nuxt-leaflet-example │ ├── .editorconfig │ ├── .gitignore │ ├── README.md │ ├── assets │ ├── README.md │ └── style │ │ ├── app.styl │ │ └── variables.styl │ ├── components │ ├── Logo.vue │ ├── README.md │ └── VuetifyLogo.vue │ ├── layouts │ ├── README.md │ └── default.vue │ ├── middleware │ └── README.md │ ├── nuxt.config.js │ ├── package-lock.json │ ├── package.json │ ├── pages │ ├── README.md │ ├── index.vue │ └── inspire.vue │ ├── plugins │ ├── README.md │ └── vuetify.js │ ├── static │ ├── README.md │ ├── favicon.ico │ └── v.png │ └── store │ └── README.md ├── index.d.ts ├── lib ├── module.js └── templates │ └── plugin.js ├── package-lock.json ├── package.json ├── test ├── fixture │ ├── nuxt.config.js │ └── pages │ │ └── index.vue └── module.test.js └── yarn.lock /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules/ 3 | npm-debug.log 4 | 5 | .idea/ -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 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 | 5 | 6 | # [](https://github.com/schlunsen/nuxt-leaflet/compare/v0.0.11...v) (2019-01-18) 7 | 8 | 9 | 10 | 11 | # [](https://github.com/schlunsen/nuxt-leaflet/compare/v0.0.11...v) (2019-01-18) 12 | 13 | 14 | 15 | 16 | ## [0.0.11](https://github.com/schlunsen/nuxt-leaflet/compare/v0.0.10...v0.0.11) (2018-11-10) 17 | 18 | 19 | 20 | 21 | ## [0.0.10](https://github.com/schlunsen/nuxt-leaflet/compare/v0.0.9...v0.0.10) (2018-04-19) 22 | 23 | 24 | 25 | 26 | ## [0.0.9](https://github.com/schlunsen/nuxt-leaflet/compare/v0.0.8...v0.0.9) (2018-04-09) 27 | 28 | 29 | 30 | 31 | ## 0.0.8 (2018-04-06) 32 | 33 | 34 | 35 | 36 | ## 0.0.7 (2018-03-13) 37 | 38 | 39 | 40 | 41 | ## [0.0.6](https://github.com/schlunsen/nuxt-leaflet/compare/v0.0.5...v0.0.6) (2018-03-13) 42 | 43 | 44 | 45 | 46 | ## [0.0.5](https://github.com/schlunsen/nuxt-leaflet/compare/v0.0.4...v0.0.5) (2018-03-13) 47 | 48 | 49 | 50 | 51 | ## [0.0.4](https://github.com/schlunsen/nuxt-leaflet/compare/v0.0.3...v0.0.4) (2018-03-13) 52 | 53 | 54 | 55 | 56 | ## [0.0.3](https://github.com/schlunsen/nuxt-leaflet/compare/v0.0.2...v0.0.3) (2018-03-13) 57 | 58 | 59 | 60 | 61 | ## [0.0.2](https://github.com/schlunsen/nuxt-leaflet/compare/v0.0.1...v0.0.2) (2018-03-13) 62 | 63 | 64 | 65 | 66 | ## 0.0.1 (2018-03-13) 67 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) Rasmus Schlunsen 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # nuxt-leaflet 2 | [![npm (scoped with tag)](https://img.shields.io/npm/v/nuxt-leaflet/latest.svg?style=flat-square)](https://npmjs.com/package/nuxt-leaflet) 3 | [![npm](https://img.shields.io/npm/dt/nuxt-leaflet.svg?style=flat-square)](https://npmjs.com/package/nuxt-leaflet) 4 | [![js-standard-style](https://img.shields.io/badge/code_style-standard-brightgreen.svg?style=flat-square)](http://standardjs.com) 5 | 6 | > Nuxt module for leafletjs 7 | 8 | [📖 **Release Notes**](./CHANGELOG.md) 9 | 10 | ## Features 11 | 12 | Nuxt module for vue2-leaflet. 13 | 14 | See [vue2-leaflet](https://github.com/KoRiGaN/Vue2Leaflet) for more details. 15 | 16 | 17 | ## Setup 18 | - Add `nuxt-leaflet` dependency using yarn or npm to your project 19 | - Add `nuxt-leaflet` to `modules` section of `nuxt.config.js` 20 | 21 | ```js 22 | { 23 | modules: [ 24 | // Simple usage 25 | 'nuxt-leaflet', 26 | 27 | // With options 28 | ['nuxt-leaflet', { /* module options */ }], 29 | ] 30 | } 31 | ``` 32 | 33 | ## Usage 34 | 35 | 36 | Add the map to your page 37 | ``` html 38 |
39 | 40 | 41 | 42 | 43 | 44 | 45 |
46 | ``` 47 | 48 | The Leaflet 'L' object can be found on vue component: ```this.$L``` 49 | 50 | ## Typescript 51 | 52 | If you're using TypeScript, you'll need to add nuxt-leaflet in your compilerOptions of your tsconfig.json : 53 | 54 | ```json 55 | { 56 | "compilerOptions": { 57 | "types": [ 58 | "@types/node", 59 | "@nuxt/vue-app", 60 | "nuxt-leaflet" 61 | ] 62 | } 63 | } 64 | ``` 65 | 66 | You'll then be able to have autocompletion in Vue instances (```this.$L```). 67 | 68 | 69 | ## List of currently implemented components 70 | 71 | See [components](https://github.com/schlunsen/nuxt-leaflet/blob/master/lib/templates/plugin.js) supported 72 | 73 | 74 | ## Development 75 | 76 | - Clone this repository 77 | - Install dependencies using `yarn install` or `npm install` 78 | - Start development server using `npm run dev` 79 | 80 | ## License 81 | 82 | [MIT License](./LICENSE) 83 | 84 | Copyright (c) Rasmus Schlunsen 85 | -------------------------------------------------------------------------------- /example/nuxt-leaflet-example/.editorconfig: -------------------------------------------------------------------------------- 1 | # editorconfig.org 2 | root = true 3 | 4 | [*] 5 | indent_style = space 6 | indent_size = 2 7 | end_of_line = lf 8 | charset = utf-8 9 | trim_trailing_whitespace = true 10 | insert_final_newline = true 11 | 12 | [*.md] 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /example/nuxt-leaflet-example/.gitignore: -------------------------------------------------------------------------------- 1 | # Created by .ignore support plugin (hsz.mobi) 2 | ### Node template 3 | # Logs 4 | logs 5 | *.log 6 | npm-debug.log* 7 | yarn-debug.log* 8 | yarn-error.log* 9 | 10 | # Runtime data 11 | pids 12 | *.pid 13 | *.seed 14 | *.pid.lock 15 | 16 | # Directory for instrumented libs generated by jscoverage/JSCover 17 | lib-cov 18 | 19 | # Coverage directory used by tools like istanbul 20 | coverage 21 | 22 | # nyc test coverage 23 | .nyc_output 24 | 25 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 26 | .grunt 27 | 28 | # Bower dependency directory (https://bower.io/) 29 | bower_components 30 | 31 | # node-waf configuration 32 | .lock-wscript 33 | 34 | # Compiled binary addons (https://nodejs.org/api/addons.html) 35 | build/Release 36 | 37 | # Dependency directories 38 | node_modules/ 39 | jspm_packages/ 40 | 41 | # TypeScript v1 declaration files 42 | typings/ 43 | 44 | # Optional npm cache directory 45 | .npm 46 | 47 | # Optional eslint cache 48 | .eslintcache 49 | 50 | # Optional REPL history 51 | .node_repl_history 52 | 53 | # Output of 'npm pack' 54 | *.tgz 55 | 56 | # Yarn Integrity file 57 | .yarn-integrity 58 | 59 | # dotenv environment variables file 60 | .env 61 | 62 | # parcel-bundler cache (https://parceljs.org/) 63 | .cache 64 | 65 | # next.js build output 66 | .next 67 | 68 | # nuxt.js build output 69 | .nuxt 70 | 71 | # Nuxt generate 72 | dist 73 | 74 | # vuepress build output 75 | .vuepress/dist 76 | 77 | # Serverless directories 78 | .serverless 79 | 80 | # IDE 81 | .idea 82 | 83 | # Service worker 84 | sw.* 85 | -------------------------------------------------------------------------------- /example/nuxt-leaflet-example/README.md: -------------------------------------------------------------------------------- 1 | # nuxt-leaflet-example 2 | 3 | > Example of nuxt-leaflet 4 | 5 | ## Build Setup 6 | 7 | ``` bash 8 | # install dependencies 9 | $ npm install 10 | 11 | # serve with hot reload at localhost:3000 12 | $ npm run dev 13 | 14 | # build for production and launch server 15 | $ npm run build 16 | $ npm start 17 | 18 | # generate static project 19 | $ npm run generate 20 | ``` 21 | 22 | For detailed explanation on how things work, checkout [Nuxt.js docs](https://nuxtjs.org). 23 | -------------------------------------------------------------------------------- /example/nuxt-leaflet-example/assets/README.md: -------------------------------------------------------------------------------- 1 | # ASSETS 2 | 3 | **This directory is not required, you can delete it if you don't want to use it.** 4 | 5 | This directory contains your un-compiled assets such as LESS, SASS, or JavaScript. 6 | 7 | More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/assets#webpacked). 8 | -------------------------------------------------------------------------------- /example/nuxt-leaflet-example/assets/style/app.styl: -------------------------------------------------------------------------------- 1 | // Import Vuetify styling 2 | @require '~vuetify/src/stylus/app.styl' 3 | -------------------------------------------------------------------------------- /example/nuxt-leaflet-example/assets/style/variables.styl: -------------------------------------------------------------------------------- 1 | @require '~vuetify/src/stylus/settings/_variables.styl' 2 | -------------------------------------------------------------------------------- /example/nuxt-leaflet-example/components/Logo.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 80 | -------------------------------------------------------------------------------- /example/nuxt-leaflet-example/components/README.md: -------------------------------------------------------------------------------- 1 | # COMPONENTS 2 | 3 | **This directory is not required, you can delete it if you don't want to use it.** 4 | 5 | The components directory contains your Vue.js Components. 6 | 7 | _Nuxt.js doesn't supercharge these components._ 8 | -------------------------------------------------------------------------------- /example/nuxt-leaflet-example/components/VuetifyLogo.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 22 | -------------------------------------------------------------------------------- /example/nuxt-leaflet-example/layouts/README.md: -------------------------------------------------------------------------------- 1 | # LAYOUTS 2 | 3 | **This directory is not required, you can delete it if you don't want to use it.** 4 | 5 | This directory contains your Application Layouts. 6 | 7 | More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/views#layouts). 8 | -------------------------------------------------------------------------------- /example/nuxt-leaflet-example/layouts/default.vue: -------------------------------------------------------------------------------- 1 | 88 | 89 | 116 | -------------------------------------------------------------------------------- /example/nuxt-leaflet-example/middleware/README.md: -------------------------------------------------------------------------------- 1 | # MIDDLEWARE 2 | 3 | **This directory is not required, you can delete it if you don't want to use it.** 4 | 5 | This directory contains your application middleware. 6 | Middleware let you define custom functions that can be run before rendering either a page or a group of pages. 7 | 8 | More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/routing#middleware). 9 | -------------------------------------------------------------------------------- /example/nuxt-leaflet-example/nuxt.config.js: -------------------------------------------------------------------------------- 1 | import VuetifyLoaderPlugin from 'vuetify-loader/lib/plugin' 2 | import pkg from './package' 3 | 4 | export default { 5 | mode: 'universal', 6 | 7 | /* 8 | ** Headers of the page 9 | */ 10 | head: { 11 | title: pkg.name, 12 | meta: [ 13 | { charset: 'utf-8' }, 14 | { name: 'viewport', content: 'width=device-width, initial-scale=1' }, 15 | { hid: 'description', name: 'description', content: pkg.description } 16 | ], 17 | link: [ 18 | { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }, 19 | { 20 | rel: 'stylesheet', 21 | href: 22 | 'https://fonts.googleapis.com/css?family=Roboto:300,400,500,700|Material+Icons' 23 | } 24 | ] 25 | }, 26 | 27 | /* 28 | ** Customize the progress-bar color 29 | */ 30 | loading: { color: '#fff' }, 31 | 32 | /* 33 | ** Global CSS 34 | */ 35 | css: [ 36 | '~/assets/style/app.styl' 37 | ], 38 | 39 | /* 40 | ** Plugins to load before mounting the App 41 | */ 42 | plugins: [ 43 | '@/plugins/vuetify' 44 | ], 45 | 46 | /* 47 | ** Nuxt.js modules 48 | */ 49 | modules: [ 50 | ['nuxt-leaflet', { /* module options */ }], 51 | ], 52 | 53 | /* 54 | ** Build configuration 55 | */ 56 | build: { 57 | transpile: ['vuetify/lib'], 58 | plugins: [new VuetifyLoaderPlugin()], 59 | loaders: { 60 | stylus: { 61 | import: ['~assets/style/variables.styl'] 62 | } 63 | }, 64 | /* 65 | ** You can extend webpack config here 66 | */ 67 | extend(config, ctx) { 68 | } 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /example/nuxt-leaflet-example/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "nuxt-leaflet-example", 3 | "version": "1.0.0", 4 | "description": "Example of nuxt-leaflet", 5 | "author": "Rasmus Schlünsen", 6 | "private": true, 7 | "scripts": { 8 | "dev": "nuxt", 9 | "build": "nuxt build", 10 | "start": "nuxt start", 11 | "generate": "nuxt generate" 12 | }, 13 | "dependencies": { 14 | "cross-env": "^5.2.0", 15 | "nuxt": "^2.4.0", 16 | "nuxt-leaflet": "0.0.17", 17 | "vuetify": "^1.5.5", 18 | "vuetify-loader": "^1.2.1" 19 | }, 20 | "devDependencies": { 21 | "nodemon": "^1.18.9", 22 | "stylus": "^0.54.5", 23 | "stylus-loader": "^3.0.2" 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /example/nuxt-leaflet-example/pages/README.md: -------------------------------------------------------------------------------- 1 | # PAGES 2 | 3 | This directory contains your Application Views and Routes. 4 | The framework reads all the `*.vue` files inside this directory and creates the router of your application. 5 | 6 | More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/routing). 7 | -------------------------------------------------------------------------------- /example/nuxt-leaflet-example/pages/index.vue: -------------------------------------------------------------------------------- 1 | 13 | 20 | 21 | -------------------------------------------------------------------------------- /example/nuxt-leaflet-example/pages/inspire.vue: -------------------------------------------------------------------------------- 1 | 20 | -------------------------------------------------------------------------------- /example/nuxt-leaflet-example/plugins/README.md: -------------------------------------------------------------------------------- 1 | # PLUGINS 2 | 3 | **This directory is not required, you can delete it if you don't want to use it.** 4 | 5 | This directory contains Javascript plugins that you want to run before mounting the root Vue.js application. 6 | 7 | More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/plugins). 8 | -------------------------------------------------------------------------------- /example/nuxt-leaflet-example/plugins/vuetify.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import Vuetify from 'vuetify/lib' 3 | import colors from 'vuetify/es5/util/colors' 4 | 5 | Vue.use(Vuetify, { 6 | theme: { 7 | primary: colors.blue.darken2, 8 | accent: colors.grey.darken3, 9 | secondary: colors.amber.darken3, 10 | info: colors.teal.lighten1, 11 | warning: colors.amber.base, 12 | error: colors.deepOrange.accent4, 13 | success: colors.green.accent3 14 | } 15 | }) 16 | -------------------------------------------------------------------------------- /example/nuxt-leaflet-example/static/README.md: -------------------------------------------------------------------------------- 1 | # STATIC 2 | 3 | **This directory is not required, you can delete it if you don't want to use it.** 4 | 5 | This directory contains your static files. 6 | Each file inside this directory is mapped to `/`. 7 | Thus you'd want to delete this README.md before deploying to production. 8 | 9 | Example: `/static/robots.txt` is mapped as `/robots.txt`. 10 | 11 | More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/assets#static). 12 | -------------------------------------------------------------------------------- /example/nuxt-leaflet-example/static/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/schlunsen/nuxt-leaflet/1d06108afa20001660fd576ae45f0ae43175dd41/example/nuxt-leaflet-example/static/favicon.ico -------------------------------------------------------------------------------- /example/nuxt-leaflet-example/static/v.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/schlunsen/nuxt-leaflet/1d06108afa20001660fd576ae45f0ae43175dd41/example/nuxt-leaflet-example/static/v.png -------------------------------------------------------------------------------- /example/nuxt-leaflet-example/store/README.md: -------------------------------------------------------------------------------- 1 | # STORE 2 | 3 | **This directory is not required, you can delete it if you don't want to use it.** 4 | 5 | This directory contains your Vuex Store files. 6 | Vuex Store option is implemented in the Nuxt.js framework. 7 | 8 | Creating a file in this directory automatically activates the option in the framework. 9 | 10 | More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/vuex-store). 11 | -------------------------------------------------------------------------------- /index.d.ts: -------------------------------------------------------------------------------- 1 | import * as L from "leaflet"; 2 | 3 | declare module "vue/types/vue" { 4 | interface Vue { 5 | $L: typeof L; 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /lib/module.js: -------------------------------------------------------------------------------- 1 | const { resolve } = require('path') 2 | 3 | module.exports = async function module (moduleOptions) { 4 | const options = Object.assign({}, moduleOptions) 5 | 6 | // Add leaflet css 7 | this.options.css.push('leaflet/dist/leaflet.css') 8 | 9 | this.addPlugin({ 10 | src: resolve(__dirname, 'templates/plugin.js'), 11 | fileName: 'nuxt-leaflet.js', 12 | ssr: false, 13 | options 14 | }) 15 | } 16 | -------------------------------------------------------------------------------- /lib/templates/plugin.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import * as Vue2Leaflet from 'vue2-leaflet' 3 | 4 | Vue.component('l-circle', Vue2Leaflet.LCircle) 5 | Vue.component('l-circle-marker', Vue2Leaflet.LCircleMarker) 6 | Vue.component('l-control', Vue2Leaflet.LControl) 7 | Vue.component('l-control-attribution', Vue2Leaflet.LControlAttribution) 8 | Vue.component('l-control-layers', Vue2Leaflet.LControlLayers) 9 | Vue.component('l-control-scale', Vue2Leaflet.LControlScale) 10 | Vue.component('l-control-zoom', Vue2Leaflet.LControlZoom) 11 | Vue.component('l-feature-group', Vue2Leaflet.LFeatureGroup) 12 | Vue.component('l-geo-json', Vue2Leaflet.LGeoJson) 13 | Vue.component('l-grid-layer', Vue2Leaflet.LGridLayer) 14 | Vue.component('l-icon', Vue2Leaflet.LIcon) 15 | Vue.component('l-icon-default', Vue2Leaflet.LIconDefault) 16 | Vue.component('l-image-overlay', Vue2Leaflet.LImageOverlay) 17 | Vue.component('l-layer-group', Vue2Leaflet.LLayerGroup) 18 | Vue.component('l-map', Vue2Leaflet.LMap) 19 | Vue.component('l-marker', Vue2Leaflet.LMarker) 20 | Vue.component('l-polygon', Vue2Leaflet.LPolygon) 21 | Vue.component('l-polyline', Vue2Leaflet.LPolyline) 22 | Vue.component('l-popup', Vue2Leaflet.LPopup) 23 | Vue.component('l-rectangle', Vue2Leaflet.LRectangle) 24 | Vue.component('l-tile-layer', Vue2Leaflet.LTileLayer) 25 | Vue.component('l-tooltip', Vue2Leaflet.LTooltip) 26 | Vue.component('l-lwms-tile-layer', Vue2Leaflet.LWMSTileLayer) 27 | 28 | // Build icon assets. 29 | delete L.Icon.Default.prototype._getIconUrl 30 | L.Icon.Default.imagePath = '' 31 | L.Icon.Default.mergeOptions({ 32 | iconRetinaUrl: require('leaflet/dist/images/marker-icon-2x.png'), 33 | iconUrl: require('leaflet/dist/images/marker-icon.png'), 34 | shadowUrl: require('leaflet/dist/images/marker-shadow.png') 35 | }) 36 | 37 | const LeafletPlugin = { 38 | install(Vue, options) { 39 | // Expose Leaflet 40 | Vue.prototype.$L = L; 41 | } 42 | }; 43 | 44 | Vue.use(LeafletPlugin) 45 | 46 | export default async function ({ router, store }) { 47 | 48 | 49 | } 50 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "nuxt-leaflet", 3 | "version": "0.0.27", 4 | "description": "Nuxt module for leafletjs", 5 | "license": "MIT", 6 | "contributors": [ 7 | { 8 | "name": "Rasmus Schlunsen" 9 | } 10 | ], 11 | "main": "lib/module.js", 12 | "repository": { 13 | "type": "git", 14 | "url": "git+https://github.com/schlunsen/nuxt-leaflet.git" 15 | }, 16 | "publishConfig": { 17 | "access": "public" 18 | }, 19 | "scripts": { 20 | "dev": "nuxt test/fixture", 21 | "lint": "eslint lib test", 22 | "test": "npm run lint && jest", 23 | "release": "standard-version && git push --follow-tags && npm publish" 24 | }, 25 | "eslintIgnore": [ 26 | "lib/templates/*.*" 27 | ], 28 | "files": [ 29 | "lib", 30 | "*.d.ts" 31 | ], 32 | "types": [ 33 | "index.d.ts" 34 | ], 35 | "jest": { 36 | "testEnvironment": "node", 37 | "collectCoverage": true 38 | }, 39 | "dependencies": { 40 | "@types/leaflet": "1.7.6", 41 | "leaflet": "^1.7.1", 42 | "npm-publish-git-tag": "^3.0.3", 43 | "vue2-leaflet": "^2.7.1" 44 | }, 45 | "devDependencies": { 46 | "codecov": "3.7.1", 47 | "eslint": "^6.8.0", 48 | "eslint-config-google": "^0.14.0", 49 | "eslint-config-standard": "14.1.0", 50 | "eslint-plugin-import": "^2.20.1", 51 | "eslint-plugin-jest": "^23.7.0", 52 | "eslint-plugin-node": "11.0.0", 53 | "eslint-plugin-promise": "4.2.1", 54 | "eslint-plugin-standard": "4.0.1", 55 | "eslint-plugin-vue": "^6.1.2", 56 | "jest": "^25.1.0", 57 | "jsdom": "^16.4.0", 58 | "nuxt": "^2.14.9", 59 | "standard-version": "^8.0.1" 60 | }, 61 | "bugs": { 62 | "url": "https://github.com/schlunsen/nuxt-leaflet/issues" 63 | }, 64 | "readme": "https://github.com/schlunsen/nuxt-leaflet#readme", 65 | "homepage": "https://github.com/schlunsen/nuxt-leaflet#readme" 66 | } 67 | -------------------------------------------------------------------------------- /test/fixture/nuxt.config.js: -------------------------------------------------------------------------------- 1 | const { resolve } = require('path') 2 | 3 | module.exports = { 4 | rootDir: resolve(__dirname, '../..'), 5 | srcDir: __dirname, 6 | dev: false, 7 | render: { 8 | resourceHints: false 9 | }, 10 | modules: ['@@'] 11 | } 12 | -------------------------------------------------------------------------------- /test/fixture/pages/index.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | -------------------------------------------------------------------------------- /test/module.test.js: -------------------------------------------------------------------------------- 1 | const { Nuxt, Builder } = require('nuxt') 2 | const request = require('request-promise-native') 3 | 4 | const config = require('./fixture/nuxt.config') 5 | 6 | const url = path => `http://localhost:3000${path}` 7 | const get = path => request(url(path)) 8 | 9 | describe('basic', () => { 10 | let nuxt 11 | 12 | beforeAll(async () => { 13 | nuxt = new Nuxt(config) 14 | await new Builder(nuxt).build() 15 | await nuxt.listen(3000) 16 | }, 60000) 17 | 18 | afterAll(async () => { 19 | await nuxt.close() 20 | }) 21 | 22 | test('render', async () => { 23 | let html = await get('/') 24 | expect(html).toContain('Works!') 25 | }) 26 | }) 27 | --------------------------------------------------------------------------------