Skip to content

Instantly share code, notes, and snippets.

@mizner
Forked from raphaelkross/webpack.php
Created September 4, 2016 09:59
Show Gist options
  • Save mizner/44845fc860bf392b2c56b5d06f4052cf to your computer and use it in GitHub Desktop.
Save mizner/44845fc860bf392b2c56b5d06f4052cf 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