diff --git a/lib/index.js b/lib/index.js
index <HASH>..<HASH> 100644
--- a/lib/index.js
+++ b/lib/index.js
@@ -3,6 +3,8 @@ var extname = require('path').extname;
 var _ = require('lodash');
 var Prism = require('prismjs');
 var he = require('he');
+var vm = require('vm');
+var fs = require('fs');
 
 var jsonSyntax = require('./prism-json');
 
@@ -17,11 +19,20 @@ module.exports = function(options) {
   Prism.languages.json = options.json ? options.json : jsonSyntax;
 
   return function(files, metalsmith, done) {
+
     setImmediate(done);
 
     function requireLanguage(language) {
+
       if (!Prism.languages[language]) {
-        require('prismjs/components/prism-' + language);
+
+        var path = require.resolve('prismjs/components/prism-' + language);
+        var code = fs.readFileSync(path).toString();
+
+        // make Prism object available in the plugins local scope
+        vm.runInNewContext(code, {
+            Prism: Prism
+        });
       }
     }
pass Prism context when requiring the language plugins