@@ -26,6 +26,13 @@ in rec {
26
26
app = pkgs . haskell . packages . ghcjs86 . callCabal2nix "app" ./. { } ;
27
27
vsn = app . passthru . version ;
28
28
repo = builtins . toString ./. ;
29
+ app-serve-latest = functora-pkgs . writeShellApplication rec {
30
+ name = "app-serve-latest" ;
31
+ text = ''
32
+ ${ functora-pkgs . simple-http-server } /bin/simple-http-server \
33
+ -p 3000 ${ repo } /dist/latest
34
+ '' ;
35
+ } ;
29
36
app-release-latest = functora-pkgs . writeShellApplication rec {
30
37
name = "app-release-latest" ;
31
38
text = ''
@@ -67,12 +74,15 @@ in rec {
67
74
mkdir -p $out/static
68
75
cp ${ ./static } /*.png $out/static/
69
76
cp ${ ./static } /*.woff2 $out/static/
70
- cp ${ ./static } /*.ico $out/
71
77
cp ${ ./static } /*.webmanifest $out/
72
- cp ${ readmeDer } /readme.html $out/
73
- cp ${ licenseDer } /license.html $out/
74
- cp ${ privacyDer } /privacy.html $out/
75
- echo '<!doctype html><html><head><script language="javascript" src="all.js"></script><link rel="stylesheet" href="static/all.css"/></head><body></body></html>' > $out/index.html
78
+ cp ${ ./static } /*.ico $out/
79
+ ${ functora-pkgs . html-minifier } /bin/html-minifier -o $out/license.html \
80
+ ${ licenseDer } /license.html
81
+ ${ functora-pkgs . html-minifier } /bin/html-minifier -o $out/privacy.html \
82
+ ${ privacyDer } /privacy.html
83
+ echo '<!doctype html><html lang="en"><head><script language="javascript" src="all.js" defer></script><link rel="stylesheet" href="static/all.css"/></head><body></body></html>' \
84
+ | ${ functora-pkgs . html-minifier } /bin/html-minifier \
85
+ > $out/index.html
76
86
${ functora-pkgs . clean-css-cli } /bin/cleancss \
77
87
-O2 \
78
88
--source-map \
@@ -85,6 +95,7 @@ in rec {
85
95
--compilation_level ADVANCED_OPTIMIZATIONS \
86
96
--externs ${ app } /bin/app.jsexe/all.js.externs \
87
97
--externs ${ ./static } /material-components-web.min.js \
98
+ --output_wrapper "%output%//# sourceMappingURL=all.js.map" \
88
99
--create_source_map $out/all.js.map \
89
100
--js ${ app } /bin/app.jsexe/all.js \
90
101
--js_output_file $out/all.js
0 commit comments