Merge pull request #1038 from mozilla/fix-npm-run-android
Fix npm run android by removing the <base href> when running under the dev server
This commit is contained in:
commit
8cde99d2a2
@ -18,9 +18,10 @@ module.exports = function(app, devServer) {
|
|||||||
assets.setMiddleware(devServer.middleware);
|
assets.setMiddleware(devServer.middleware);
|
||||||
app.use(morgan('dev', { stream: process.stderr }));
|
app.use(morgan('dev', { stream: process.stderr }));
|
||||||
function android(req, res) {
|
function android(req, res) {
|
||||||
const index = devServer.middleware.fileSystem.readFileSync(
|
const index = devServer.middleware.fileSystem
|
||||||
devServer.middleware.getFilenameFromUrl('/android.html')
|
.readFileSync(devServer.middleware.getFilenameFromUrl('/android.html'))
|
||||||
);
|
.toString()
|
||||||
|
.replace('<base href="file:///android_asset/" />', '');
|
||||||
res.set('Content-Type', 'text/html');
|
res.set('Content-Type', 'text/html');
|
||||||
res.send(index);
|
res.send(index);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user