diff options
author | eric thul <thul.eric@gmail.com> | 2015-05-14 22:21:26 -0400 |
---|---|---|
committer | eric thul <thul.eric@gmail.com> | 2015-05-14 22:21:26 -0400 |
commit | d2879ae0b5c3f9d2b73092fcee866ffd48b9e702 (patch) | |
tree | 00a768996241a302afa2273c1fde78dfaca2f1da /src/Loader.purs | |
parent | 6ae16483eafbfc33cb8b14bb5845fd28647ca4e1 (diff) | |
parent | fc72dc01dbd79d531ca4aa73ad4e719a40a58f98 (diff) | |
download | purs-loader-d2879ae0b5c3f9d2b73092fcee866ffd48b9e702.tar.gz purs-loader-d2879ae0b5c3f9d2b73092fcee866ffd48b9e702.tar.zst purs-loader-d2879ae0b5c3f9d2b73092fcee866ffd48b9e702.zip |
Merge branch 'master' of github.com:ethul/purs-loader
Diffstat (limited to 'src/Loader.purs')
-rw-r--r-- | src/Loader.purs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/Loader.purs b/src/Loader.purs index aae51c0..fedc424 100644 --- a/src/Loader.purs +++ b/src/Loader.purs | |||
@@ -26,7 +26,7 @@ import PursLoader.Glob (Glob(), glob) | |||
26 | import PursLoader.LoaderRef (LoaderRef(), Loader(), async, cacheable, clearDependencies, addDependency, query, resourcePath) | 26 | import PursLoader.LoaderRef (LoaderRef(), Loader(), async, cacheable, clearDependencies, addDependency, query, resourcePath) |
27 | import PursLoader.LoaderUtil (getRemainingRequest, parseQuery) | 27 | import PursLoader.LoaderUtil (getRemainingRequest, parseQuery) |
28 | import PursLoader.OS (eol) | 28 | import PursLoader.OS (eol) |
29 | import PursLoader.Options (pscMakeOptions, pscMakeDefaultOutput, pscMakeOutputOption) | 29 | import PursLoader.Options (loaderSrcOption, pscMakeOptions, pscMakeDefaultOutput, pscMakeOutputOption) |
30 | import PursLoader.Path (dirname, join, relative, resolve) | 30 | import PursLoader.Path (dirname, join, relative, resolve) |
31 | 31 | ||
32 | foreign import cwd "var cwd = process.cwd();" :: String | 32 | foreign import cwd "var cwd = process.cwd();" :: String |
@@ -43,8 +43,8 @@ indexFilename = "index.js" | |||
43 | 43 | ||
44 | (!!!) = flip (!!) | 44 | (!!!) = flip (!!) |
45 | 45 | ||
46 | pursPattern :: String -> String | 46 | pursPattern :: [String] -> String |
47 | pursPattern root = join [ "{" ++ joinWith "," [ bowerPattern, root ] ++ "}" | 47 | pursPattern srcs = join [ "{" ++ joinWith "," ([ bowerPattern ] <> srcs) ++ "}" |
48 | , "**" | 48 | , "**" |
49 | , "*.purs" | 49 | , "*.purs" |
50 | ] | 50 | ] |
@@ -86,10 +86,10 @@ loader' ref source = do | |||
86 | liftEff $ cacheable ref | 86 | liftEff $ cacheable ref |
87 | 87 | ||
88 | let request = getRemainingRequest ref | 88 | let request = getRemainingRequest ref |
89 | root = dirname $ relative cwd request | ||
90 | parsed = parseQuery $ query ref | 89 | parsed = parseQuery $ query ref |
90 | srcs = loaderSrcOption parsed | ||
91 | opts = pscMakeOptions parsed | 91 | opts = pscMakeOptions parsed |
92 | pattern = pursPattern root | 92 | pattern = pursPattern $ fromMaybe [] srcs |
93 | key = match moduleRegex source >>= (!!!) 1 | 93 | key = match moduleRegex source >>= (!!!) 1 |
94 | 94 | ||
95 | files <- glob pattern | 95 | files <- glob pattern |