在public 文件夹下新建config.js文件,配置如下
const CONFIG = {
baseUrl: 'http://www.baidu.com'
}
在public文件夹下的inde.html中引入
<script src="./config.js?t=<%= new Date().getTime() %>"></script>
在需要使用baseUrl的地方如下引用
const baseUrl = CONFIG.baseUrl
在public 文件夹下新建config.js文件,配置如下
const CONFIG = {
baseUrl: 'http://www.baidu.com'
}
在public文件夹下的inde.html中引入
<script src="./config.js?t=<%= new Date().getTime() %>"></script>
在需要使用baseUrl的地方如下引用
const baseUrl = CONFIG.baseUrl