Unverified Commit f4d9a50a authored by JJ Kasper's avatar JJ Kasper Committed by GitHub

Add missing modularizeImports on config snippets (#44734)

Closes: https://github.com/vercel/next.js/issues/44733

## Documentation / Examples

- [x] Make sure the linting passes by running `pnpm build && pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing
doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
parent cdfc484b
...@@ -332,8 +332,10 @@ For example, you can use the `kebabCase` helper like this: ...@@ -332,8 +332,10 @@ For example, you can use the `kebabCase` helper like this:
```js ```js
// next.config.js // next.config.js
module.exports = { module.exports = {
'my-library': { modularizeImports: {
transform: 'my-library/{{ kebabCase member }}', 'my-library': {
transform: 'my-library/{{ kebabCase member }}',
},
}, },
} }
``` ```
...@@ -395,9 +397,11 @@ In this case, you can use the `skipDefaultConversion` option to use named import ...@@ -395,9 +397,11 @@ In this case, you can use the `skipDefaultConversion` option to use named import
```js ```js
// next.config.js // next.config.js
module.exports = { module.exports = {
'my-library': { modularizeImports: {
transform: 'my-library/{{member}}', 'my-library': {
skipDefaultConversion: true, transform: 'my-library/{{member}}',
skipDefaultConversion: true,
},
}, },
} }
``` ```
...@@ -419,9 +423,11 @@ If you use the `preventFullImport` option, the compiler will throw an error if y ...@@ -419,9 +423,11 @@ If you use the `preventFullImport` option, the compiler will throw an error if y
```js ```js
// next.config.js // next.config.js
module.exports = { module.exports = {
lodash: { modularizeImports: {
transform: 'lodash/{{member}}', lodash: {
preventFullImport: true, transform: 'lodash/{{member}}',
preventFullImport: true,
},
}, },
} }
``` ```
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment