mirror of
https://github.com/nuxt/nuxt.git
synced 2025-01-31 07:40:33 +00:00
docs: update references to lodash
and recommend es-toolkit
This commit is contained in:
parent
100eaa348d
commit
e70ef00e55
@ -638,11 +638,11 @@ We have raised PRs to update modules using EJS syntax, but if you need to do thi
|
|||||||
|
|
||||||
* Moving your string interpolation logic directly into `getContents()`.
|
* Moving your string interpolation logic directly into `getContents()`.
|
||||||
* Using a custom function to handle the replacement, such as in https://github.com/nuxt-modules/color-mode/pull/240.
|
* Using a custom function to handle the replacement, such as in https://github.com/nuxt-modules/color-mode/pull/240.
|
||||||
* Continuing to use `lodash`, as a dependency of _your_ project rather than Nuxt:
|
* Use `es-toolkit/compat` (a drop-in replacement for lodash template), as a dependency of _your_ project rather than Nuxt:
|
||||||
|
|
||||||
```diff
|
```diff
|
||||||
+ import { readFileSync } from 'node:fs'
|
+ import { readFileSync } from 'node:fs'
|
||||||
+ import { template } from 'lodash-es'
|
+ import { template } from 'es-toolkit/compat'
|
||||||
// ...
|
// ...
|
||||||
addTemplate({
|
addTemplate({
|
||||||
fileName: 'appinsights-vue.js'
|
fileName: 'appinsights-vue.js'
|
||||||
|
@ -85,20 +85,14 @@ export default defineUntypedSchema({
|
|||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* You can provide your own templates which will be rendered based
|
* It is recommended to use `addTemplate` from `@nuxt/kit` instead of this option.
|
||||||
* on Nuxt configuration. This feature is specially useful for using with modules.
|
|
||||||
*
|
*
|
||||||
* Templates are rendered using [`lodash/template`](https://lodash.com/docs/4.17.15#template).
|
|
||||||
* @example
|
* @example
|
||||||
* ```js
|
* ```js
|
||||||
* templates: [
|
* templates: [
|
||||||
* {
|
* {
|
||||||
* src: '~/modules/support/plugin.js', // `src` can be absolute or relative
|
* src: '~/modules/support/plugin.js', // `src` can be absolute or relative
|
||||||
* dst: 'support.js', // `dst` is relative to project `.nuxt` dir
|
* dst: 'support.js', // `dst` is relative to project `.nuxt` dir
|
||||||
* options: {
|
|
||||||
* // Options are provided to template as `options` key
|
|
||||||
* live_chat: false
|
|
||||||
* }
|
|
||||||
* }
|
* }
|
||||||
* ]
|
* ]
|
||||||
* ```
|
* ```
|
||||||
|
Loading…
Reference in New Issue
Block a user