Commit f635547
committed
Add a custom StatusFilePlugin for webpack.
The plugin creates a file that says whether webpack is running, has succeeded,
or has failed. front.py reads the file and waits for the build to finish if
it's currently in progress.
This is essentially a custom substitute for webpack-dev-server. We could use
that instead, but I couldn't find a way to configure it to do what I want.
webpack-dev-server has two modes: inline mode and iframe mode. In inline mode,
it injects its own client library into every bundle. This is a problem for Votr
since we load both prologue.?.js and votr.?.js on every page. In iframe mode,
they are separated into different frames, but the server on being on top and
putting Votr in the iframe, not vice versa. When Votr navigates to another URL
or changes the page title, the user won't see. There might be a third option to
load /webpack-dev-server.js as a separate script in front.py, but it is not
documented anywhere. The documentation is lacking in general.
It's also arguable if we even want automatic refresh after every rebuild, when
AIS requests can take so long. Hot module reloading could solve that, but it's
also more difficult to configure. We can take another look later.1 parent 41d1ee0 commit f635547
2 files changed
+44
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
67 | 68 | | |
68 | 69 | | |
69 | 70 | | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
70 | 86 | | |
71 | 87 | | |
72 | 88 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
35 | 62 | | |
36 | 63 | | |
37 | 64 | | |
| |||
47 | 74 | | |
48 | 75 | | |
49 | 76 | | |
| 77 | + | |
50 | 78 | | |
51 | 79 | | |
52 | 80 | | |
| |||
0 commit comments