// Set up some variables to get webpack working...

// require webpack so plugins can be used
var webpack = require( "webpack" ),
    
    /*
     * Bring in the common chunks plugin so shared JS code is broken
     * out into a file called "common.js"
     */
    commonsChunkPlugin = new webpack.optimize.CommonsChunkPlugin( "common.js" ),
    
    // Bring in the uglify plugin to minify all .js files
    UglifyJsPlugin = new webpack.optimize.UglifyJsPlugin({
      compress: {
        warnings: false
      }
    });


// Configure webpack
module.exports = {

  // Define multiple entry points to build out multiple files
  entry: {
    
    // Compile out a "home.js" file with specific modules with CommonJS
    home: [
      "./webpack/entry_GLOBALS",
      "./webpack/entry_ASIDE",
      "./webpack/entry_HOMEPAGE",
      "./webpack/entry_FRONTPAGE_ADS_AMD"
    ],
    
    // Compile a "posts.js" file with specific modules with CommonJS
    posts: [
      "./webpack/entry_GLOBALS",
      "./webpack/entry_ASIDE",
      "./webpack/entry_SHARING",
      "./webpack/config/async-sharing",
      "./webpack/config/prism",
      "./webpack/config/comment-reply"
    ],

    // Compile a "codePage.js" file with specific modules with CommonJS
    codePage: [
      "./webpack/entry_GLOBALS",
      "./webpack/entry_ASIDE",
      "./webpack/entry_PAGECODE",
      "./webpack/config/prism"
    ],

    // Compile a "sitemap.js" file with specific modules with CommonJS
    sitemap: [
      "./webpack/entry_GLOBALS",
      "./webpack/entry_ASIDE",
      "./webpack/entry_SITEMAP"
    ],

    // Compile a "regular.js" file with specific modules with CommonJS
    pagination: [
      "./webpack/entry_GLOBALS",
      "./webpack/entry_ASIDE",
      "./webpack/entry_PAGINATION"
    ],

    // Compile a "regular.js" file with specific modules with CommonJS
    regular: [
      "./webpack/entry_GLOBALS",
      "./webpack/entry_ASIDE"
    ]
  },

  /*
   * Output the files to the WordPress /js folder & name them based on
   * their array name
   */
  output: {
    path: "wp-content/themes/kaidez-swiss/js/",
    filename: "[name].js"
  },

  // Set up loaders, which are basically plugins for webpack
  module: {
    loaders: [
      
      // Inject style modules into a <style> tag
      { test: /\.css$/, loader: "style-loader!css-loader" },
      
      // Preprocess SASS files
      { test: /\.scss$/,loader: 'style!css!sass' }, 

      // Expose jQuery to the window object with expose-loader
      { test: /jquery\.js$/, loader: 'expose?jQuery' },

      // Expose enquire.js to the window object with expose-loader
      { test: /enquire\.js$/, loader: 'expose?enquire' }
    ]
  },

  // Configure some internal webpack modules as plugins
  plugins: [
    commonsChunkPlugin, // Split out shared JS code into common chunks
    UglifyJsPlugin // Minify the .js files that webpack builds out
  ]
};
@@ -686,37 +686,24 @@
 pecific 
-modules with 
 CommonJS
 %0A    hom
@@ -690,24 +690,32 @@
 fic CommonJS
+ modules
 %0A    home: %5B
@@ -914,37 +914,24 @@
 pecific 
-modules with 
 CommonJS
 %0A    pos
@@ -918,24 +918,32 @@
 fic CommonJS
+ modules
 %0A    posts: 
@@ -1210,37 +1210,24 @@
 pecific 
-modules with 
 CommonJS
 %0A    cod
@@ -1214,24 +1214,32 @@
 fic CommonJS
+ modules
 %0A    codePag
@@ -1429,37 +1429,24 @@
 pecific 
-modules with 
 CommonJS
 %0A    sit
@@ -1433,24 +1433,32 @@
 fic CommonJS
+ modules
 %0A    sitemap
@@ -1575,39 +1575,42 @@
   // Compile a %22
-regular
+pagination
 .js%22 file with s
@@ -1617,37 +1617,24 @@
 pecific 
-modules with 
 CommonJS
 %0A    pag
@@ -1621,24 +1621,32 @@
 fic CommonJS
+ modules
 %0A    paginat
@@ -1812,29 +1812,16 @@
 fic 
-modules with 
 CommonJS
 %0A   
@@ -1816,16 +1816,24 @@
 CommonJS
+ modules
 %0A    reg

update comments