Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Options are not overridden in production mode #80

Open
ghost opened this issue Oct 4, 2019 · 5 comments
Open

Options are not overridden in production mode #80

ghost opened this issue Oct 4, 2019 · 5 comments
Labels
bug Something isn't working
Milestone

Comments

@ghost
Copy link

ghost commented Oct 4, 2019

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?

@itsdrew
Copy link

itsdrew commented Oct 30, 2019

Try adding --mode production to the s3deploy command

@Karabur
Copy link

Karabur commented Dec 2, 2019

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

@KerberosMorphy
Copy link

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

@babinos87
Copy link

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

@nicekiwi nicekiwi added the bug Something isn't working label Feb 10, 2020
@nicekiwi
Copy link
Collaborator

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

Good idea :)

@nicekiwi nicekiwi added this to the 4.0.0-rc5 milestone Sep 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants