typicode / hotel

🏩 A simple process manager for developers. Start apps from your browser and access them using local domains
MIT License
9.97k stars 424 forks source link

Consider using NODE_ENV=production when building #167

Closed moimael closed 7 years ago

moimael commented 7 years ago

Hi,

I'm running hotel 0.6.1 and i get this warning in the console:

"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"

Can you consider building with optimizations enabled ?

Thanks !

typicode commented 7 years ago

Hi @moimael,

Good catch. I'll have a look 👍

typicode commented 7 years ago

Tried to add it https://github.com/typicode/hotel/blob/master/package.json#L21 and passing -p to webpack as well. But for some reasons, I'm still getting the message. If you or someone else want to have a look, feel free :)

moimael commented 7 years ago

You need to use the webpack define plugin for this. See https://vue-loader.vuejs.org/en/workflow/production.html

Also you are not forced to hardcode the production string, you can pass process.env.NODE_ENV to it.

typicode commented 7 years ago

But based on docs, doesn't -p add it for you https://webpack.js.org/api/cli/#shortcuts --define process.env.NODE_ENV="production"?

typicode commented 7 years ago

Fixed :)

It seems the alias wasn't pointing to the right file https://github.com/typicode/hotel/blob/master/webpack.config.js#L33