Skip to content

Instantly share code, notes, and snippets.

@raphaelkross
Created July 28, 2016 02:09
Show Gist options
  • Save raphaelkross/7bdea758800862cfdde7fd5c5e8b92b3 to your computer and use it in GitHub Desktop.
Save raphaelkross/7bdea758800862cfdde7fd5c5e8b92b3 to your computer and use it in GitHub Desktop.
Enqueue our dynamic webpack code
if(false == IVAN_OFFSET_DEBUG) {
// Register main theme styles and enqueue it.
// Hint: you can unregister it and replace by your own compiled version in a child theme.
wp_enqueue_style( 'ivan-theme-styles', get_template_directory_uri() . '/css/theme-styles'.$prefix.'.css', array(), '1' );
} else {
wp_enqueue_script( 'webpack-dev-server', 'http://localhost:3002/webpack-dev-server.js', array(), null, false );
wp_enqueue_script( 'webpack-bundle', 'http://localhost:3002/hmr/bundle.js', array(), null, false );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment