-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
34 lines (32 loc) · 898 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
32
33
34
const path = require('path');
// console.log(__dirname)
// console.log(path.join(__dirname, 'public'))
module.exports = {
entry: './src/app.js',
output: {
// have to give absolute path for path key
path: path.join(__dirname, 'public'),
filename: 'bundle.js'
},
module: {
rules: [{
loader: 'babel-loader',
test: /\.js$/,
exclude: /node_modules/
}, {
test: /\.s?css$/,
use: [
'style-loader',
'css-loader',
'sass-loader'
]
}]
},
devtool: 'cheap-module-eval-source-map',
// devServer is serving up bundle.js from memory, no need to have a physical bundle.js anymore for development
// devServer combines live-server's features with webpack's build feature so they both can be done at the same time
// ** check scripts to see this
devServer: {
contentBase: path.join(__dirname, 'public')
}
}