mirror of
https://github.com/FrankerFaceZ/FrankerFaceZ.git
synced 2025-08-01 15:38:31 +00:00
More webpack 4 code. Make sure to asynchronously await the availability of our webpack hook everywhere that we use it that it's reasonable to wait.
This adds a new module called switchboard that abuses the root React Router instance to forcibly load a chunk, letting us grab `require()` quickly rather than waiting potentially forever for another chunk to be loaded due to user action, etc.
This commit is contained in:
parent
194f93414d
commit
86c5fee033
13 changed files with 128 additions and 24 deletions
|
@ -11,6 +11,8 @@ import Fine from 'utilities/compat/fine';
|
|||
import FineRouter from 'utilities/compat/fine-router';
|
||||
import Apollo from 'utilities/compat/apollo';
|
||||
|
||||
import Switchboard from './switchboard';
|
||||
|
||||
import {createElement} from 'utilities/dom';
|
||||
import {has} from 'utilities/object';
|
||||
|
||||
|
@ -28,7 +30,8 @@ export default class Twilight extends BaseSite {
|
|||
this.inject(WebMunch);
|
||||
this.inject(Fine);
|
||||
this.inject('router', FineRouter);
|
||||
this.inject(Apollo);
|
||||
this.inject(Apollo, false);
|
||||
this.inject(Switchboard);
|
||||
}
|
||||
|
||||
onLoad() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue