node package manager
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org ยป



VTEX Deploy for front end projects

Release History

0.11.0: Watch out! Breaking changes. For the old API, use v0.8.1.

The "vtex_deploy" task

IMPORTANT: Required Environment Variables

  • S3 access key: S3_KEY
  • S3 secret key: S3_SECRET
  • S3 bucket: S3_BUCKET

Interesting options


Default value: "./tmp-deploy/"


Default value: process.env["ENVIRONMENT_TYPE"] If you need a target to only run in a given environment type (e.g., stable).


Default value: "vtex-io" The bucket to which your files will be uploaded.


Default value: empty string. A root directory regarding every file referenced in this target. This will not be appended to the target destination, on upload. This is the point of this property.


Default value: false Whether your package should automatically update the corresponding "tag" to your version in the index.json file. When you have a version component to your upload, your version will be added to your package in the index.json file. If publish is true, the tag corresponding to the version will be updated to the uploaded version. E.g. if you just published version 1.2.3-beta, the "beta" tag will be updated with version "1.2.3-beta".


Default value: false A target: source map. If target is a directory, source may be a glob. If you wish to upload some files at the version directory of your app's folder (e.g. v01-00-00-stable-28). See the usage example.


Default value: false A target: source map. If target is a directory, source may be a glob. If you wish to upload some files at the root of your app's folder. See the usage example.


Conveniently replace special parts of every file in the files array. Pass a replace map with regex as keys and your desired replacements as values. The special {{version}} value gets translated to a version name, e.g. v01-00-00-stable-28

Usage Example

(More usage examples in JS on Gruntfile.js)

    cwd: "build"
        "/": "**"

        "index.html": "index.html"

        "/vtex_deploy/": "//{{version}}/"
        VERSION_DIRECTORY: "{{version}}"

      files: ["index.html", "test1"]


Running "vtex_deploy:main" (vtex_deploy) task
Using temp directory: ./tmp-deploy/
Cleaning temp directory...
Copying upload files to temp directory...
Copied 5 files

Starting preprocessing
Files: [ 'build/index.html', 'build/test1' ]
Processed tmp-deploy/build/index.html
Processed tmp-deploy/build/test1

Using bucket: vtex-io
Root upload path: vtex_deploy
Version upload path: vtex_deploy/0.11.0
Starting upload...
Uploaded all files successfully!
List of uploaded files:
Updating registry index...
Version updated at