Skip to content

Commit

Permalink
feat: add support for Nuxt out of the box
Browse files Browse the repository at this point in the history
  • Loading branch information
Honoré Nintunze committed Dec 6, 2020
1 parent d72ddbc commit 85120c7
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 0 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
commitlint.config.js
husky.config.js
release.config.js
nuxt/
13 changes: 13 additions & 0 deletions nuxt/module.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import path from 'path'

const fineMqModule = function module(moduleOptions) {
const options = this.options.fineMq || moduleOptions

this.addPlugin({
src: path.resolve(__dirname, './templates/plugin.js'),
fileName: 'fine-mq.js',
options,
})
}

module.exports = fineMqModule
4 changes: 4 additions & 0 deletions nuxt/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"name": "fine-mq",
"main": "module.js"
}
4 changes: 4 additions & 0 deletions nuxt/templates/plugin.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import Vue from 'vue'
import { FineMqPlugin } from 'fine-mq'

Vue.use(FineMqPlugin, <%= serialize(options) %>)

0 comments on commit 85120c7

Please sign in to comment.