Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit daf726f2 authored by Simon Chan's avatar Simon Chan
Browse files

fix(demo): public folder base path v3

parent fce1dd73
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -23,6 +23,9 @@ module.exports = withMDX({
    experimental: {
        esmExternals: 'loose',
    },
    publicRuntimeConfig: {
        basePath: process.env.BASE_PATH || '',
    },
    webpack(config, options) {
        config.module.rules.push({
            resourceQuery: /url/,
+3 −1
Original line number Diff line number Diff line
@@ -7,6 +7,7 @@ import { AdbSyncEntryResponse, AdbSyncMaxPacketSize, LinuxFileType } from '@yume
import { action, autorun, makeAutoObservable, observable, runInAction } from "mobx";
import { observer } from "mobx-react-lite";
import { NextPage } from "next";
import getConfig from "next/config";
import Head from "next/head";
import Router, { useRouter } from "next/router";
import path from 'path';
@@ -17,8 +18,9 @@ import { asyncEffect, chunkFile, formatSize, formatSpeed, Icons, pickFile, Route

let StreamSaver: typeof import('streamsaver');
if (typeof window !== 'undefined') {
    const { publicRuntimeConfig } = getConfig();
    StreamSaver = require('streamsaver');
    StreamSaver.mitm = (process.env.BASE_PATH || '') + '/StreamSaver/mitm.html';
    StreamSaver.mitm = publicRuntimeConfig.basePath + '/StreamSaver/mitm.html';
}

interface ListItem extends AdbSyncEntryResponse {