You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/providers/aws/guide/plugins.md
+11-4Lines changed: 11 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -63,9 +63,7 @@ custom:
63
63
64
64
## Service local plugin
65
65
66
-
If you are working on a plugin or have a plugin that is just designed for one project they can be loaded from the local folder. Local plugins can be added in the `plugins` array in `serverless.yml`.
67
-
68
-
By default local plugins can be added to the `.serverless_plugins` directory at the root of your service, and in the `plugins` array in `serverless.yml`.
66
+
If you are working on a plugin or have a plugin that is just designed for one project, it can be loaded from the local `.serverless_plugins` folder at the root of your service. Local plugins can be added in the `plugins` array in `serverless.yml`.
69
67
```yml
70
68
plugins:
71
69
- custom-serverless-plugin
@@ -78,10 +76,19 @@ plugins:
78
76
modules:
79
77
- custom-serverless-plugin
80
78
```
81
-
The `custom-serverless-plugin` will be loaded from the `custom_serverless_plugins` directory at the root of your service. If the `localPath` is not provided or empty`.serverless_plugins` directory will be taken as the `localPath`.
79
+
The `custom-serverless-plugin` will be loaded from the `custom_serverless_plugins` directory at the root of your service. If the `localPath` is not provided or empty, the `.serverless_plugins` directory will be used.
82
80
83
81
The plugin will be loaded based on being named `custom-serverless-plugin.js` or `custom-serverless-plugin\index.js` in the root of `localPath` folder (`.serverless_plugins` by default).
84
82
83
+
If you want to load a plugin from a specific directory without affecting other plugins, you can also specify a path relative to the root of your service:
84
+
```yaml
85
+
plugins:
86
+
# This plugin will be loaded from the `.serverless_plugins/` or `node_modules/` directories
87
+
- custom-serverless-plugin
88
+
# This plugin will be loaded from the `sub/directory/` directory
89
+
- ./sub/directory/another-custom-plugin
90
+
```
91
+
85
92
### Load Order
86
93
87
94
Keep in mind that the order you define your plugins matters. When Serverless loads all the core plugins and then the custom plugins in the order you've defined them.
0 commit comments