diff --git a/index.js b/index.js index d7ea0429..09d02310 100644 --- a/index.js +++ b/index.js @@ -1,16 +1,13 @@ /* eslint-env node */ 'use strict'; +let objectHash = require('object-hash'); module.exports = { name: 'ember-hbs-minifier', - _getMinifierOptions() { - return (this.parent && this.parent.options) || (this.app && this.app.options) || {}; - }, - _setupPreprocessorRegistry(app) { let registry = app.registry; - let options = this._getMinifierOptions(); + let options = app.options || {}; let config = options['ember-hbs-minifier'] || {}; let HbsMinifierPlugin = require('./hbs-minifier-plugin')(config.skip || {}); @@ -18,7 +15,7 @@ module.exports = { name: 'hbs-minifier-plugin', plugin: HbsMinifierPlugin, baseDir() { return __dirname; }, - cacheKey() { return 'ember-hbs-minifier'; } + cacheKey() { return `ember-hbs-minifier-${objectHash.MD5(config)}`; } }); }, diff --git a/package.json b/package.json index eb9da879..bbcecc82 100644 --- a/package.json +++ b/package.json @@ -48,7 +48,8 @@ "ember-welcome-page": "^2.0.2", "eslint-config-simplabs": "0.2.2", "jest": "^21.2.0", - "loader.js": "^4.2.3" + "loader.js": "^4.2.3", + "object-hash": "1.2.0" }, "engines": { "node": ">= 4"