-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathwebpack.client.js
More file actions
42 lines (41 loc) · 1.05 KB
/
webpack.client.js
File metadata and controls
42 lines (41 loc) · 1.05 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
33
34
35
36
37
38
39
40
41
42
/**
* Only needed for front end application
*/
const HtmlWebpackPlugin = require('html-webpack-plugin');
const ExtractTextWebpackPlugin = require('extract-text-webpack-plugin');
module.exports = {
entry: './src/client.jsx',
output: {
filename: '[name].[chunkhash].bundle.js'
},
devServer: {
host: 'localhost',
port: 4200,
historyApiFallback: true,
proxy: {
'/query': 'http://localhost:3000/query'
}
},
plugins: [
new HtmlWebpackPlugin({
template: './src/index.html'
}),
new ExtractTextWebpackPlugin('style.[chunkhash].bundle.css')
],
module: {
rules: [{
test: /\.jsx/,
exclude: /node_modules/,
use: {
loader: 'babel-loader'
}
}, {
test: /\.css/,
exclude: /node_modules/,
use: ExtractTextWebpackPlugin.extract({
fallback: 'style-loader',
use: ['css-loader']
})
}]
}
};