aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2018-01-04 22:27:35 +0100
committerJonas Smedegaard <dr@jones.dk>2018-01-04 22:27:35 +0100
commitdcebcc6b1b5b03f7fd37864ded04fabdba0a0b57 (patch)
tree7c21a296f649d7453fa749c88386d56eb665ba72 /bin
Initial draft.
Diffstat (limited to 'bin')
-rw-r--r--bin/build.js41
-rwxr-xr-xbin/build.psgi21
-rwxr-xr-xbin/src.psgi20
3 files changed, 82 insertions, 0 deletions
diff --git a/bin/build.js b/bin/build.js
new file mode 100644
index 0000000..3b750f5
--- /dev/null
+++ b/bin/build.js
@@ -0,0 +1,41 @@
+{
+ appDir: '../src',
+ mainConfigFile: '../src/js/slippymap.js',
+ dir: '../build',
+ modules: [
+ //First set up the common build layer.
+ {
+ //module names are relative to baseUrl
+ name: '../slippymap',
+ //List common dependencies here. Only need to list
+ //top level dependencies, "include" will find
+ //nested dependencies.
+ include: [
+ 'leaflet',
+ 'app/mapfactory',
+ 'app/places',
+ 'app/position'
+ ]
+ },
+
+ //Now set up a build layer for each page, but exclude
+ //the common one. "exclude" will exclude
+ //the nested, built dependencies from "slippymap". Any
+ //"exclude" that includes built modules should be
+ //listed before the build layer that wants to exclude it.
+ //"include" the appropriate "app/main*" module since by default
+ //it will not get added to the build since it is loaded by a nested
+ //requirejs in the page*.js files.
+ {
+ name: '../world-staff',
+ include: [
+ 'json!data/staff.json'
+ ],
+ exclude: ['../slippymap']
+ }
+
+ ],
+ optimize: "uglify2",
+ optimizeCss: "standard.keepLines",
+ removeCombined: true,
+}
diff --git a/bin/build.psgi b/bin/build.psgi
new file mode 100755
index 0000000..cdc51ef
--- /dev/null
+++ b/bin/build.psgi
@@ -0,0 +1,21 @@
+#!/usr/bin/env plackup
+
+use strict;
+use warnings;
+
+use FindBin qw($Bin);
+
+use Plack::Builder;
+
+#use Plack::App::File;
+use Plack::App::Directory;
+
+builder {
+ eval { enable 'DirIndex' };
+ eval { enable 'Deflater' };
+
+# enable 'Debug', panels => [ qw(DBITrace Memory Timer) ];
+# mount '/usr/share/javascript' => Plack::App::File->new( root => '/usr/share/javascript' )->to_app;
+ mount '/' =>
+ Plack::App::Directory->new( root => "$Bin/../build" )->to_app;
+};
diff --git a/bin/src.psgi b/bin/src.psgi
new file mode 100755
index 0000000..44e557a
--- /dev/null
+++ b/bin/src.psgi
@@ -0,0 +1,20 @@
+#!/usr/bin/env plackup
+
+use strict;
+use warnings;
+
+use FindBin qw($Bin);
+
+use Plack::Builder;
+
+#use Plack::App::File;
+use Plack::App::Directory;
+
+builder {
+ eval { enable 'DirIndex' };
+ eval { enable 'Deflater' };
+
+# enable 'Debug', panels => [ qw(DBITrace Memory Timer) ];
+# mount '/usr/share/javascript' => Plack::App::File->new( root => '/usr/share/javascript' )->to_app;
+ mount '/' => Plack::App::Directory->new( root => "$Bin/../src" )->to_app;
+};