diff options
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | src/PursLoader/Loader.purs | 2 | ||||
-rw-r--r-- | src/PursLoader/Options.purs | 16 |
3 files changed, 10 insertions, 10 deletions
@@ -14,7 +14,7 @@ npm install purs-loader --save-dev | |||
14 | 14 | ||
15 | ## Options | 15 | ## Options |
16 | 16 | ||
17 | ###### `pscBundle` (String) | 17 | ###### `bundleOutput` (String) |
18 | 18 | ||
19 | Relative path to the bundled JavaScript file generated by the `PurescriptWebpackPlugin`. The default value is `output/bundle.js`. | 19 | Relative path to the bundled JavaScript file generated by the `PurescriptWebpackPlugin`. The default value is `output/bundle.js`. |
20 | 20 | ||
diff --git a/src/PursLoader/Loader.purs b/src/PursLoader/Loader.purs index 0cd077d..affce53 100644 --- a/src/PursLoader/Loader.purs +++ b/src/PursLoader/Loader.purs | |||
@@ -54,7 +54,7 @@ loader ref source = do | |||
54 | 54 | ||
55 | resourceDir = dirname (resourcePath ref) | 55 | resourceDir = dirname (resourcePath ref) |
56 | 56 | ||
57 | modulePath = (\opts -> relative resourceDir opts.pscBundle) <$> options | 57 | modulePath = (\opts -> relative resourceDir opts.bundleOutput) <$> options |
58 | 58 | ||
59 | result = (\path name -> "module.exports = require('" ++ path ++ "')['" ++ name ++ "'];") <$> modulePath <*> moduleName | 59 | result = (\path name -> "module.exports = require('" ++ path ++ "')['" ++ name ++ "'];") <$> modulePath <*> moduleName |
60 | 60 | ||
diff --git a/src/PursLoader/Options.purs b/src/PursLoader/Options.purs index 132096c..706ddd2 100644 --- a/src/PursLoader/Options.purs +++ b/src/PursLoader/Options.purs | |||
@@ -11,20 +11,20 @@ import Data.Maybe (maybe) | |||
11 | 11 | ||
12 | import PursLoader.Path (joinPath) | 12 | import PursLoader.Path (joinPath) |
13 | 13 | ||
14 | newtype Options = Options { pscBundle :: String } | 14 | newtype Options = Options { bundleOutput :: String } |
15 | 15 | ||
16 | type Options_ = { pscBundle :: String } | 16 | type Options_ = { bundleOutput :: String } |
17 | 17 | ||
18 | runOptions :: Options -> Options_ | 18 | runOptions :: Options -> Options_ |
19 | runOptions (Options options) = options | 19 | runOptions (Options options) = options |
20 | 20 | ||
21 | instance isForeignOptions :: IsForeign Options where | 21 | instance isForeignOptions :: IsForeign Options where |
22 | read obj = | 22 | read obj = |
23 | Options <$> ({ pscBundle: _ } | 23 | Options <$> ({ bundleOutput: _ } |
24 | <$> (maybe pscBundleDefault id <<< runNullOrUndefined <$> readProp pscBundle obj)) | 24 | <$> (maybe bundleOutputDefault id <<< runNullOrUndefined <$> readProp bundleOutput obj)) |
25 | where | 25 | where |
26 | pscBundle :: String | 26 | bundleOutput :: String |
27 | pscBundle = "pscBundle" | 27 | bundleOutput = "bundleOutput" |
28 | 28 | ||
29 | pscBundleDefault :: String | 29 | bundleOutputDefault :: String |
30 | pscBundleDefault = joinPath "output" "bundle.js" | 30 | bundleOutputDefault = joinPath "output" "bundle.js" |