Nuxt 3 - Lodash
💡 About
Lodash auto-import module for Nuxt 3.
📦 Install
npm i nuxt-lodash -D
💻 Usage
import { defineNuxtConfig } from "nuxt3";
export default defineNuxtConfig({
buildModules: [
[
"nuxt-lodash",
{
prefix: "use",
exclude: ["map"],
alias: [
["camelCase", "stringToCamelCase"],
["kebabCase", "stringToKebabCase"],
],
},
],
],
});
🔨 Config
Name | Default | Description |
---|
prefix | false | String to prepend before each Lodash function (false to disable) |
exclude | [] | Array of Lodash functions to exlude from auto-imports |
alias | [] | Array of array pairs to rename specific Lodash functions (doesn't affect prefix) |
💻 Example
<template>
<div>{{ text }}</div>
</template>
<script setup>
const text = useToUpper("it works!");
</script>
📄 License
MIT License © 2021 - Michal Čípa