Skip to content

Instantly share code, notes, and snippets.

@Colour-Full
Created March 11, 2018 19:30
Show Gist options
  • Select an option

  • Save Colour-Full/861cb19fe0d880853c848651715de2ca to your computer and use it in GitHub Desktop.

Select an option

Save Colour-Full/861cb19fe0d880853c848651715de2ca to your computer and use it in GitHub Desktop.
var webpack = require('webpack');
var path = require('path');
module.exports = {
// Since webpack 4 we will need to set in what mode webpack is running
mode: 'development',
// This will be the entry file for all of our React code
entry: [
'./client/index.jsx',
],
// This will be where the final bundle file will be outputed
output: {
path: path.join(__dirname, '/server/public/js/'),
filename: 'bundle.js',
publicPath: 'server/public/js/',
},
// Adding babel loader to compile our javascript and jsx files
module: {
rules: [
{
test: /\.(js|jsx)$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: {
presets: [
'react',
'env',
],
},
},
},
]
},
resolve: {
extensions: ['.js', '.jsx', '.scss'],
},
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment