Handling config files with webpack

拥有回忆 提交于 2019-12-05 05:42:07

you have to add an entry in your webpack config

{
  entry: {
    app: './src/app.js',
    config: './src/config.js'
  },
  output: {
    filename: '[name].js',
    path: __dirname + '/dist'
  }
 }

https://webpack.js.org/concepts/output/

For this case, I'd suggest dotenv

For client-side applications (that run in browsers), I'd suggest envify.

Both suggestions have easy to follow setup guides.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!