docs: change config snippets to use defineConfig (#7546)

This commit is contained in:
Shahed Nasser
2024-05-30 16:47:28 +03:00
committed by GitHub
parent ddfd757277
commit fe96bd39b1
51 changed files with 489 additions and 718 deletions
@@ -19,25 +19,31 @@ The `providers` option is an array of either tax provider modules, tax plugins,
When the Medusa application starts, these providers are registered and can be used to retrieve tax lines.
```js title="medusa-config.js"
const modules = {
const { Modules } = require("@medusajs/modules-sdk")
// ...
module.exports = defineConfig({
// ...
tax: {
resolve: "@medusajs/tax",
options: {
providers: [
{
resolve: "my-provider",
options: {
// ...
modules: {
[Modules.TAX]: {
resolve: "@medusajs/tax",
options: {
providers: [
{
resolve: "my-provider",
options: {
// ...
},
},
},
],
],
},
},
},
}
}
})
```
The objects in the array accept the following properties:
- `resolve`: A string indicating the package name of the tax provider module or the tax plugin, or the path to the file defining the tax provider.
- `resolve`: A string indicating the package name of the tax provider module or the path to it relative to the `src` directory.
- `options`: An object of options to pass to the tax provider.
@@ -78,21 +78,6 @@ const taxLines = await taxModuleService.getTaxLines(
## Configure Tax Module
To use the Tax Module, enable it in the `modules` object in `medusa-config.js`:
```js title="medusa-config.js"
const { Modules } = require("@medusajs/modules-sdk")
// ...
const modules = {
// ...
[Modules.TAX]: true,
}
```
### Module Options
Refer to [this documentation](./module-options/page.mdx) for details on the module's options.
---