@@ -105,6 +105,12 @@ outputDirectory = strOption $
105105 <> showDefault
106106 <> help "The output directory"
107107
108+requirePath :: Parser (Maybe FilePath)
109+requirePath = optional $ strOption $
110+ short 'r'
111+ <> long "require-path"
112+ <> help "The path prefix to use for require() calls in the generated JavaScript"
113+
108114noTco :: Parser Bool
109115noTco = switch $
110116 long "no-tco"
@@ -113,18 +119,18 @@ noTco = switch $
113119noMagicDo :: Parser Bool
114120noMagicDo = switch $
115121 long "no-magic-do"
116− <> help "Disable the optimization that overloads the do keyword to generate efficient code specifically for the Eff monad."
122+ <> help "Disable the optimization that overloads the do keyword to generate efficient code specifically for the Eff monad"
117123
118124noOpts :: Parser Bool
119125noOpts = switch $
120126 long "no-opts"
121− <> help "Skip the optimization phase."
127+ <> help "Skip the optimization phase"
122128
123129comments :: Parser Bool
124130comments = switch $
125131 short 'c'
126132 <> long "comments"
127− <> help "Include comments in the generated code."
133+ <> help "Include comments in the generated code"
128134
129135verboseErrors :: Parser Bool
130136verboseErrors = switch $
@@ -146,7 +152,10 @@ options = P.Options <$> noTco
146152 <*> noOpts
147153 <*> verboseErrors
148154 <*> (not <$> comments)
149− <*> pure P.MakeOptions
155+ <*> additionalOptions
156+ where
157+ additionalOptions =
158+ P.MakeOptions <$> requirePath
150159
151160pscMakeOptions :: Parser PSCMakeOptions
152161pscMakeOptions = PSCMakeOptions <$> many inputFile