Skip to content

Instantly share code, notes, and snippets.

@mbopp
Last active May 16, 2016 15:14
Show Gist options
  • Save mbopp/dbb28e28f108c898846e43fd718a5159 to your computer and use it in GitHub Desktop.
Save mbopp/dbb28e28f108c898846e43fd718a5159 to your computer and use it in GitHub Desktop.
<?php
$react_env = variable_get('react_environment', 'dist');
if ($react_env == 'dev') {
drupal_add_js('http://localhost:3000/webpack-dev-server.js', array('scope' => 'footer'));
drupal_add_js('http://localhost:3000/bundle.js', array('scope' => 'footer'));
} else {
drupal_add_js(drupal_get_path('module', 'react_app').'/js/dist/bundle.js', array('scope' => 'footer'));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment