-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathwebpack.config.js
49 lines (45 loc) · 1.26 KB
/
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
//import webpack module
const webpack = require("webpack");
//define entry and exit points, i.e. takes in JS files and spits out a bundle
const config = {
entry: {
index: __dirname + '/public/js/src/index.jsx'
},
output: {
path: __dirname + '/public/dist',
filename: '[name].bundle.js'
},
resolve:{
extensions: ['.js','.jsx','.css']
},
module: {
rules: [
{
test: /\.jsx?/,
exclude: /node_modules/,
use: 'babel-loader'
//Use this option if you want to get rid of the babel.config.js file
// use: {
// loader: 'babel-loader',
// options: {
// presets: ["@babel/preset-env", "@babel/preset-react"]
// }
// }
},
{
test: /\.(svg|png|jpg|jpeg|gif)$/,
loader: "file-loader",
options: {
name: "[name].[ext]",
outputPath: "/images",
},
},
{
test: /\.css$/i,
use: ["style-loader", "css-loader"],
},
]
}
};
//export module
module.exports = config;