├── .gitignore ├── Readme.md ├── build.js ├── dist ├── codepen-react-0.1.0.js └── codepen-react-0.1.1.js ├── index.js └── package.json /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules -------------------------------------------------------------------------------- /Readme.md: -------------------------------------------------------------------------------- 1 | # Deprecated 2 | 3 | Thankfully, this package is no longer needed. CodePen now supports Babel and React via the JavaScript options panel! For more, see the [CodePen blog post](http://blog.codepen.io/2015/05/19/babel-now-on-codepen-write-es6-javascript-and-react-jsx/). 4 | -------------------------------------------------------------------------------- /build.js: -------------------------------------------------------------------------------- 1 | var buildify = require('buildify'); 2 | var fs = require('fs'); 3 | 4 | var packageInfo = JSON.parse(fs.readFileSync('package.json')); 5 | 6 | buildify() 7 | .concat([ 8 | 'node_modules/react/dist/react.min.js', 9 | 'node_modules/babel/browser.js', 10 | 'index.js' 11 | ]) 12 | .save('./dist/codepen-react-' + packageInfo.version + '.js'); 13 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Adapted from http://codepen.io/chriscoyier/pen/yIgqi.js 3 | */ 4 | (function() { 5 | function runScripts() { 6 | var bodyScripts = 'body script:not([src])'; 7 | Array.prototype.forEach.call(document.querySelectorAll(bodyScripts), function setJSXType(element) { 8 | babel.run(element.innerText); 9 | }); 10 | }; 11 | 12 | if (window.addEventListener) { 13 | window.addEventListener('DOMContentLoaded', runScripts, false); 14 | } else { 15 | window.attachEvent('onload', runScripts); 16 | } 17 | })(); -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "codepen-react", 3 | "version": "0.1.1", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "author": "Brad Daily", 10 | "license": "BSD-3-Clause", 11 | "dependencies": { 12 | "babel": "^4.7.8", 13 | "buildify": "^0.4.0", 14 | "react": "^0.13.0" 15 | } 16 | } 17 | --------------------------------------------------------------------------------