我想禁用源映射,以便我的代码不会出现在部署链接源中。正如您将在屏幕截图中看到的那样,我更改了build
并创建了.env
文件,但该文件仍然无效,并且代码仍然可见。同样,.env
文件也不会提交,并显示Untracked Files
。
答案 0 :(得分:1)
尝试在构建后删除地图文件。
module.exports.shipments = async (event) => {
const axios = require("axios");
let data = JSON.parse(event.body);
let url = data.apiURL + "/api/1.1/wf/bulkshipments/initialize";
let patchURL = data.apiURL + "/api/1.1/obj/company/" + data.companyID;
data.shipments.forEach((item, index, array) => {
axios.post(url,{
batchID: data.batchID,
companyID: data.companyID,
shipment: item})
});
return {
statusCode: 200,
body: JSON.stringify({
message: 'Created successfully!',
totalShipments: data.shipments.length,
}, null, 2),
};
};
答案 1 :(得分:0)
我将当前的"build"
替换为"build": "react-scripts build && rm build/static/js/*.map && rm build/static/css/*.map"
,它可以正常工作。我会从源代码中删除js和CSS。