From c1366a3f03bd8c20336e4e55ff1dd12bc3bb95ca Mon Sep 17 00:00:00 2001 From: Patrick Steele-Idem Date: Tue, 4 Mar 2014 15:23:59 -0700 Subject: [PATCH] Moved out the optimizer plugin to a top-level module --- optimizer-plugin/lib/dependency-rhtml.js | 40 ------------------- .../lib/raptor-optimizer-plugin.js | 3 -- optimizer-plugin/package.json | 3 -- 3 files changed, 46 deletions(-) delete mode 100644 optimizer-plugin/lib/dependency-rhtml.js delete mode 100644 optimizer-plugin/lib/raptor-optimizer-plugin.js delete mode 100644 optimizer-plugin/package.json diff --git a/optimizer-plugin/lib/dependency-rhtml.js b/optimizer-plugin/lib/dependency-rhtml.js deleted file mode 100644 index b17d0f29a..000000000 --- a/optimizer-plugin/lib/dependency-rhtml.js +++ /dev/null @@ -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); - } -}; \ No newline at end of file diff --git a/optimizer-plugin/lib/raptor-optimizer-plugin.js b/optimizer-plugin/lib/raptor-optimizer-plugin.js deleted file mode 100644 index fdf415d23..000000000 --- a/optimizer-plugin/lib/raptor-optimizer-plugin.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function(optimizer, config) { - optimizer.dependencies.registerPackageType('rhtml', require('./dependency-rhtml')); -}; \ No newline at end of file diff --git a/optimizer-plugin/package.json b/optimizer-plugin/package.json deleted file mode 100644 index bcb5870ea..000000000 --- a/optimizer-plugin/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "./lib/raptor-optimizer-plugin.js" -} \ No newline at end of file