From d78112147d02e263a5b000cb0b3b9ff84aa5c89a Mon Sep 17 00:00:00 2001 From: eric thul Date: Fri, 25 Dec 2015 19:24:02 -0500 Subject: Updating bundle output option name --- README.md | 2 +- src/PursLoader/Loader.purs | 2 +- src/PursLoader/Options.purs | 16 ++++++++-------- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index a459059..0e1ce2f 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ npm install purs-loader --save-dev ## Options -###### `pscBundle` (String) +###### `bundleOutput` (String) Relative path to the bundled JavaScript file generated by the `PurescriptWebpackPlugin`. The default value is `output/bundle.js`. 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 resourceDir = dirname (resourcePath ref) - modulePath = (\opts -> relative resourceDir opts.pscBundle) <$> options + modulePath = (\opts -> relative resourceDir opts.bundleOutput) <$> options result = (\path name -> "module.exports = require('" ++ path ++ "')['" ++ name ++ "'];") <$> modulePath <*> moduleName 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) import PursLoader.Path (joinPath) -newtype Options = Options { pscBundle :: String } +newtype Options = Options { bundleOutput :: String } -type Options_ = { pscBundle :: String } +type Options_ = { bundleOutput :: String } runOptions :: Options -> Options_ runOptions (Options options) = options instance isForeignOptions :: IsForeign Options where read obj = - Options <$> ({ pscBundle: _ } - <$> (maybe pscBundleDefault id <<< runNullOrUndefined <$> readProp pscBundle obj)) + Options <$> ({ bundleOutput: _ } + <$> (maybe bundleOutputDefault id <<< runNullOrUndefined <$> readProp bundleOutput obj)) where - pscBundle :: String - pscBundle = "pscBundle" + bundleOutput :: String + bundleOutput = "bundleOutput" - pscBundleDefault :: String - pscBundleDefault = joinPath "output" "bundle.js" + bundleOutputDefault :: String + bundleOutputDefault = joinPath "output" "bundle.js" -- cgit v1.2.3