From: eric thul Date: Sat, 26 Dec 2015 00:24:02 +0000 (-0500) Subject: Updating bundle output option name X-Git-Tag: 0.5.0~1^2~2 X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=d78112147d02e263a5b000cb0b3b9ff84aa5c89a;hp=9764d2a7d5e6d9cf081dcbc162dac01f95d452b3;p=github%2Ffretlink%2Fpurs-loader.git Updating bundle output option name --- 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"