diff --git a/nuxt/index.cjs b/nuxt/index.cjs deleted file mode 100644 index cff743a..0000000 --- a/nuxt/index.cjs +++ /dev/null @@ -1,5 +0,0 @@ -module.exports = function (...args) { - return import('./index.mjs').then((m) => m.default.call(this, ...args)) -} -const _meta = (module.exports.meta = require('./meta.json')) -module.exports.getMeta = () => Promise.resolve(_meta) diff --git a/nuxt/index.mjs b/nuxt/index.js similarity index 100% rename from nuxt/index.mjs rename to nuxt/index.js diff --git a/nuxt/meta.json b/nuxt/meta.json index 4653312..37a4895 100644 --- a/nuxt/meta.json +++ b/nuxt/meta.json @@ -2,7 +2,7 @@ "name": "v-wave", "configKey": "vWave", "compatibility": { - "nuxt": "^3.0.0 || ^2.16.0", + "nuxt": "^3.0.0", "bridge": true } } diff --git a/nuxt/v2/index.cjs b/nuxt/v2/index.cjs new file mode 100644 index 0000000..6c2e3a7 --- /dev/null +++ b/nuxt/v2/index.cjs @@ -0,0 +1,14 @@ +const { resolve } = require('path') + +module.exports = function nuxtVWave(moduleOptions) { + const options = Object.assign({}, this.options.vWave, moduleOptions) + + this.addPlugin({ + ssr: false, + src: resolve(__dirname, 'v2-plugin.js'), + fileName: 'v-wave-plugin.js', + options + }) +} + +module.exports.meta = require('../../package.json') diff --git a/nuxt/v2/v2-plugin.js b/nuxt/v2/v2-plugin.js new file mode 100644 index 0000000..083373b --- /dev/null +++ b/nuxt/v2/v2-plugin.js @@ -0,0 +1,4 @@ +import Vue from 'vue' +import VWave from 'v-wave' + +Vue.use(VWave, <%= serialize(options) %>) diff --git a/package.json b/package.json index 446b9f1..80acfe7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "v-wave", - "version": "1.6.0-beta.3", + "version": "1.5.1", "description": "The material-ripple directive for Vue that actually works", "type": "module", "main": "dist/cjs/index.cjs",