forked from alibaba/GGEditor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.demo.dev.js
57 lines (50 loc) · 1.05 KB
/
webpack.config.demo.dev.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
51
52
53
54
55
56
57
const path = require('path');
const { merge } = require('lodash');
const baseConfig = require('./webpack.config.base');
const entry = {
bundle: path.resolve(__dirname, '..', 'demo/src/index.js'),
};
const alias = {
'@src': path.resolve(__dirname, '..', 'src'),
};
const externals = {
'react-dom': {
root: 'ReactDOM',
commonjs2: 'react-dom',
commonjs: 'react-dom',
amd: 'react-dom',
},
'react-router-dom': {
root: 'ReactRouterDOM',
commonjs: 'react-router-dom',
commonjs2: 'react-router-dom',
amd: 'react-router-dom',
},
antd: {
root: 'antd',
commonjs: 'antd',
commonjs2: 'antd',
amd: 'antd',
},
};
const devtool = 'source-map';
const devServer = {
contentBase: path.resolve(__dirname, '..', 'demo'),
publicPath: '/dist',
disableHostCheck: true,
};
const output = {
path: path.resolve(__dirname, '..', 'demo/dist'),
filename: '[name].js',
libraryTarget: 'umd',
};
module.exports = merge(baseConfig, {
entry,
resolve: {
alias,
},
externals,
devtool,
devServer,
output,
});