Class MinimizeSassManager

    • Method Detail

      • compileCss

        public String compileCss​(String content,
                                 String sassLocation,
                                 String location,
                                 boolean minimize,
                                 long lastModified)
                          throws URISyntaxException,
                                 io.bit3.jsass.CompilationException,
                                 IOException
        Compile a sass file. The source map of the file is generated and stored in the source map cache
        Parameters:
        content - The content of the sass file
        sassLocation - The location of the sass file, e.g. plugin:core-ui:/resources/example/test.scss
        location - The location of the compiled css, e.g. plugin:core-ui:/resources/example/test.css or plugin:core-ui:/resources/example/test.min.css
        minimize - Minimize the output
        lastModified - The date of last modification
        Returns:
        The content of the compiled, and optionally minimized, sass file
        Throws:
        URISyntaxException - If an exception occurred
        io.bit3.jsass.CompilationException - If an exception occurred
        IOException - If an exception occurred
      • generateCssSourceMap

        public String generateCssSourceMap​(String content,
                                           String location,
                                           String extension,
                                           String internalContextPath,
                                           String externalContextPath,
                                           boolean minimize,
                                           long lastModified)
                                    throws URISyntaxException,
                                           io.bit3.jsass.CompilationException,
                                           IOException
        Generate the source map of compiled sass file. The source map of the file is generated and stored in the source map cache
        Parameters:
        content - The content of the file
        location - The location of the source map file, e.g. plugin:core-ui:/resources/example/test.scss.map or plugin:core-ui:/resources/example/test.css.map
        extension - The extension of the sass file, e.g. scss or sass
        internalContextPath - The internal context path
        externalContextPath - The external context path
        minimize - Minimize the output
        lastModified - The date of last modification
        Returns:
        The content of the source map, or null if no source map was generated
        Throws:
        URISyntaxException - If an exception occurred
        io.bit3.jsass.CompilationException - If an exception occurred
        IOException - If an exception occurred
      • _compileCss

        private io.bit3.jsass.Output _compileCss​(String content,
                                                 String fileName,
                                                 URI uri,
                                                 boolean minimize,
                                                 String extension)
                                          throws URISyntaxException,
                                                 io.bit3.jsass.CompilationException
        Compile a SCSS and output the JSASS result containing the content and source map
        Parameters:
        content - The content of the file
        fileName - The name of the compiled sass file, e.g. test.css or test.min.css
        uri - The contextualized uri of the sass file, e.g. /EXTERNAL_CONTEXT/plugins/core-ui/resources/example/test.scss
        minimize - Minimize the output
        extension - The sass extension such as scss or sass
        Returns:
        The output of the compilation
        Throws:
        URISyntaxException - if an error occurred with the uri syntax
        io.bit3.jsass.CompilationException - if an error occured when compiling the sass