diff options
author | eric <thul.eric@gmail.com> | 2016-03-12 14:46:01 -0500 |
---|---|---|
committer | eric <thul.eric@gmail.com> | 2016-03-12 14:46:01 -0500 |
commit | 55120f4502cb76e768f60654f3937db809df8ade (patch) | |
tree | f27800de3576466ea4d5502d9adb9cd57a583715 /src/PursLoader/Options.purs | |
parent | 17f22f868b851e50081844562627a7a8a414dcaa (diff) | |
parent | 845f3ec3c5b13a47d60b9ff2be14bf41fb5c4734 (diff) | |
download | purs-loader-55120f4502cb76e768f60654f3937db809df8ade.tar.gz purs-loader-55120f4502cb76e768f60654f3937db809df8ade.tar.zst purs-loader-55120f4502cb76e768f60654f3937db809df8ade.zip |
Merge pull request #43 from ethul/topic/optional-bundle
Handle optional bundling by the compiler
Diffstat (limited to 'src/PursLoader/Options.purs')
-rw-r--r-- | src/PursLoader/Options.purs | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/src/PursLoader/Options.purs b/src/PursLoader/Options.purs deleted file mode 100644 index 0c1453e..0000000 --- a/src/PursLoader/Options.purs +++ /dev/null | |||
@@ -1,30 +0,0 @@ | |||
1 | module PursLoader.Options | ||
2 | ( Options(..) | ||
3 | , runOptions | ||
4 | ) where | ||
5 | |||
6 | import Prelude ((<$>), (<<<), id) | ||
7 | |||
8 | import Data.Foreign.Class (IsForeign, readProp) | ||
9 | import Data.Foreign.NullOrUndefined (runNullOrUndefined) | ||
10 | import Data.Maybe (maybe) | ||
11 | |||
12 | import PursLoader.Path (joinPath) | ||
13 | |||
14 | newtype Options = Options { bundleOutput :: String } | ||
15 | |||
16 | type Options_ = { bundleOutput :: String } | ||
17 | |||
18 | runOptions :: Options -> Options_ | ||
19 | runOptions (Options options) = options | ||
20 | |||
21 | instance isForeignOptions :: IsForeign Options where | ||
22 | read obj = | ||
23 | Options <$> ({ bundleOutput: _ } | ||
24 | <$> (maybe bundleOutputDefault id <<< runNullOrUndefined <$> readProp bundleOutput obj)) | ||
25 | where | ||
26 | bundleOutput :: String | ||
27 | bundleOutput = "bundleOutput" | ||
28 | |||
29 | bundleOutputDefault :: String | ||
30 | bundleOutputDefault = joinPath "output" "bundle.js" | ||