docs: remove imports from src in medusa-config.js (#8132)
Importing from `src` in `medusa-config.js` works in development, but would cause an error when running `build`/in production. This removes from the docs all snippets that imports from the `src` directory. However, we should figure out a better way to handle re-using the module's name.
This commit is contained in:
1 parent
a74c900ab1
commit
b38c0488be
3 files changed
+3
-10
No files matched your search
@@ -23,13 +23,10 @@ To pass options to a module, add an `options` property to the module’s configu
|
|||||||
For example:
|
For example:
|
||||||
|
|
||||||
```js title="medusa-config.js"
|
```js title="medusa-config.js"
|
||||||
import { HELLO_MODULE } from "./src/modules/hello"
|
|
||||||
// ...
|
|
||||||
|
|
||||||
module.exports = defineConfig({
|
module.exports = defineConfig({
|
||||||
// ...
|
// ...
|
||||||
modules: {
|
modules: {
|
||||||
[HELLO_MODULE]: {
|
helloModuleService: {
|
||||||
resolve: "./modules/hello",
|
resolve: "./modules/hello",
|
||||||
options: {
|
options: {
|
||||||
capitalize: true,
|
capitalize: true,
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ In `medusa-config.js`, add a `modules` property and pass to it your custom modul
|
|||||||
module.exports = defineConfig({
|
module.exports = defineConfig({
|
||||||
// ...
|
// ...
|
||||||
modules: {
|
modules: {
|
||||||
"helloModuleService": {
|
helloModuleService: {
|
||||||
resolve: "./modules/hello",
|
resolve: "./modules/hello",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -139,14 +139,10 @@ export default Module(MARKETPLACE_MODULE, {
|
|||||||
Finally, add the module to the list of modules in `medusa-config.js`:
|
Finally, add the module to the list of modules in `medusa-config.js`:
|
||||||
|
|
||||||
```ts title="medusa-config.js"
|
```ts title="medusa-config.js"
|
||||||
import { MARKETPLACE_MODULE } from "./src/modules/marketplace"
|
|
||||||
|
|
||||||
// ...
|
|
||||||
|
|
||||||
module.exports = defineConfig({
|
module.exports = defineConfig({
|
||||||
// ...
|
// ...
|
||||||
modules: {
|
modules: {
|
||||||
[MARKETPLACE_MODULE]: {
|
marketplaceModuleService: {
|
||||||
resolve: "./modules/marketplace",
|
resolve: "./modules/marketplace",
|
||||||
definition: {
|
definition: {
|
||||||
isQueryable: true,
|
isQueryable: true,
|
||||||
|
|||||||
Reference in new issue
Block a user