var ThemingContext = require('./ThemingContext');
var lessParser = require('./less-parser');
var logger = require('raptor-logging').logger(module);

module.exports = function create(config) {

    return {
        properties: {
            path: 'string'
        },

        // we don't actually produce JavaScript or CSS
        contentType: 'none',

        init: function(optimizerContext, callback) {
            if (!lessParser.exists()) {
                return callback(new Error('Unable to handle themed Less dependency for path "' + this.path + '". The "less" module was not found. This module should be installed as a top-level application module.'));
            }

            this.resolvedPath = this.requireResolvePath(this.path);
            callback();
        },

        onAddToPageBundle: function(bundle, optimizerContext) {
            var themingContext = ThemingContext.getThemingContext(optimizerContext);
            themingContext.addThemeImport(this);

            if (logger.isDebugEnabled()) {
                logger.debug('Added theme import: ' + this.resolvedPath);
            }
        },

        onAddToAsyncPageBundle: function(bundle, optimizerContext) {
            var themingContext = ThemingContext.getThemingContext(optimizerContext);
            themingContext.addThemeImport(this);

            if (logger.isDebugEnabled()) {
                logger.debug('Added theme import: ' + this.resolvedPath);
            }
        },

        read: function(optimizerContext, callback) {
            return null;
        },

        calculateKey: function() {
            // use the absolute path to the imported resource as the key
            return this.resolvedPath;
        }
    };
};

@@ -687,25 +687,17 @@
    this.
-resolvedP
+p
 ath = th
@@ -1063,33 +1063,25 @@
 t: ' + this.
-resolvedP
+p
 ath);%0A      
@@ -1406,25 +1406,17 @@
  + this.
-resolvedP
+p
 ath);%0A  
@@ -1665,17 +1665,9 @@
 his.
-resolvedP
+p
 ath;

Store resolved path in path property (don't use separate resolvedPath property)