用nodejs读取了另一个js文件,得到该js文件的字符串,内容如下。
/*
* @Description: 生产环境
* @Author: xxx@163.com
*/
window.config = {
baseUrl: 'http://192.168.1.100',
describe: '生产环境'
};
如何获取到里面的对象内容,像下面这样。
{
baseUrl: 'http://192.168.1.100',
describe: '生产环境'
}