- Add
@nuxtclub/slugify
dependency to your project
yarn add -D @nuxtclub/slugify # or npm i -D @nuxtclub/slugify
- Add
@nuxtclub/slugify
to thebuildModules
section ofnuxt.config.js
.
dependency
(No --dev
or --save-dev
flags) and use modules
section in nuxt.config.js
instead of buildModules
.
export default {
buildModules: ['@nuxtclub/slugify'],
}
You can add global/default options:
export default {
buildModules: ['@nuxtclub/slugify'],
slugify: {
globals: {
lower: true,
},
},
}
You can extend the supported symbols, or override the existing ones with your own:
// nuxt.config.js
export default {
buildModules: ['@nuxtclub/slugify'],
slugify: {
extend: {
'@': 'at',
},
},
}
Add the types to your "types"
array in tsconfig.json
after the @nuxt/types
entry.
@nuxt/vue-app
instead of @nuxt/types
for nuxt < 2.9.
{
"compilerOptions": {
"types": ["@nuxt/types", "@nuxtclub/slugify"]
}
}
This module will inject $slugify in the context of your application.
Learn more about Slugify here