Vue CLI Plugin S3 Deploy is a utility designed to streamline the deployment of built Vue.js applications to AWS S3 buckets. It offers comprehensive features including support for custom AWS regions, management of AWS credential profiles and environment variables, configuration for S3 static site hosting, and concurrent uploads to enhance deployment speed. Additionally, it integrates with CloudFront for cache invalidation, applies correct `Cache-Control` metadata for Progressive Web Apps (PWAs) and Service Workers, handles GZIP compression, and allows for configurable deployment paths, enabling multiple Vue applications within a single S3 bucket. The package is currently in its 4.x release candidate series, with `4.0.0-rc3` being the latest specified release candidate, indicating active development towards a stable version. Given it's a CLI plugin, its release cadence is tied to Vue CLI updates and community contributions. A key differentiator is its deep integration with the Vue CLI ecosystem, providing a guided setup and `vue.config.js` based configuration.
npm install vue-cli-plugin-s3-deployNo compatibility data collected yet for this library.
Shows how to install, configure in `vue.config.js`, and deploy a Vue.js app to S3.
For new projects, consider native AWS S3 sync commands or alternative deployment solutions for Vite-based applications. For existing Vue CLI projects, proceed with this plugin.
Review the plugin's GitHub repository for the latest release status and changelog. For production environments, consider sticking to the latest stable `3.x` branch if available, or thoroughly testing `4.x` RCs.
Ensure your Node.js and npm versions meet the Vue CLI requirements. If encountering `TypeError: The 'compilation' argument must be an instance of Compilation` errors, delete `node_modules` and `package-lock.json`/`yarn.lock` and reinstall.
Set up AWS credentials globally or specify an `awsProfile` in `vue.config.js`. Use environment variables (`VUE_APP_S3D_AWS_PROFILE`, `VUE_APP_S3D_REGION`, `VUE_APP_S3D_BUCKET`, `VUE_APP_S3D_CLOUDFRONT_ID`) for per-environment overrides.
If migrating from a version older than `2.0.0`, recreate your configuration using `vue.config.js` as described in the documentation. Run `vue invoke s3-deploy` to help generate the basic structure.
Remove `package-lock.json` or `yarn.lock` and the `node_modules` directory, then run `npm install` or `yarn install` to reinstall dependencies with the correct versions.
Configure S3 static website hosting to redirect 4xx errors to `index.html`. In `vue.config.js`, set `staticErrorPage: 'index.html'` for `pluginOptions.s3Deploy`. For CloudFront, set up custom error responses to redirect 403/404 to `/index.html` with an HTTP 200 response.
Ensure `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY` (and `AWS_SESSION_TOKEN` for temporary credentials) environment variables are set, or that a valid AWS profile is configured in `~/.aws/credentials` and specified via `awsProfile` in `vue.config.js`.
Ensure `deployPath` is correctly specified in `vue.config.js`. If using `4.0.0-rc3` or earlier, consider upgrading to `4.0.0-rc4` or later, which includes fixes for `deployPath` issues.
No dependency data recorded yet.