我正在VS 2017中使用react-redux项目设置.net-core。我删除了默认的CleintApp,并使用“ npm create-react-app --typscript”创建了新文件夹。
appsettings.json
{
"menuUrl": "",
"apiUrl": "",
}
现在我想阅读menuURL并导入Webpack吗?
答案 0 :(得分:0)
添加
const appsettings = require('./appsettings.json');
然后按以下方式使用它:
appsettings.menuUrl;
示例
const webpack = require('webpack');
const appsettings = require('./appsettings.json');
module.exports = env => {
var version = appsettings.AppSettings.AppVersion;
var lastIndex = version.lastIndexOf(".");
var majorMinorVersion = version.substring(0, lastIndex);
...
return {
entry: {
app: './ElmMobile/index.js'
},
...