-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
29 lines (29 loc) · 995 Bytes
/
webpack.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
module.exports = {
entry: __dirname + '/client/src/index.jsx', // The entry point for the Application (Where ReactDOM.render is called)
watch: true,
module: {
rules: [
{
test: [/\.jsx$/], // Important that webpack compiles our React jsx files too
exclude: /node_modules/, // Ignoring the node_modules so they are not sent over with our client bundle
use: {
loader: 'babel-loader', // Allows Babel and Webpack to work together
options: {
presets: ['@babel/preset-react', '@babel/preset-env'] // Environment Presets... Not 100% what these do
}
}
},
{
test: /\.css$/,
use: [
'style-loader',
'css-loader'
]
}
]
},
output: { // IMPORTANT: This is where we set the bundle to be built into a folder
filename: 'bundle.js', // The name of the file to build
path: __dirname + '/client/dist' // Where Webpack should place the file
}
};