-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
33 lines (31 loc) · 1.02 KB
/
webpack.config.js
File metadata and controls
33 lines (31 loc) · 1.02 KB
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
const path = require("path");
module.exports = {
entry: './src/app.js',
output:{
//the absolute path
path: path.join(__dirname, 'public'),
filename: 'bundle.js'
},
module: {
rules:[{
loader: 'babel-loader',
test: /\.js$/,
exclude:/node_modules/
},{
test:/\.s?css$/, //looking for every file that ends with this. After that, specified the loder
use: [//array of loders
'style-loader',
'css-loader',
'sass-loader'//behind the scenes, sass-loader use node-sass to compile the file to regular css
//for this loader is necessary node-sass
]
}]
},
//con esta linea es posible debugguear la linea que lanza error en consola
//sin esta solo se veria una linea en el bundle, mas no el error source
devtool:'cheap-module-eval-source-map',
//like live server
devServer:{
contentBase: path.join(__dirname, 'public')
}
}