vue-wp-starter
vue-wp-starter copied to clipboard
Cannot deploy as production
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?
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
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.