vue-cli-plugin-s3-deploy icon indicating copy to clipboard operation
vue-cli-plugin-s3-deploy copied to clipboard

Options are not overridden in production mode

Open ghost opened this issue 6 years ago • 5 comments

I set an environment variable in .env.production file:

VUE_APP_S3D_BUCKET=production-bucket-name

And deployed my app with this command:

npm run build --mode production && vue-cli-service s3-deploy

I checked that the NODE_ENV is set to production correctly, so I expected that the new s3 bucket will be created with name production-bucket-name, but it was development-bucket-name as written in vue.config.js file:

module.exports = {
  pluginOptions: {
    s3Deploy: {
      registry: undefined,
      awsProfile: 'default',
      region: 'ap-northeast-2',
      bucket: 'development-bucket-name',
      createBucket: true,
      staticHosting: true,
      staticIndexPage: 'index.html',
      staticErrorPage: 'index.html',
      assetPath: 'dist',
      assetMatch: '**',
      deployPath: '/',
      acl: 'public-read',
      pwa: false,
      enableCloudfront: false,
      uploadConcurrency: 5,
      pluginVersion: '4.0.0-rc2',
      overrideEndpoint: false
    }
  }
}

What am I missing here?

ghost avatar Oct 04 '19 06:10 ghost

Try adding --mode production to the s3deploy command

itsdrew avatar Oct 30 '19 14:10 itsdrew

Have same issue, adding --mode production to s3deploy command didnt help

Karabur avatar Dec 02 '19 15:12 Karabur

Got the same issues here that I solve.

When we build we tell the mecanism to look for production variables, yarn build --mode production. If the build have the good variable, the deploy also need to be inform where to get the variable so we need to specify the mode in yarn deploy --mode production.

Also, My app was with vue-cli, if I was using npm the commande would be this one : npm run build -- --mode=production and npm run deploy -- --mode=production if I want the params to be pass to vue-cli.

Hope it will help

KerberosMorphy avatar Jan 09 '20 18:01 KerberosMorphy

Faced same issue, specifying the mode worked. This should be mentioned in the docs I believe.

babinos87 avatar Jan 29 '20 09:01 babinos87

Faced same issue, specifying the mode worked. This should be mentioned in the docs I believe.

Good idea :)

nicekiwi avatar Mar 16 '20 09:03 nicekiwi