Skip to content

Commit 0f4ae15

Browse files
authored
fix(kit): temporarily inline lodash.template from lodash-es (#20892)
1 parent 67f2232 commit 0f4ae15

File tree

5 files changed

+16
-38
lines changed

5 files changed

+16
-38
lines changed

packages/kit/build.config.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,6 @@ export default defineBuildConfig({
1111
'webpack',
1212
'vite',
1313
'h3'
14-
]
14+
],
15+
failOnWarn: false
1516
})

packages/kit/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
"ignore": "^5.2.4",
3030
"jiti": "^1.18.2",
3131
"knitwork": "^1.0.0",
32-
"lodash.template": "^4.5.0",
3332
"mlly": "^1.3.0",
3433
"pathe": "^1.1.1",
3534
"pkg-types": "^1.0.3",
@@ -41,8 +40,9 @@
4140
},
4241
"devDependencies": {
4342
"@types/hash-sum": "1.0.0",
44-
"@types/lodash.template": "4.5.1",
43+
"@types/lodash-es": "^4.17.7",
4544
"@types/semver": "7.5.0",
45+
"lodash-es": "^4.17.21",
4646
"nitropack": "2.4.1",
4747
"unbuild": "latest",
4848
"vite": "4.3.9",

packages/kit/src/internal/template.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { promises as fsp } from 'node:fs'
2-
import lodashTemplate from 'lodash.template'
2+
// TODO: swap out when https://github.com/lodash/lodash/pull/5649 is merged
3+
import { template as lodashTemplate } from 'lodash-es'
34
import { genDynamicImport, genImport, genSafeVariableName } from 'knitwork'
45

56
import type { NuxtTemplate } from '@nuxt/schema'

packages/schema/src/config/build.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ export default defineUntypedSchema({
8181
* You can provide your own templates which will be rendered based
8282
* on Nuxt configuration. This feature is specially useful for using with modules.
8383
*
84-
* Templates are rendered using [`lodash.template`](https://lodash.com/docs/4.17.15#template).
84+
* Templates are rendered using [`lodash/template`](https://lodash.com/docs/4.17.15#template).
8585
*
8686
* @example
8787
* ```js

pnpm-lock.yaml

Lines changed: 9 additions & 33 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)