我想要的像“ project.com”这样的baseURl而不是“ localhost:9000”,因为我遇到了一些应该在同一个域中的api。
我的run.ts包括
build,
done => {
browserSync({
online: false,
open: CLIOptions.hasFlag('open'),
port: project.platform.port,
proxy: "http://phenom-report.com:8001",
logLevel: 'silent',
server: {
baseDir: [project.platform.baseDir],
middleware: [historyApiFallback(), function(req, res, next) {
res.setHeader('Access-Control-Allow-Origin', '*');
next();
}]
}
}, function (err, bs) {
if (err) return done(err);
let urls = bs.options.get('urls').toJS();
log(`Application Available At: ${urls.local}`);
log(`BrowserSync Available At: ${urls.ui}`);
done();
});
});