Safe Haskell | None |
---|---|
Language | Haskell98 |
Bundles compiled PureScript modules for the browser.
This module takes as input the individual generated modules from Make
and
performs dead code elimination, filters empty modules,
and generates the final Javascript bundle.
- bundle :: MonadError ErrorMessage m => [(ModuleIdentifier, String)] -> [ModuleIdentifier] -> Maybe String -> String -> Maybe FilePath -> m String
- data ModuleIdentifier = ModuleIdentifier String ModuleType
- moduleName :: ModuleIdentifier -> String
- data ModuleType
- data ErrorMessage
- printErrorMessage :: ErrorMessage -> [String]
- getExportedIdentifiers :: MonadError ErrorMessage m => String -> JSAST -> m [String]
Documentation
:: MonadError ErrorMessage m | |
=> [(ModuleIdentifier, String)] | The input modules. Each module should be javascript rendered from |
-> [ModuleIdentifier] | Entry points. These module identifiers are used as the roots for dead-code elimination |
-> Maybe String | An optional main module. |
-> String | The namespace (e.g. PS). |
-> Maybe FilePath | The require path prefix |
-> m String |
The bundling function. This function performs dead code elimination, filters empty modules and generates and prints the final Javascript bundle.
data ModuleIdentifier Source
A module is identified by its module name and its type.
data ModuleType Source
Modules are either "regular modules" (i.e. those generated by psc) or foreign modules.
data ErrorMessage Source
The type of error messages. We separate generation and rendering of errors using a data type, in case we need to match on error types later.
printErrorMessage :: ErrorMessage -> [String] Source
Prepare an error message for consumption by humans.
getExportedIdentifiers :: MonadError ErrorMessage m => String -> JSAST -> m [String] Source