aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/PursLoader/Loader.purs
diff options
context:
space:
mode:
Diffstat (limited to 'src/PursLoader/Loader.purs')
-rw-r--r--src/PursLoader/Loader.purs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/PursLoader/Loader.purs b/src/PursLoader/Loader.purs
index 97954f6..acb0993 100644
--- a/src/PursLoader/Loader.purs
+++ b/src/PursLoader/Loader.purs
@@ -21,6 +21,8 @@ import Data.String.Regex (Regex(), match, noFlags, regex)
21 21
22import Unsafe.Coerce (unsafeCoerce) 22import Unsafe.Coerce (unsafeCoerce)
23 23
24import PursLoader.Debug (debug)
25import PursLoader.JsStringEscape (jsStringEscape)
24import PursLoader.LoaderRef 26import PursLoader.LoaderRef
25 ( AsyncCallback() 27 ( AsyncCallback()
26 , LoaderRef() 28 , LoaderRef()
@@ -30,8 +32,6 @@ import PursLoader.LoaderRef
30 , addDependency 32 , addDependency
31 , resourcePath 33 , resourcePath
32 ) 34 )
33
34import PursLoader.Debug (debug)
35import PursLoader.Path (dirname, joinPath, relative) 35import PursLoader.Path (dirname, joinPath, relative)
36import PursLoader.Plugin as Plugin 36import PursLoader.Plugin as Plugin
37 37
@@ -79,13 +79,13 @@ loader ref source = do
79 else moduleExport <<< modulePath <$> name 79 else moduleExport <<< modulePath <$> name
80 where 80 where
81 bundleExport :: String -> String 81 bundleExport :: String -> String
82 bundleExport name' = "module.exports = require('" ++ path ++ "')['" ++ name' ++ "'];" 82 bundleExport name' = "module.exports = require('" ++ jsStringEscape path ++ "')['" ++ name' ++ "'];"
83 where 83 where
84 path :: String 84 path :: String
85 path = relative resourceDir pluginContext.options.bundleOutput 85 path = relative resourceDir pluginContext.options.bundleOutput
86 86
87 moduleExport :: String -> String 87 moduleExport :: String -> String
88 moduleExport path = "module.exports = require('" ++ path ++ "');" 88 moduleExport path = "module.exports = require('" ++ jsStringEscape path ++ "');"
89 89
90 modulePath :: String -> String 90 modulePath :: String -> String
91 modulePath = relative resourceDir <<< joinPath pluginContext.options.output 91 modulePath = relative resourceDir <<< joinPath pluginContext.options.output