 
   constructor: (@config) ->
     return unless @config.keyword
+    @publicPath = fs.realpathSync(@config.paths?.public ? 'public')
     @keywordConfig = @config.keyword or {}
     @filePattern = @keywordConfig.filePattern ? /\.(js|css|html)$/
     @keywordMap = @keywordConfig.map or {}

    addMap @keywordMap
    keywords = (RegExp.quote(keyword) for key, replacer of @globalMap)
    @globalRE = RegExp('\\{\\!(' + keywords.join('|') + ')\\!\\}', 'g')


  onCompile: (generatedFiles) ->
    return unless @filePattern
    @prepareKeywords()
    @processFolder @config.paths.public
    if (extraFiles = @keywordConfig.extraFiles) and extraFiles.length
      extraFiles.forEach (file) => @processFile file

fs = require 'fs'
RegExp.quote = require 'regexp-quote'


