-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.base.js
More file actions
65 lines (63 loc) · 1.74 KB
/
Copy pathwebpack.config.base.js
File metadata and controls
65 lines (63 loc) · 1.74 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/* eslint-disable @typescript-eslint/no-var-requires */
const path = require('path');
module.exports = {
// Change to your "entry-point".
entry: './src/index.tsx',
output: {
path: path.resolve(__dirname, 'dist'),
filename: '[name].[contentHash].js',
},
resolve: {
extensions: ['.ts', '.tsx', '.js', '.json', 'jpg'],
alias: {
'react-dom': '@hot-loader/react-dom',
Assets: path.resolve(__dirname, 'src/assets/'),
Components: path.resolve(__dirname, 'src/components/'),
Api: path.resolve(__dirname, 'src/api/'),
Features: path.resolve(__dirname, 'src/features/'),
Globals: path.resolve(__dirname, 'src/globals/'),
Redux: path.resolve(__dirname, 'src/redux/'),
},
},
module: {
rules: [
{
enforce: 'pre',
test: /\.(ts|tsx|js|jsx)?$/,
exclude: /node_modules/,
use: {
loader: 'eslint-loader',
options: {
emitError: true,
},
},
},
{
test: /\.(js|jsx)?$/,
exclude: /node_modules/,
use: 'babel-loader',
},
{
test: /\.(ts|tsx)?$/,
exclude: /node_modules/,
// we use transpilation only, because error checking in on different process.
// ForkTsCheckerWebpackPlugin is checking types while in develop mode.
use: [{ loader: 'ts-loader', options: { transpileOnly: true } }],
},
{
test: /\.css$/,
use: [{ loader: 'style-loader' }, { loader: 'css-loader' }],
},
{
test: /\.(svg|png|jp?g|gif)$/,
use: {
loader: 'file-loader',
options: {
name: '[name].[contentHash].[ext]',
outputPath: 'assets',
},
},
},
],
},
};