forked from tytzM17/Lokian.eth
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.webpack.config.example.txt
50 lines (47 loc) · 1.31 KB
/
.webpack.config.example.txt
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
49
50
module.exports = {
// change to .tsx if necessary
entry: './src/index.tsx',
output: {
filename: 'bundle.js',
},
mode: 'production',
resolve: {
// changed from extensions: [".js", ".jsx"]
extensions: ['.ts', '.tsx', '.js', '.jsx'],
},
module: {
rules: [
// load images in src/sprites folder
{
test: /\.(jpg|png|gif|svg)$/,
loader: 'image-webpack-loader',
// Specify enforce: 'pre' to apply the loader
// before url-loader/svg-url-loader
// and not duplicate it in rules with them
enforce: 'pre'
},
{
test: /\.(jpg|png)$/,
loader: 'url-loader',
options: {
// Images larger than 10 KB won’t be inlined
limit: 10 * 1024
},
},
// css loader
{
test: /\.css$/i,
use: ['style-loader', 'css-loader'],
},
// changed from { test: /\.jsx?$/, use: { loader: 'babel-loader' }, exclude: /node_modules/ },
{ test: /\.(t|j)sx?$/, use: { loader: 'ts-loader' }, exclude: /node_modules/ },
// addition - add source-map support
{ enforce: 'pre', test: /\.js$/, exclude: /node_modules/, loader: 'source-map-loader' },
],
},
externals: {
react: 'React',
'react-dom': 'ReactDOM',
},
// addition - add source-map support
}