Put resources.spec into your public HTTP directory. List there your css and js files. Devide them over some sets.
set mainPage css mainPage.css js mainPage.js js jQuery.js
do rs <- getResourceSetsForImport Development "public/resources.js" return "<html><head>"++(htmlImportList "mainPage" rs)++"</head><body/></html>"
- htmlImportList :: String -> ResourceSetsForImport -> String
- getResourceSetsForImport :: ImportType -> FilePath -> IO (Either String ResourceSetsForImport)
- cleanResourceFiles :: ResourceSpec -> IO ()
- data ResourceSpec
- parseSpec :: FilePath -> IO ResourceSpec
- check :: ResourceSpec -> IO (Either String ())
- data ImportType
- newtype ResourceSetsForImport = ResourceSetsForImport [ResourceSetForImport]
- generateResources :: ImportType -> ResourceSpec -> IO ResourceSetsForImport
Generating import list for HTML resources
ResourceSetsForImport ready. It will generate agregated css and js files if needed.
It will change directory to one of spec file. It agregates will be placed there.
When done it will change back to the oryginal dir
Cleans all files that could be created by this system based on spec. It requires current directory to be in specification file directory
Check if your spec file is compleate and consistent with FS
Performs check. Left is error with some description. * Fails with css and js files avaible but not listed in spec. * Fails with css and js files that are in spec, but not avaible.
We can import resources for development (no joined, gziped or minified) or for production.