-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
31 lines (29 loc) · 920 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
31
const path = require('path') // require library that allows us to combine paths in a global way
// in -> out
module.exports = {
entry: {
index:['babel-polyfill','./src/index.js'], // index.js (relative pathanme)
edit:['babel-polyfill','./src/edit.js'] // edit.js (relative pathanme)
},
output: {
path: path.resolve(__dirname, 'public/scripts'), // combines paths
filename: '[name]-bundle.js'
},
module: {
rules: [{
test: /\.js$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: {
presets: ['@babel/env']
}
}
}]
},
devServer: {
contentBase:path.resolve(__dirname, 'public'), //must be an absolute path
publicPath:'/scripts/' // where webpack puts out assets
},
devtool:'source-map'
}