serverless-rename-files-plugin
v1.0.2
Published
A custom plugin for the Serverless Framework that allows you to rename files in the packaged output during the deployment process.
Downloads
5
Readme
Serverless Rename Files Plugin
The Serverless Rename Files Plugin is a custom plugin for the Serverless Framework that allows you to rename files in the packaged output during the deployment process. This can be useful when you need to modify the file names in the deployment artifacts without altering the files in your source project.
Installation
Install the plugin as a dependency in your Serverless project:
npm install --dev serverless-rename-files-plugin
yarn add -D serverless-rename-files-plugin
Configuration
To use the plugin, add it to the plugins
section of your serverless.yml
file and specify the file mappings you want to apply:
plugins:
- serverless-rename-files-plugin
custom:
renameFiles:
mappings:
- from: .env.production
to: .env
- from: config.production.json
to: config.json
In the above example, two file mappings are specified. The plugin will rename the file .env.production
to .env
and config.production.json
to config.json
in the packaged output.
Usage
Once the plugin is installed and configured, you can run the packaging command to generate the deployment artifacts:
serverless package
Remember to adjust the mappings in the renameFilesPlugin
section of your serverless.yml
file based on your specific file renaming requirements.
License
This project is licensed under the MIT License.