parcel 一个简单的打包工具,太简单了,功能很弱。
还是老老实实用webpack吧。
https://www.npmjs.com/package/parcel-proxy-server
const ParcelProxyServer = require("parcel-proxy-server");
// configure the proxy server
const server = new ParcelProxyServer({
entryPoint: "./index.html",
proxies: {
// add proxies here
"/mock": {
target: "http://www.baidu.com",
changeOrigin: true,
pathRewrite: {
"^/mock": "",
},
},
},
});
// start up the server
server.listen(8089, () => {
console.log("Parcel proxy server has started");
});
网友评论