Fix npm run android by removing the <base href> when running under the dev server

This commit is contained in:
Donovan Preston 2018-12-13 11:44:28 -05:00
parent aa156558b6
commit d217ac14fc
1 changed files with 4 additions and 3 deletions

View File

@ -18,9 +18,10 @@ module.exports = function(app, devServer) {
assets.setMiddleware(devServer.middleware);
app.use(morgan('dev', { stream: process.stderr }));
function android(req, res) {
const index = devServer.middleware.fileSystem.readFileSync(
devServer.middleware.getFilenameFromUrl('/android.html')
);
const index = devServer.middleware.fileSystem
.readFileSync(devServer.middleware.getFilenameFromUrl('/android.html'))
.toString()
.replace('<base href="file:///android_asset/" />', '');
res.set('Content-Type', 'text/html');
res.send(index);
}