Created
March 11, 2018 19:30
-
-
Save Colour-Full/861cb19fe0d880853c848651715de2ca to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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