-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathwebpack.config.js
More file actions
executable file
·37 lines (36 loc) · 872 Bytes
/
webpack.config.js
File metadata and controls
executable file
·37 lines (36 loc) · 872 Bytes
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
const path = require('path');
const config = {
devServer: {
contentBase: path.join(__dirname, 'build'),
compress: true,
port: 8080,
hot: true,
lazy: false,
},
entry: path.resolve(__dirname, 'app/main.jsx'),
output: {
path: path.resolve(__dirname, 'build'),
filename: 'bundle.js',
},
module: {
rules: [{
test: /\.jsx?$/, // A regexp to test the require path. accepts either js or jsx
loader: 'babel-loader', // The module to load. "babel" is short for "babel-loader"
exclude: /node_modules/,
options: {
presets: ['es2015', 'react', 'stage-0'],
},
}, {
test: /\.scss$/,
use: [{
loader: 'style-loader',
}, {
loader: 'css-loader',
}, {
loader: 'sass-loader',
}],
exclude: /node_modules/,
}],
},
};
module.exports = config;