Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dword-design/nuxt-push-plugins
Pushes Nuxt.js plugins to the end of the list instead of the start.
https://github.com/dword-design/nuxt-push-plugins
addplugin addtemplate back dependencies dependency end front module nuxt nuxtjs plugin plugins push start template unshift
Last synced: about 2 months ago
JSON representation
Pushes Nuxt.js plugins to the end of the list instead of the start.
- Host: GitHub
- URL: https://github.com/dword-design/nuxt-push-plugins
- Owner: dword-design
- License: other
- Created: 2020-03-09T00:42:56.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2024-10-03T06:03:52.000Z (3 months ago)
- Last Synced: 2024-10-17T18:12:41.803Z (2 months ago)
- Topics: addplugin, addtemplate, back, dependencies, dependency, end, front, module, nuxt, nuxtjs, plugin, plugins, push, start, template, unshift
- Language: JavaScript
- Homepage:
- Size: 3.41 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE.md
Awesome Lists containing this project
README
# nuxt-push-plugins
Pushes Nuxt.js plugins to the end of the list instead of the start.
When calling [this.addPlugin](https://nuxtjs.org/docs/2.x/internals-glossary/internals-module-container#addplugin-template) inside a Nuxt module, Nuxt does in fact not add the plugin to the end of the list, but to the beginning via [Array.unshift](https://www.w3schools.com/jsref/jsref_unshift.asp). There are cases where you actually want to push plugins to the end of the list so that they can make use of already-added plugins. This package provides a helper function to do that.
## Install
```bash
# npm
$ npm install nuxt-push-plugins# Yarn
$ yarn add nuxt-push-plugins
```## Usage
Import the function into your Nuxt module and call it by passing `this` and the plugins you want to add. It behaves like [Array.push](https://www.w3schools.com/jsref/jsref_push.asp).
```js
// module.jsimport nuxtPushPlugins from 'nuxt-push-plugins'
export default function () {
// single plugin
nuxtPushPlugins(this, require.resolve('./plugin'))// plugin object
nuxtPushPlugins(this, {
src: require.resolve('./plugin'),
mode: 'client',
})// multiple plugins
nuxtPushPlugins(this,
require.resolve('./plugin'),
{ src: require.resolve('./plugin'), mode: 'client' },
)
}
```## Contribute
Are you missing something or want to contribute? Feel free to file an [issue](https://github.com/dword-design/nuxt-push-plugins/issues) or a [pull request](https://github.com/dword-design/nuxt-push-plugins/pulls)! ⚙️
## Support
Hey, I am Sebastian Landwehr, a freelance web developer, and I love developing web apps and open source packages. If you want to support me so that I can keep packages up to date and build more helpful tools, you can donate here:
If you want to send me a one time donation. The coffee is pretty good 😊.
Also for one time donations if you like PayPal.
Here you can support me regularly, which is great so I can steadily work on projects.Thanks a lot for your support! ❤️
## License
[MIT License](https://opensource.org/licenses/MIT) © [Sebastian Landwehr](https://sebastianlandwehr.com)