Explain to me, please, how I can use, for example, process.env.NODE_ENV directly in the Vue.js code of the application.
I will clarify what I mean not Webpack configs, but directly the main.js file from:
module.exports = { entry: { app: './src/main.js' }, Read https://webpack.js.org/plugins/define-plugin/ , but did not understand. Very scarce examples that do not go away further Webpack configs (although they have an example SERVICE_URL , which looks very strange). On one forum I saw the phrase, they say, using DefinePlugin, you can use environment variables directly in the code of the application files, but again, no examples, but I did not succeed. The variable process or NODE_ENV in the application code is not available - displays a critical error: 'process' is not defined .
Using process.env I want to transfer, for example, to the main.js file the data for Vue.config . Or the same SERVICE_URL .
Tell me, please, what am I doing wrong?