-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.config.js
executable file
·50 lines (49 loc) · 1.33 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
49
50
const path = require('path');
// This module isn't used to build the documentation. We use Next.js for that.
// This module is used by the visual regression tests to run the demos.
module.exports = {
context: path.resolve(__dirname),
resolve: {
modules: [path.join(__dirname, '../'), 'node_modules'],
alias: {
api: path.resolve(__dirname, './src/api.js'),
enum: path.resolve(__dirname, './src/utils/enum.js'),
config: path.resolve(__dirname, './src/config.js'),
styles: path.resolve(__dirname, './src/styles'),
utils: path.resolve(__dirname, './src/utils'),
components: path.resolve(__dirname, './src/components'),
icons: path.resolve(__dirname, './src/icons'),
dva: 'dva-no-router',
notify: path.resolve(__dirname, './src/utils/notify'),
},
},
output: {
path: path.join(__dirname, 'build'),
filename: 'bundle.js',
publicPath: '/build/',
},
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel-loader',
query: {
cacheDirectory: true,
},
},
{
test: /\.svg$/,
loader: 'file-loader',
},
{
test: /\.md$/,
loader: 'raw-loader',
},
{
test: /\.css$/,
loader: 'style-loader!css-loader',
},
],
},
};