-
Notifications
You must be signed in to change notification settings - Fork 3
/
webpack.config.js
49 lines (42 loc) · 1.27 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
const path = require('path');
module.exports = {
// Define the entry point of your application
entry: './src/index.js',
// Define the output directory and filenames
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'bundle.js'
},
// Define module rules for your loaders
module: {
rules: [
{
test: /\.js$/, // Apply this rule to JavaScript files
exclude: /node_modules/,
use: {
loader: 'babel-loader', // Use babel-loader to transpile JavaScript files
options: {
presets: ['@babel/preset-env', 'react-app'] // Presets used for Babel
}
}
},
// Add other rules for different file types here
]
},
// Define plugins if you have any
plugins: [
// List your plugins here
],
// Define a fallback for the 'url' module (Webpack 5 no longer polyfills Node.js core modules)
resolve: {
fallback: {
url: require.resolve('url/')
}
},
// Define development options
devServer: {
static: './dist',
},
// Set the mode to development or production
mode: 'development',
};