Skip to content

Commit

Permalink
adds js processing and enqueues in theme
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Sorensen authored and Peter Sorensen committed Aug 18, 2019
1 parent 3d73e9c commit d33d950
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ function _s_widgets_init() {
*/
function _s_scripts() {
wp_enqueue_style( 'main.css', get_stylesheet_directory_uri() . '/dist/style.css', false, '6.9' );
wp_enqueue_script( 'main.js', get_stylesheet_directory_uri() . '/dist/main.js', false, false, true );
}
add_action( 'wp_enqueue_scripts', '_s_scripts' );

Expand Down
1 change: 1 addition & 0 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
alert('test');
5 changes: 4 additions & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
const ExtractTextPlugin = require('extract-text-webpack-plugin')

module.exports = {
entry: './src/style.css',
entry: [
'./src/style.css',
'./src/index.js'
],
mode: process.env.NODE_ENV,
module: {
rules: [
Expand Down

0 comments on commit d33d950

Please sign in to comment.