-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack_common.js
42 lines (40 loc) · 1.21 KB
/
webpack_common.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
var path = require('path');
var webpack = require('webpack');
// Note: webpack has its own common / merge system. This is not used here.
module.exports = {
vendorLibList: ['react', 'react-dom', 'react-redux', 'redux', 'redux-saga', 'redux-observable', 'react-router'],
output: {
library: "app",
path: path.join(__dirname, 'dist'),
filename: '[name]_bundle.js',
publicPath: '/static/'
},
resolve: {
modules: [path.resolve(__dirname, "app"), "node_modules"],
extensions: ['.jsx', '.js', '.tsx', '.ts']
},
splitChunks: {
cacheGroups: {
commons: {
test: /[\\/]node_modules[\\/]/,
name: 'vendor',
chunks: 'all'
}
}
},
rules: [{
test: /\.tsx?$/,
use: 'awesome-typescript-loader?configFileName=tsconfig_webpack.json&silent=true',
},
{
// It would be nice to extract the styles (using the extract text plugin), but that would loose hot module replacement
test: /\.s?css$/,
use: ["style-loader", "css-loader", "sass-loader"]
},
{
// It would be nice to extract the styles (using the extract text plugin), but that would loose hot module replacement
test: /\.svg$/,
use: ["react-svg-loader"]
},
]
}