項目中使用到了yarn打包工程,主要有以下幾個命名。
# build for production with minification
yarn run build# build for production and view the bundle analyzer report
yarn run build --report# 自定義API地址
baseurl="http://127.0.0.1:8080/api/" yarn build
對于我的需要是自定義API地址,但是設置了地址,執行打包之后,發現還是原來的地址。
具體的解決方案
刪除node-modules目錄下的.cache文件
至于原因,等我研究明白在做分享!
還有,如果在啟動工程時報 ”[ XXXXXX ] Could not freeze“,也可以通過上述方法解決。