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

Cannot deploy as production #7

Open
vdiaza opened this issue Jan 10, 2019 · 2 comments
Open

Cannot deploy as production #7

vdiaza opened this issue Jan 10, 2019 · 2 comments

Comments

@vdiaza
Copy link

vdiaza commented Jan 10, 2019

I cannot stop getting this message on the front end & admin.

"You are running Vue in development mode.
Make sure to turn on production mode when deploying for production.
See more tips at https://vuejs.org/guide/deployment.html"

I have tried using the "npm run build", but it doesn't make any difference.

Any clue of what could be happening?

@francoisauclair911
Copy link

francoisauclair911 commented Jan 14, 2019

As per vue documentation, production is defined with webpack using this line

module.exports = {
  mode: 'production'
}

In webpack.config.js you can see the environment variable is set up by this line

var env = process.env.WEBPACK_ENV;

So I'd suggest trying to set up you process.ebv file to the WEBPACK_ENV variable is set to production

VUEJS Documentation for ENV file

https://cli.vuejs.org/guide/mode-and-env.html

@vrerabek
Copy link

vrerabek commented May 1, 2019

I was having a same problem when npm run build won't build in Production Mode. Take a look at this page https://vuejs.org/v2/guide/deployment.html .
This repo comes with webpack 3.11 so follow the instructions for webpack 3 and earlier.

I edited var plugins = [] inside webpack.config.js to

var plugins = [
    new webpack.DefinePlugin({
        'process.env.NODE_ENV': JSON.stringify('production')
      })
];

This way you always deploy in Production Mode.

tareq1988 added a commit that referenced this issue Oct 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants