-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
30 lines (29 loc) · 1014 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
30
const path = require('path');
module.exports = {
entry: {
index: path.join(__dirname, 'src/js', 'index.js'),
login: path.join(__dirname, 'src/js', 'login.js'),
// about: path.join(__dirname, 'src/js', 'about.js'),
register: path.join(__dirname, 'src/js', 'register.js'),
// unverified: path.join(__dirname, 'src/js', 'unverified.js'),
upload: path.join(__dirname, 'src/js', 'upload.js')
},
output: {
path: path.join(__dirname, 'dist'),
filename: '[name].js' // The final file will be created in dist/build.js
},
module: {
rules: [{
test: /\.css$/, // To load the css in react
use: ['style-loader', 'css-loader'],
include: /src/
}, {
test: /\.jsx?$/, // To load the js and jsx files
loader: 'babel-loader',
exclude: /node_modules/,
query: {
presets: ['es2015', 'react', 'stage-2']
}
}]
}
}