diff --git a/CHANGELOG.md b/CHANGELOG.md
new file mode 100644
--- /dev/null
+++ b/CHANGELOG.md
@@ -0,0 +1,17 @@
+# Changelog for elm2nix
+
+## 0.1.2 (2019-10-29)
+
+- #33 Minification of JS output (@turboMaCk)
+- #32 Make it possible to target JS output (@turboMaCk)
+- #31 Fetch test-dependencies (@prasmussen)
+
+## 0.1.1 (2019-02-19)
+
+### Changes
+
+- #22 Support req-0.1.0.0 (@domenkozar)
+
+## 0.1.0 (2018-12-28)
+
+- Initial release (@domenkozar)
diff --git a/ChangeLog.md b/ChangeLog.md
deleted file mode 100644
--- a/ChangeLog.md
+++ /dev/null
@@ -1,11 +0,0 @@
-# Changelog for elm2nix
-
-## 0.1.1 (2019-02-19)
-
-### Changes
-
-- #22 Support req-0.1.0.0 (@domenkozar)
-
-## 0.1.0 (2018-12-28)
-
-- Initial release (@domenkozar)
diff --git a/data/default.nix b/data/default.nix
--- a/data/default.nix
+++ b/data/default.nix
@@ -12,11 +12,13 @@
     , srcdir ? "./src"
     , targets ? []
     , versionsDat ? ./versions.dat
+    , outputJavaScript ? false
     }:
     stdenv.mkDerivation {
       inherit name src;
 
-      buildInputs = [ elmPackages.elm ];
+      buildInputs = [ elmPackages.elm ]
+        ++ lib.optional outputJavaScript nodePackages_10_x.uglify-js;
 
       buildPhase = pkgs.elmPackages.fetchElmDeps {
         elmPackages = import srcs;
@@ -25,11 +27,17 @@
 
       installPhase = let
         elmfile = module: "\${srcdir}/\${builtins.replaceStrings ["."] ["/"] module}.elm";
+        extension = if outputJavaScript then "js" else "html";
       in ''
         mkdir -p \$out/share/doc
         \${lib.concatStrings (map (module: ''
           echo "compiling \${elmfile module}"
-          elm make \${elmfile module} --output \$out/\${module}.html --docs \$out/share/doc/\${module}.json
+          elm make \${elmfile module} --output \$out/\${module}.\${extension} --docs \$out/share/doc/\${module}.json
+          \${lib.optionalString outputJavaScript ''
+            echo "minifying \${elmfile module}"
+            uglifyjs $out/\${module}.\${extension} --compress 'pure_funcs="F2,F3,F4,F5,F6,F7,F8,F9,A2,A3,A4,A5,A6,A7,A8,A9",pure_getters,keep_fargs=false,unsafe_comps,unsafe' \\
+                | uglifyjs --mangle --output=$out/\${module}.min.\${extension}
+          ''}
         '') targets)}
       '';
     };
@@ -39,4 +47,5 @@
   src = ./.;
   targets = ["Main"];
   srcdir = "${srcdir}";
+  outputJavaScript = false;
 }
diff --git a/elm2nix.cabal b/elm2nix.cabal
--- a/elm2nix.cabal
+++ b/elm2nix.cabal
@@ -3,7 +3,7 @@
 -- see: https://github.com/sol/hpack
 
 name:           elm2nix
-version:        0.1.1
+version: 0.1.2
 synopsis:       Turn your Elm project into buildable Nix project
 description:    Please see the README on Github at <https://github.com/domenkozar/elm2nix#readme>
 homepage:       https://github.com/domenkozar/elm2nix#readme
@@ -17,7 +17,7 @@
 cabal-version:  2.0
 
 extra-source-files:
-    ChangeLog.md
+    CHANGELOG.md
     README.md
     data/default.nix
 
diff --git a/src/Elm2Nix.hs b/src/Elm2Nix.hs
--- a/src/Elm2Nix.hs
+++ b/src/Elm2Nix.hs
@@ -46,11 +46,11 @@
 throwErr :: Elm2NixError -> Elm2Nix a
 throwErr e = Elm2Nix (throwE e)
 
-parseElmJsonDeps :: Value -> Either Elm2NixError [Dep]
-parseElmJsonDeps obj =
+parseElmJsonDeps :: Text -> Value -> Either Elm2NixError [Dep]
+parseElmJsonDeps depsKey obj =
   case obj of
     Object hm -> do
-      deps <- tryLookup hm "dependencies"
+      deps <- tryLookup hm depsKey
       case deps of
         Object dhm -> do
           direct   <- tryLookup dhm "direct"
@@ -83,10 +83,11 @@
   res <- liftIO (fmap Json.eitherDecode (LBS.readFile "elm.json"))
   elmJson <- either (throwErr . ElmJsonReadError) return res
 
-  deps <- either throwErr return (parseElmJsonDeps elmJson)
+  deps <- either throwErr return (parseElmJsonDeps "dependencies" elmJson)
+  testDeps <- either throwErr return (parseElmJsonDeps "test-dependencies" elmJson)
   liftIO (hPutStrLn stderr "Prefetching tarballs and computing sha256 hashes ...")
 
-  sources <- liftIO (mapConcurrently (uncurry prefetch) deps)
+  sources <- liftIO (mapConcurrently (uncurry prefetch) (deps ++ testDeps))
   liftIO (putStrLn (generateNixSources sources))
 
 initialize :: IO ()
