-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy pathwebpack.config.js
48 lines (46 loc) · 1.1 KB
/
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
const path = require('path');
const ESLintPlugin = require('eslint-webpack-plugin');
const devServerPort = 8000;
module.exports = {
entry: path.join(__dirname, 'examples/parent-child-demo/src/index.js'),
output: {
path: path.join(__dirname, 'dist-demo'),
filename: 'client-bundle.js',
publicPath: '/dist-demo/'
},
resolve: {
alias: {
'react-lifecycle-visualizer': path.join(__dirname, 'src'),
},
extensions: ['.js', '.jsx']
},
plugins: [new ESLintPlugin({ emitWarning: true })],
module: {
rules: [{
test: /\.(js|jsx)$/,
use: [{
loader: 'babel-loader',
options: { configFile: './.babelrc' }
}],
exclude: /node_modules/
}, {
test: /\.(css|scss)$/,
use: [
'style-loader',
'css-loader',
{
loader: 'sass-loader',
options: {
// eslint-disable-next-line global-require
implementation: require('sass')
}
}
]
}]
},
devServer: {
host: '0.0.0.0',
port: devServerPort,
static: [path.join(__dirname, 'public')]
}
};