Moved out the optimizer plugin to a top-level module

This commit is contained in:
Patrick Steele-Idem 2014-03-04 15:23:59 -07:00
parent ca2dffc968
commit c1366a3f03
3 changed files with 0 additions and 46 deletions

View File

@ -1,40 +0,0 @@
var raptorTemplatesCompiler = require('../../compiler');
var nodePath = require('path');
function reader(path, context, callback) {
raptorTemplatesCompiler.compileFile(path, callback);
}
module.exports = {
properties: {
'path': 'string'
},
init: function() {
if (!this.path) {
throw new Error('"path" is required for a Raptor Templates dependency');
}
this.path = this.resolvePath(this.path);
},
getDependencies: function() {
/*
You may be wondering why we return a set of dependencies instead of
just providing a "read" method. By piggy backing off the "require"
dependency type we can automatically have our compiled CommonJS module
inspected for additional dependencies.
*/
return [
{
type: 'require',
resolvedPath: this.path,
reader: reader
}
];
},
getDir: function() {
return nodePath.dirname(this.path);
}
};

View File

@ -1,3 +0,0 @@
module.exports = function(optimizer, config) {
optimizer.dependencies.registerPackageType('rhtml', require('./dependency-rhtml'));
};

View File

@ -1,3 +0,0 @@
{
"main": "./lib/raptor-optimizer-plugin.js"
}