-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack.config.js
66 lines (66 loc) · 3.58 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const nodePath = require("path");
const task_1 = require("./task");
const CopyPlugin = require('copy-webpack-plugin');
const examplePath = './docs/src/pages/Component';
const isDev = process.env.NODE_ENV === 'development';
const webpackConfig = {
entry: {
index: nodePath.resolve(__dirname, 'docs/src/App.tsx'),
BackTop: nodePath.resolve(__dirname, examplePath, './BackTop/基本用法/index.tsx'),
Carousel: nodePath.resolve(__dirname, examplePath, './Carousel/基本用法/index.tsx'),
Choice: nodePath.resolve(__dirname, examplePath, './Choice/基本用法/index.tsx'),
Container: nodePath.resolve(__dirname, examplePath, './Container/基本用法/index.tsx'),
Countdown: nodePath.resolve(__dirname, examplePath, './Countdown/基本用法/index.tsx'),
DatePicker: nodePath.resolve(__dirname, examplePath, './DatePicker/基本用法/index.tsx'),
Download: nodePath.resolve(__dirname, examplePath, './Download/基本用法/index.tsx'),
Form: nodePath.resolve(__dirname, examplePath, './Form/基本用法/index.tsx'),
Icon: nodePath.resolve(__dirname, examplePath, './Icon/基本用法/index.tsx'),
Image: nodePath.resolve(__dirname, examplePath, './Image/基本用法/index.tsx'),
Mask: nodePath.resolve(__dirname, examplePath, './Mask/基本用法/index.tsx'),
Modal: nodePath.resolve(__dirname, examplePath, './Modal/基本用法/index.tsx'),
Picker: nodePath.resolve(__dirname, examplePath, './Picker/基本用法/index.tsx'),
Popup: nodePath.resolve(__dirname, examplePath, './Popup/基本用法/index.tsx'),
PageStack: nodePath.resolve(__dirname, examplePath, './PageStack/基本用法/index.tsx'),
RequestView: nodePath.resolve(__dirname, examplePath, './RequestView/基本用法/index.tsx'),
Scroll: nodePath.resolve(__dirname, examplePath, './Scroll/基本用法/index.tsx'),
ScrollLoader: nodePath.resolve(__dirname, examplePath, './ScrollLoader/基本用法/index.tsx'),
Tab: nodePath.resolve(__dirname, examplePath, './Tab/基本用法/index.tsx'),
Text: nodePath.resolve(__dirname, examplePath, './Text/基本用法/index.tsx'),
Toast: nodePath.resolve(__dirname, examplePath, './Toast/基本用法/index.tsx'),
Upload: nodePath.resolve(__dirname, examplePath, './Upload/基本用法/index.tsx')
},
dirname: __dirname,
addVersion: false,
vender: false,
outputDir: './docs/dist/',
publicPath: isDev ? '/docs/dist/' : '/bsl/docs/dist/',
tsInclude: [
nodePath.resolve(__dirname, 'docs'),
nodePath.resolve(__dirname, 'component'),
nodePath.resolve(__dirname, 'hooks'),
nodePath.resolve(__dirname, 'utils'),
nodePath.resolve(__dirname, 'app'),
nodePath.resolve(__dirname, 'styles'),
nodePath.resolve(__dirname, 'css-in-js')
],
plugins: [
new CopyPlugin({
patterns: [{
from: './node_modules/antd/es/style/index.css',
to: 'css/antd.css'
}, {
from: './node_modules/antd/es/alert/style/index.css',
to: 'css/antd.alert.css'
}, {
from: './node_modules/antd/es/icon/style/index.css',
to: 'css/antd.icon.css'
}, {
from: './node_modules/antd/es/popover/style/index.css',
to: 'css/antd.popover.css'
}]
})
]
};
module.exports = task_1.default(webpackConfig);