更新时间:2023-11-15 13:06:04
我建议你对生产应用程序足够的解决方案是加载配置文件在 webpack.config.js
,然后使用从webpack中定义插件。
The solution I'd advice you which is good enough for production apps is to load config file in webpack.config.js
and then use Define Plugin from webpack.
它只是允许你读取任何文件和环境变量,然后将其作为全局变量传递到bundle。
It simply allows you to read any file and environment variable and then pass it to the bundle as global variable.