Host A Vue.js App On Amazon S3
Visit https://nodejs.org/en/download/ and install Node.
Alternatively, if you are on macOS and have Homebrew, use the following command.
brew install node
Install vue-cli and create a new app
npm install -g vue-cli vue init webpack [your_project_name]
Run your app locally
cd [your_project_name] npm run start
Open your browser and navigate to localhost:5000.
Create an AWS account
Visit https://aws.amazon.com and create an account.
Navigate to Amazon S3 and create a bucket
Choose a bucket name
The name must be unique and not just unique to your account, but unique across all buckets of all accounts.
Enable static website hosting
Navigate to your bucket’s properties and enable static website hosting. Note the endpoint, it’s your site’s URL.
Build your Vue.js app
If you didn’t touch the scripts in
package.json, the build command is probably the following.
npm run build
Upload your app
Upload the content of the
dist/ directory to your bucket.