Closed hraynaud closed 4 years ago
I attached the webpack.config.js and package.json as a zip file
Actually this was my mistake. I was using console.dir() instead of console.log() to verify that the env vars were present. console.log() works fine and the vars are in fact picked up. Didn't realize the console.dir() only takes one argument whereas console.log() takes any number.
configs.zip Environment Provide version numbers for the following components (information can be retrieved by running
tns info
in your project folder or by inspecting thepackage.json
of the project):CLI: 6.4.0
Cross-platform modules:
Android Runtime:
iOS Runtime: 10.15
Plugin(s):
Node.js: 12.18.3
[x] Please, attach your package.json and webpack.config.js as these configurations are usually critical for investigating issues with webpack
Describe the bug I'm building a nativescript-vue app I'm unable to read environment variables passed from the command line when using the nativescript CLI. Inside of webpack.config.js I expect to be able to do a console.log(env) and see the variables I've passed to the tns run command printed out.
To Reproduce
tns run ios --device 'iPhone 11' --env.server_url=localhost:3000
Expected behavior // webpack.config.js
Sample project
Additional context Ultimately my goal is to be able to pass the variables to DefinePlugin so that In can access them in Vue application. Note -- I understand that webpack.DefinePlugin will simply do a textual replace of the value provide.